Commit 31f0324f authored by Tristan Cavelier's avatar Tristan Cavelier

function moved

parent 8f2f3f21
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true */
/*global uniqueJSONStringify */
/*global uniqueJSONStringify, methodType */
var defaults = {}, constants = {};
......@@ -357,31 +357,6 @@ defaults.job_rule_conditions = {};
uniqueJSONStringify(b.storage_spec);
}
/**
* Guess if the method is a writer or a reader.
*
* @param {String} method The method name
* @return {String} "writer", "reader" or "unknown"
*/
function methodType(method) {
switch (method) {
case "post":
case "put":
case "putAttachment":
case "remove":
case "removeAttachment":
case "repair":
return 'writer';
case "get":
case "getAttachment":
case "allDocs":
case "check":
return 'reader';
default:
return 'unknown';
}
}
/**
* Compare two jobs and test if they are writers
*
......
......@@ -373,3 +373,28 @@ function arrayInsert(array, position) { // args*
return arrayExtend(array, array_part);
}
exports.util.arrayInsert = arrayInsert;
/**
* Guess if the method is a writer or a reader.
*
* @param {String} method The method name
* @return {String} "writer", "reader" or "unknown"
*/
function methodType(method) {
switch (method) {
case "post":
case "put":
case "putAttachment":
case "remove":
case "removeAttachment":
case "repair":
return 'writer';
case "get":
case "getAttachment":
case "allDocs":
case "check":
return 'reader';
default:
return 'unknown';
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment