Comparing version 5.0.0 to 5.1.0
(function() { | ||
'use strict'; | ||
var L, base, i, len, method_count, module, name, njs_util, ref, route, routes, rpr, value, σ_cnd; | ||
var base, is_function, k, njs_util, ref, ref1, ref2, rpr, v, σ_cnd; | ||
@@ -21,34 +21,27 @@ //########################################################################################################### | ||
//=========================================================================================================== | ||
// ACQUISITION | ||
//----------------------------------------------------------------------------------------------------------- | ||
method_count = 0; | ||
is_function = function(x) { | ||
return (Object.prototype.toString.call(x)) === '[object Function]'; | ||
}; | ||
routes = ['./TRM', './BITSNPIECES', './TYPES']; | ||
ref = require('./TRM'); | ||
for (k in ref) { | ||
v = ref[k]; | ||
//=========================================================================================================== | ||
// ACQUISITION | ||
//----------------------------------------------------------------------------------------------------------- | ||
(this[k] = is_function(v) ? v.bind(this) : v); | ||
} | ||
L = this; | ||
ref1 = require('./BITSNPIECES'); | ||
for (k in ref1) { | ||
v = ref1[k]; | ||
(this[k] = is_function(v) ? v.bind(this) : v); | ||
} | ||
//........................................................................................................... | ||
for (i = 0, len = routes.length; i < len; i++) { | ||
route = routes[i]; | ||
ref = module = require(route); | ||
for (name in ref) { | ||
value = ref[name]; | ||
if (this[name] != null) { | ||
throw new Error(`duplicate name ${rpr(name)}`); | ||
} | ||
method_count += +1; | ||
if ((Object.prototype.toString.call(value)) === '[object Function]') { | ||
// value = value.bind module if ( Object::toString.call value ) is '[object Function]' | ||
value = value.bind(L); | ||
} | ||
this[name] = value; | ||
} | ||
ref2 = require('./TYPES'); | ||
for (k in ref2) { | ||
v = ref2[k]; | ||
(this[k] = is_function(v) ? v.bind(this) : v); | ||
} | ||
// ############################################################################################################ | ||
// unless module.parent? | ||
// console.log "acquired #{method_count} names from #{routes.length} sub-modules" | ||
// @dir @ | ||
}).call(this); |
{ | ||
"name": "cnd", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"description": "a grab-bag NodeJS package mainly for functionalities that used to live in coffeenode-trm, coffeenode-bitsnpieces, and coffeenode-types", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
3
366290
2775