aboutsummaryrefslogtreecommitdiff
path: root/node_modules/mongodb-core/lib/connection/utils.js
diff options
context:
space:
mode:
authornanalelfe <nargiza.nosirova@mail.utoronto.ca>2016-07-27 12:46:04 +0000
committernanalelfe <nargiza.nosirova@mail.utoronto.ca>2016-07-27 12:46:04 +0000
commit7bee9b7e0968b650b3dbe2e35bf3a0d7d6e5e00e (patch)
tree4e63af46a6e306bfeac1ef4b8bd83e1b45a37257 /node_modules/mongodb-core/lib/connection/utils.js
parent6520aa92a114d65b17b178a952c8985e84afd231 (diff)
Removed some unused modules with prune
Diffstat (limited to 'node_modules/mongodb-core/lib/connection/utils.js')
-rw-r--r--node_modules/mongodb-core/lib/connection/utils.js67
1 files changed, 0 insertions, 67 deletions
diff --git a/node_modules/mongodb-core/lib/connection/utils.js b/node_modules/mongodb-core/lib/connection/utils.js
deleted file mode 100644
index 019ef19..0000000
--- a/node_modules/mongodb-core/lib/connection/utils.js
+++ /dev/null
@@ -1,67 +0,0 @@
-"use strict";
-
-// Set property function
-var setProperty = function(obj, prop, flag, values) {
- Object.defineProperty(obj, prop.name, {
- enumerable:true,
- set: function(value) {
- if(typeof value != 'boolean') throw new Error(f("%s required a boolean", prop.name));
- // Flip the bit to 1
- if(value == true) values.flags |= flag;
- // Flip the bit to 0 if it's set, otherwise ignore
- if(value == false && (values.flags & flag) == flag) values.flags ^= flag;
- prop.value = value;
- }
- , get: function() { return prop.value; }
- });
-}
-
-// Set property function
-var getProperty = function(obj, propName, fieldName, values, func) {
- Object.defineProperty(obj, propName, {
- enumerable:true,
- get: function() {
- // Not parsed yet, parse it
- if(values[fieldName] == null && obj.isParsed && !obj.isParsed()) {
- obj.parse();
- }
-
- // Do we have a post processing function
- if(typeof func == 'function') return func(values[fieldName]);
- // Return raw value
- return values[fieldName];
- }
- });
-}
-
-// Set simple property
-var getSingleProperty = function(obj, name, value) {
- Object.defineProperty(obj, name, {
- enumerable:true,
- get: function() {
- return value
- }
- });
-}
-
-// Shallow copy
-var copy = function(fObj, tObj) {
- tObj = tObj || {};
- for(var name in fObj) tObj[name] = fObj[name];
- return tObj;
-}
-
-var debugOptions = function(debugFields, options) {
- var finaloptions = {};
- debugFields.forEach(function(n) {
- finaloptions[n] = options[n];
- });
-
- return finaloptions;
-}
-
-exports.setProperty = setProperty;
-exports.getProperty = getProperty;
-exports.getSingleProperty = getSingleProperty;
-exports.copy = copy;
-exports.debugOptions = debugOptions;