New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@stringstack/core

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stringstack/core - npm Package Compare versions

Comparing version
0.2.0
to
0.3.0
+64
.eslintrc.json
{
"env": {
"es6": true,
"mocha": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 2015,
"sourceType": "script"
},
"rules": {
"curly": "error",
"strict": [
"error",
"global"
],
"eqeqeq": "error",
"no-undefined": "error",
"vars-on-top": "error",
"no-useless-return": "error",
"no-unused-expressions": "error",
"no-throw-literal": "error",
"no-return-assign": "error",
"no-new": "error",
"no-console": "off",
"no-multi-spaces": "error",
"no-loop-func": "error",
"no-implicit-globals": "error",
"no-floating-decimal": "error",
"no-extend-native": "error",
"no-eq-null": "error",
"wrap-iife": [ "error", "inside" ],
"guard-for-in": "error",
"default-case": "error",
"dot-location": [ "error", "property" ],
"indent": [
"error",
2,
{
"SwitchCase": 1
}
],
"dot-notation": [ "error", { "allowKeywords": true } ],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"getter-return": [
"error",
{
"allowImplicit": false
}
]
}
}
'use strict';
const TestBase = require( '../class.base' );
class TestCycleA extends TestBase {
constructor( deps ) {
super( deps, 'TestCycleA' );
this._b = deps.get( './test/lib/cycle.err/class.b' );
}
}
module.exports = TestCycleA;
'use strict';
const TestBase = require( '../class.base' );
class TestCycleB extends TestBase {
constructor( deps ) {
super( deps, 'TestCycleB' );
this._c = deps.get( './test/lib/cycle.err/class.c' );
}
}
module.exports = TestCycleB;
'use strict';
const TestBase = require( '../class.base' );
class TestCycleC extends TestBase {
constructor( deps ) {
super( deps, 'TestCycleC' );
this._d = deps.get( './test/lib/cycle.err/class.d' );
}
}
module.exports = TestCycleC;
'use strict';
const TestBase = require( '../class.base' );
class TestCycleD extends TestBase {
constructor( deps ) {
super( deps, 'TestCycleD' );
this._b = deps.get( './test/lib/cycle.err/class.b' );
this._e = deps.get( './test/lib/cycle.err/class.e' );
}
}
module.exports = TestCycleD;
'use strict';
const TestBase = require( '../class.base' );
class TestCycleE extends TestBase {
constructor( deps ) {
super( deps, 'TestCycleE' );
}
}
module.exports = TestCycleE;
'use strict';
const TestBase = require( '../class.base' );
class ErrGetDinit extends TestBase {
constructor( deps ) {
super( deps, 'ErrGetDinit' );
}
dinit( done ) {
this._f = this._deps.get( './test/lib/class.f' );
super.dinit( done );
}
}
module.exports = ErrGetDinit;
'use strict';
const TestBase = require( '../class.base' );
class ErrGetInit extends TestBase {
constructor( deps ) {
super( deps, 'ErrGetInit' );
}
init( done ) {
this._f = this._deps.get( './test/lib/class.f' );
super.init( done );
}
}
module.exports = ErrGetInit;
'use strict';
const TestBase = require( '../class.base' );
class ErrGetMethod extends TestBase {
constructor( deps ) {
super( deps, 'ErrGetMethod' );
}
method( done ) {
this._c = this._deps.get( './test/lib/class.c' );
done();
}
}
module.exports = ErrGetMethod;
'use strict';
const TestBase = require( '../class.base' );
class TestLoadApp extends TestBase {
constructor( deps ) {
super( deps, 'TestLoadApp' );
this._err_load_self = deps.get( 'app' );
}
}
module.exports = TestLoadApp;
'use strict';
const TestBase = require( '../class.base' );
class TestLoadSelf extends TestBase {
constructor( deps ) {
super( deps, 'TestLoadSelf' );
this._err_load_self = deps.get( './test/lib/err/class.load-self' );
}
}
module.exports = TestLoadSelf;
'use strict';
const TestBase = require( '../class.base' );
class TestA extends TestBase {
constructor( deps ) {
super( deps, 'TestA' );
this._b = deps.get( './test/lib/general/class.b' );
}
}
module.exports = TestA;
'use strict';
const TestBase = require( '../class.base' );
class TestB extends TestBase {
constructor( deps ) {
super( deps, 'TestB' );
this._database = deps.get( './test/lib/general/class.database' );
this._c = deps.get( './test/lib/general/class.c' );
}
}
module.exports = TestB;
'use strict';
const TestBase = require( '../class.base' );
class TestC extends TestBase {
constructor( deps ) {
super( deps, 'TestC' );
this._config = deps.get( 'config' );
this._d = deps.get( './test/lib/general/class.d' );
this._e = deps.get( './test/lib/general/class.e' );
}
}
module.exports = TestC;
'use strict';
const TestBase = require( '../class.base' );
class TestConfigSetup extends TestBase {
constructor( deps ) {
super( deps, 'TestConfigSetup' );
// reverse dependency, ensures TestConfigSetup is initialized before config, and de-initialized after config.
this._config = deps.inject( 'config' );
}
}
module.exports = TestConfigSetup;
'use strict';
const TestBase = require( '../class.base' );
class TestD extends TestBase {
constructor( deps ) {
super( deps, 'TestD' );
}
}
module.exports = TestD;
'use strict';
const TestBase = require( '../class.base' );
class TestDatabase extends TestBase {
constructor( deps ) {
super( deps, 'TestDatabase' );
this._config = deps.get( 'config' );
}
}
module.exports = TestDatabase;
'use strict';
const TestBase = require( '../class.base' );
class TestE extends TestBase {
constructor( deps ) {
super( deps, 'TestE' );
this._config = deps.get( 'config' );
this._database = deps.get( './test/lib/general/class.database' );
this._h = deps.get( './test/lib/general/static.h' );
this._f = deps.get( './test/lib/general/class.f' );
}
}
module.exports = TestE;
'use strict';
const TestBase = require( '../class.base' );
class TestF extends TestBase {
constructor( deps ) {
super( deps, 'TestF' );
this._database = deps.get( './test/lib/general/class.database' );
this._g = deps.get( './test/lib/general/class.g' );
this._json = deps.get( './test/lib/data.json' );
}
}
module.exports = TestF;
'use strict';
const TestBase = require( '../class.base' );
class TestG extends TestBase {
constructor( deps ) {
super( deps, 'TestG' );
this._database = deps.get( './test/lib/general/class.database' );
}
}
module.exports = TestG;
'use strict';
const TestBase = require( '../class.base' );
class TestNodeModule extends TestBase {
constructor( deps ) {
super( deps, 'TestNodeModule' );
// pulls from node_modules, not test/lib/fake-module.js
this._fakeModule = deps.get( 'fake-module' );
}
}
module.exports = TestNodeModule;
'use strict';
const TestBase = require( '../class.base' );
let testBase = null;
// static modules get load, init, dinit called, which are parallels to new, init, dinit on class modules.
let StaticH = {
load: ( deps ) => {
testBase = new TestBase( deps, 'StaticH' );
},
init: ( done ) => {
testBase.init( done );
},
dinit: ( done ) => {
testBase.dinit( done );
}
};
module.exports = StaticH;
'use strict';
const TestBase = require( '../class.base' );
class TestLogA extends TestBase {
constructor( deps ) {
super( deps, 'TestLogA' );
this._logger = deps.get( 'logger' );
this._logger( 'info', 'TestLogA constructor', { meta: 'data' } );
this._logb = deps.get( './test/lib/log/class.b' );
}
init( done ) {
this._logger( 'debug', 'TestLogA init', { meta: 'data' } );
this._logger( 'warn', 'TestLogA init warn' );
this._logger( 'warning', 'TestLogA init warning' );
super.init( done );
}
dinit( done ) {
this._logger( 'debug', 'TestLogA dinit', { meta: 'data' } );
super.dinit( done );
}
}
module.exports = TestLogA;
'use strict';
const TestBase = require( '../class.base' );
class TestLogB extends TestBase {
constructor( deps ) {
super( deps, 'TestLogB' );
this._logger = deps.get( 'logger' );
this._logger( 'info', 'TestLogB constructor', { meta: 'data' } );
this._logger( 'verbose', 'TestLogB constructor', { meta: 'data' } );
}
init( done ) {
this._logger( 'debug', 'TestLogB init', { meta: 'data' } );
super.init( done );
}
dinit( done ) {
this._logger( 'debug', 'TestLogB dinit', { meta: 'data' } );
this._logger( 'information', 'TestLogB information' );
super.dinit( done );
}
}
module.exports = TestLogB;
'use strict';
const TestBase = require( '../class.base' );
class TestNonCycleA extends TestBase {
constructor( deps ) {
super( deps, 'TestNonCycleA' );
this._b = deps.get( './test/lib/non-cycle/class.b' );
}
}
module.exports = TestNonCycleA;
'use strict';
const TestBase = require( '../class.base' );
class TestNonCycleB extends TestBase {
constructor( deps ) {
super( deps, 'TestNonCycleB' );
this._c = deps.get( './test/lib/non-cycle/class.c' );
this._g = deps.get( './test/lib/non-cycle/class.g' );
}
}
module.exports = TestNonCycleB;
'use strict';
const TestBase = require( '../class.base' );
class TestNonCycleC extends TestBase {
constructor( deps ) {
super( deps, 'TestNonCycleC' );
this._d = deps.get( './test/lib/non-cycle/class.d' );
this._e = deps.get( './test/lib/non-cycle/class.e' );
}
}
module.exports = TestNonCycleC;
'use strict';
const TestBase = require( '../class.base' );
class TestNonCycleD extends TestBase {
constructor( deps ) {
super( deps, 'TestNonCycleD' );
this._e = deps.get( './test/lib/non-cycle/class.e' );
}
}
module.exports = TestNonCycleD;
'use strict';
const TestBase = require( '../class.base' );
class TestNonCycleE extends TestBase {
constructor( deps ) {
super( deps, 'TestNonCycleE' );
this._f = deps.get( './test/lib/non-cycle/class.f' );
this._i = deps.get( './test/lib/non-cycle/class.i' );
}
}
module.exports = TestNonCycleE;
'use strict';
const TestBase = require( '../class.base' );
class TestNonCycleF extends TestBase {
constructor( deps ) {
super( deps, 'TestNonCycleF' );
}
}
module.exports = TestNonCycleF;
'use strict';
const TestBase = require( '../class.base' );
class TestNonCycleG extends TestBase {
constructor( deps ) {
super( deps, 'TestNonCycleG' );
this._h = deps.get( './test/lib/non-cycle/class.h' );
}
}
module.exports = TestNonCycleG;
'use strict';
const TestBase = require( '../class.base' );
class TestNonCycleH extends TestBase {
constructor( deps ) {
super( deps, 'TestNonCycleH' );
this._i = deps.get( './test/lib/non-cycle/class.i' );
this._c = deps.get( './test/lib/non-cycle/class.c' );
}
}
module.exports = TestNonCycleH;
'use strict';
const TestBase = require( '../class.base' );
class TestNonCycleI extends TestBase {
constructor( deps ) {
super( deps, 'TestNonCycleI' );
}
}
module.exports = TestNonCycleI;
'use strict';
const TestBase = require( '../class.base' );
class TestRootA extends TestBase {
constructor( deps ) {
super( deps, 'TestRootA' );
this._root_b = deps.get( './test/lib/root/class.b' );
}
}
module.exports = TestRootA;
'use strict';
const TestBase = require( '../class.base' );
class TestRootB extends TestBase {
constructor( deps ) {
super( deps, 'TestRootB' );
}
}
module.exports = TestRootB;
'use strict';
const TestBase = require( '../class.base' );
class TestRootC extends TestBase {
constructor( deps ) {
super( deps, 'TestRootC' );
this._root_d = deps.get( './test/lib/root/class.d' );
}
}
module.exports = TestRootC;
'use strict';
const TestBase = require( '../class.base' );
class TestRootD extends TestBase {
constructor( deps ) {
super( deps, 'TestRootD' );
}
}
module.exports = TestRootD;
+16
-2

@@ -30,8 +30,22 @@ 'use strict';

set( path, value ) {
return this._loader.set( this._path, path, value );
inject( path ) {
if ( path === 'logger' ) {
return ( level, message, meta ) => {
this._logger( level, this._path, message, meta );
};
}
return this._loader.inject( this._path, path );
}
// set( path, value ) {
// return this._loader.set( this._path, path, value );
// }
}
module.exports = Container;
+10
-4

@@ -12,3 +12,3 @@ 'use strict';

createApp( config ) {
createApp( config = {} ) {

@@ -21,2 +21,4 @@ class App {

config = config || {};
if ( typeof config.log !== 'function' ) {

@@ -53,2 +55,5 @@ config.log = () => {

break;
default:
// NO-OP
break;
}

@@ -60,2 +65,3 @@

// eslint-disable-next-line no-console
console.error( 'user log method threw an exception', e );

@@ -71,6 +77,6 @@

this._loader.set( 'app', 'env', env );
this._loader._set( 'app', 'env', env );
let nconf = new nconfProvider();
this._loader.set( 'app', 'config', nconf );
this._loader._set( 'app', 'config', nconf );

@@ -128,2 +134,2 @@ let rootComponents = config.rootComponents;

module.exports = Core;
module.exports = Core;

@@ -13,8 +13,17 @@ 'use strict';

this._instantiateCurrent = null;
this._instantiateStack = [];
this._initializeStack = [];
this._dinitializeStack = [];
this._instantiateStack = [ 'app' ];
/**
*
* @type {{
* path: string,
* instance: instance,
* initialized: boolean,
* dependencies: [ string ]
* }}
*
* @private
*/
this._components = {};
this._componentInstances = {};

@@ -27,9 +36,7 @@ }

// clone then reverse the initialize stack
let components = this._initializeStack.slice( 0 ).reverse();
async.eachSeries( this._generateInitList(), ( path, done ) => {
async.eachSeries( components, ( path, done ) => {
const component = this._components[ path ];
const instance = this._componentInstances[ path ];
let component = this._components[ path ];
// bad component entry or already initialized, there is a bug someplace in this code!

@@ -42,3 +49,3 @@ if ( !component ) {

// no initialization needed
if ( path === 'config' ) {
if ( path === 'app' || path === 'config' || path === 'env' ) {
component.initialized = true;

@@ -53,18 +60,22 @@ }

if ( component.instance && typeof component.instance.init === 'function' ) {
if ( instance && typeof instance.init === 'function' ) {
try {
component.instance.init( ( err ) => {
component.initialized = true;
instance.init( ( err ) => {
if ( err ) {
this._logger( 'error', 'loader', 'error initializing component ' + path, err );
return done( err );
}
component.initialized = true;
this._logger( 'info', 'loader', 'initialized component ' + path );
return done();
} );
} catch ( e ) {
this._logger( 'error', 'loader', 'caught exception initializing component ' + path, e );
return done( e );

@@ -75,4 +86,6 @@ }

// no init function, consider it initialized
this._logger( 'info', 'loader', 'initialized component ' + path );
component.initialized = true;
done();

@@ -100,21 +113,19 @@

let components = this._dinitializeStack;
async.eachSeries( this._generateDinitList(), ( path, done ) => {
async.eachSeries( components, ( path, done ) => {
const component = this._components[ path ];
const instance = this._componentInstances[ path ];
let component = this._components[ path ];
// bad component entry or already dinitialized, there is a bug someplace in this code!
// bad component entry or already initialized, there is a bug someplace in this code!
if ( !component ) {
this._logger( 'warn',
'loader', 'possible bug in stringstack/core, component not found in d-init stack ' + path );
this._logger( 'warn', 'loader', 'possible bug in stringstack/core, component not found in init stack ' + path );
return done();
}
// no dinitialization needed
if ( path === 'config' ) {
// no initialization needed
if ( path === 'app' || path === 'config' || path === 'env' ) {
component.initialized = false;
}
// we never initialized this, skip it
// we are already shutting down, skip it
if ( !component.initialized ) {

@@ -125,17 +136,22 @@ this._logger( 'info', 'loader', 'd-initialized component ' + path );

if ( component.instance && typeof component.instance.dinit === 'function' ) {
if ( instance && typeof instance.dinit === 'function' ) {
try {
component.instance.dinit( ( err ) => {
component.initialized = false;
instance.dinit( ( err ) => {
if ( err ) {
this._logger( 'error', 'loader', 'error d-initializing component ' + path, err );
return done( err );
}
component.initialized = false;
this._logger( 'info', 'loader', 'd-initialized component ' + path );
return done();
} );
} catch ( e ) {
this._logger( 'error', 'loader', 'caught exception d-initializing component ' + path, e );
return done( e );

@@ -146,4 +162,6 @@ }

// no dinit function, consider it d-initialized
this._logger( 'info', 'loader', 'd-initialized component ' + path );
component.initialized = false;
done();

@@ -167,54 +185,43 @@

inject( sourcePath, targetPath ) {
return this._load( sourcePath, targetPath, true );
}
get( sourcePath, targetPath ) {
return this._load( sourcePath, targetPath, false );
}
if ( typeof sourcePath !== 'string' || sourcePath.trim().lenght < 1 ) {
throw new Error( 'sourcePath must be a non-empty string string' );
}
_load( sourcePath, targetPath, inject = false ) {
if ( typeof targetPath !== 'string' || targetPath.trim().lenght < 1 ) {
throw new Error( 'targetPath must be a non-empty string string' );
}
this._checkPath( sourcePath );
this._checkPath( targetPath );
// make sure the paths are standard, so all comparisons work later on
sourcePath = this._normalizePath( sourcePath );
targetPath = this._normalizePath( targetPath );
if ( sourcePath !== this._instantiateCurrent && sourcePath !== 'app' ) {
throw new Error( 'you must access your dependencies in your constructor only' );
if ( sourcePath !== this._instantiateStackTop() ) {
throw new Error( 'you must access your dependencies in your constructor or load() method only' );
}
if ( this._createsCycle( sourcePath, targetPath ) ) {
throw new Error( 'dependency cycle created' );
}
// ensure stub in dependency tree without instance
this._setComponent( targetPath );
// only create one of everything
if ( this._components.hasOwnProperty( targetPath ) ) {
// reset the init/dinit stacks to ensure this component initializes before everything that needs it
// and dinitializes after everything that needs it.
this._resetStacks( targetPath );
return this._components[ targetPath ].instance;
if ( inject ) {
this._setComponentDependency( targetPath, sourcePath ); // source requested becoming dependency of target
} else {
this._setComponentDependency( sourcePath, targetPath ); // source requested target as a dependency
}
let targetPathResolve = targetPath;
if ( targetPathResolve.startsWith( '.' + Path.sep ) || targetPathResolve.startsWith( '..' + Path.sep ) ) {
targetPathResolve = Path.normalize( Path.join( process.cwd(), targetPath ) );
if ( this._componentInstances.hasOwnProperty( targetPath ) && this._componentInstances[ targetPath ] ) {
return this._componentInstances[ targetPath ];
}
let Module = null;
try {
Module = require( targetPathResolve );
} catch ( e ) {
throw e;
}
this._instantiateStack.push( targetPath );
this._instantiateCurrent = targetPath;
// initializes the init/dinit stacks and stores initial component reference.
// also, avoid circular dependency
this.set( sourcePath, targetPath, null );
const container = new Container( targetPath, this, this._logger );
let container = new Container( targetPath, this, this._logger );
const Module = require( targetPath );
let instance = null;
if ( typeof Module === 'function' ) {

@@ -226,12 +233,9 @@

} else {
this._logger( 'info', 'loader', 'loading static component: ' + targetPath );
instance = Module;
// if the component returns an object, we will pass dependencies to a load method if it exists
if ( typeof Module === 'object' && Module && typeof Module.load === 'function' ) {
this._logger( 'info', 'loader', 'loading singleton component: ' + targetPath );
if ( Module && typeof Module.load === 'function' ) {
Module.load( container );
} else {
this._logger( 'info', 'loader', 'imported static component: ' + targetPath );
}

@@ -243,10 +247,4 @@

if ( this._instantiateStack.length > 0 ) {
this._instantiateCurrent = this._instantiateStack[ this._instantiateStack.length - 1 ];
} else {
this._instantiateCurrent = null;
}
this._setComponent( targetPath, instance );
this.set( sourcePath, targetPath, instance );
return instance;

@@ -256,74 +254,77 @@

_resetStacks( targetPath ) {
_instantiateStackTop() {
// move to start of init stack, items popped off
let initIndex = this._initializeStack.indexOf( targetPath );
if ( initIndex > -1 ) {
this._initializeStack.push( this._initializeStack[ initIndex ] );
this._initializeStack.splice( initIndex, 1 );
if ( this._instantiateStack.length < 1 ) {
return null;
}
// move to end of dinit stack, items shifted off
let dinitIndex = this._dinitializeStack.indexOf( targetPath );
if ( dinitIndex > -1 ) {
this._dinitializeStack.push( this._dinitializeStack[ dinitIndex ] );
this._dinitializeStack.splice( dinitIndex, 1 );
return this._instantiateStack[ this._instantiateStack.length - 1 ];
}
_checkPath( path ) {
if ( typeof path !== 'string' || path.trim().lenght < 1 ) {
throw new Error( 'path must be a non-empty string string' );
}
// propagate the reset to all child dependencies
this._components[ targetPath ].dependencies.forEach( ( dependencyPath ) => {
this._resetStacks( dependencyPath );
} );
}
set( sourcePath, targetPath, instance ) {
_setComponent( path, instance = null ) {
if ( typeof sourcePath !== 'string' || sourcePath.trim().lenght < 1 ) {
throw new Error( 'sourcePath must be a non-empty string string' );
}
if ( !this._components.hasOwnProperty( path ) ) {
if ( typeof targetPath !== 'string' || targetPath.trim().lenght < 1 ) {
throw new Error( 'targetPath must be a non-empty string string' );
this._components[ path ] = {
path: path,
initialized: false,
dependencies: []
};
this._componentInstances[ path ] = instance || null;
} else if ( !this._componentInstances[ path ] ) {
// replace stub
this._componentInstances[ path ] = instance || null;
}
if ( this._initializeStack.indexOf( targetPath ) < 0 ) {
this._initializeStack.push( targetPath ); // we pop off this stack to init
return this._components[ path ].instance;
}
_setComponentDependency( sourcePath, targetPath ) {
if ( !this._components.hasOwnProperty( sourcePath ) ) {
this._components[ sourcePath ] = {
path: sourcePath,
instance: null,
initialized: false,
dependencies: []
};
}
if ( this._dinitializeStack.indexOf( targetPath ) < 0 ) {
this._dinitializeStack.push( targetPath ); // we shift off this stack to dinit
this._components[ sourcePath ].dependencies.push( targetPath );
if ( this._createsCycle( sourcePath, targetPath ) ) {
throw new Error( 'dependency cycle created' );
}
let defaultInitialized = false;
sourcePath = this._normalizePath( sourcePath );
targetPath = this._normalizePath( targetPath );
}
// ensure we track dependencies to check for cycles and resets
if ( sourcePath !== 'app' && this._components.hasOwnProperty( sourcePath ) ) {
let dependencyIndex = this._components[ sourcePath ].dependencies.indexOf( targetPath );
if ( dependencyIndex < 0 ) {
this._components[ sourcePath ].dependencies.push( targetPath );
}
}
if ( this._components.hasOwnProperty( targetPath ) ) {
_set( sourcePath, targetPath, targetInstance ) {
this._components[ targetPath ].instance = instance;
this._components[ targetPath ].initialized = defaultInitialized;
this._checkPath( sourcePath );
this._checkPath( targetPath );
return instance;
sourcePath = this._normalizePath( sourcePath );
targetPath = this._normalizePath( targetPath );
}
this._setComponent( sourcePath );
this._setComponent( targetPath, targetInstance );
this._components[ targetPath ] = {
path: targetPath,
instance: instance,
initialized: defaultInitialized,
dependencies: []
};
this._setComponentDependency( sourcePath, targetPath );
return instance;
}

@@ -353,9 +354,6 @@

_createsCycle( sourcePath, targetPath, prefix ) {
_createsCycle( sourcePath, targetPath ) {
if ( typeof prefix !== 'string' ) {
prefix = '';
}
// app is the meta root of all, so it always creates a cycle if someone includes it
// also, its a cycle if something eventually includes itself
if ( targetPath === 'app' || sourcePath === targetPath ) {

@@ -378,3 +376,3 @@ return true;

cycleExists = this._createsCycle( sourcePath, dependencyPath, prefix + '\t' );
cycleExists = this._createsCycle( sourcePath, dependencyPath );

@@ -387,2 +385,70 @@ } );

_generateInitList() {
// The init order is reverse breadth first search. Dinit order is breadth first search, so we just reverse that list
// and return it.
return this._generateDinitList().slice( 0 ).reverse(); // shallow clone and reverse dinit list
}
_generateDinitList() {
// we dinit in breadth-first search order
// seed breadth first search
const processList = [ 'app' ];
const outputList = [];
const shiftPath = ( index ) => {
let path = outputList[ index ];
outputList.splice( index, 1 ); // remove path from middle
outputList.push( path ); // put path on end
// put dependencies on the end now, and their dependencies, etc.
this._components[ path ].dependencies.forEach( ( dependency ) => {
let index = outputList.indexOf( dependency );
if ( index > -1 ) {
shiftPath( index );
}
} );
};
const processPath = ( path ) => {
let index = outputList.indexOf( path );
// if path is already in the output, it needs to bump to the end, shift it!
if ( index > -1 ) {
shiftPath( index );
} else {
// path doesn't exist, add it to the list and queue up its dependencies for processing
outputList.push( path );
this._components[ path ].dependencies.forEach( ( dependency ) => {
processList.push( dependency );
} );
}
};
while ( processList.length > 0 ) {
processPath( processList.shift() );
}
return outputList;
}
}

@@ -389,0 +455,0 @@

{
"name": "@stringstack/core",
"description": "StringStack Core",
"version": "0.2.0",
"version": "0.3.0",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/BlueRival/stringstack-core.git"
"url": "git+ssh://git@github.com/StringStack/stringstack-core.git"
},

@@ -13,7 +13,7 @@ "scripts": {

"dependencies": {
"async": "2.6.0",
"async": "2.6.1",
"nconf": "0.10.0"
},
"devDependencies": {
"mocha": "5.1.1",
"mocha": "5.2.0",
"ncp": "2.0.0"

@@ -32,5 +32,5 @@ },

"bugs": {
"url": "https://github.com/BlueRival/stringstack-core/issues"
"url": "https://github.com/StringStack/stringstack-core/issues"
},
"homepage": "https://github.com/BlueRival/stringstack-core#readme",
"homepage": "https://github.com/StringStack/stringstack-core#readme",
"main": "index.js",

@@ -37,0 +37,0 @@ "directories": {

+65
-16

@@ -302,6 +302,6 @@ # StringStack Core

StringStack/core a built in configuration space. It is implemented with nconf (https://www.npmjs.com/package/nconf).
StringStack/core has a built in configuration place. It is implemented with nconf (https://www.npmjs.com/package/nconf).
The current version of nconf being used is v0.10.0.
You can access the nconf instance with the dependency container.
You can access the nconf instance with the dependency container in the constructor of your component.

@@ -333,3 +333,9 @@ ```javascript

this._config = deps.get( 'config' );
// using inject vs get injects SetupConfig as a dependency of config. The nConf instance is still returned, but
// this means that SetupConfig will get initialized before config, and thus before anything that loads config
// using deps.get( 'config' ). For example, all StringStack/* components will load config with get(), this means
// that the SetupConfig.init() method will run before say StringStack/express. That allows you to pull down config
// asynchronously from some remote location, such as we do here inside the init() method. Config will be available
// before StringStack/express.init() method is called.
this._config = deps.inject( 'config' );

@@ -379,4 +385,12 @@ // This is where you would do the synchronous config loads. If your configs are local, loading synchronously in

StringStack/core provides a logging facility that you can use to tap into your favorite logging tool. Simply pass a
logger function to the config for createApp() and get all the log writes from all components. Do so like this.
logger function to the config for createApp() and get all the log writes from all components. You could wire up Winston
like this.
Note that the fields passed to the logging function are:
level: This is a string. Your custom components can pass anything your logger understands. All @StringStack/* community components will use log levels as prescribed by https://www.npmjs.com/package/winston#logging-levels
component: This is the string name of the component that triggered the log event. The dependency injector will provide this field for you. The logging function passed into your component will only accept level, message and meta.
message: This is a string containing a message describing the event.
meta: This is any value you want to associate with your message. @StringStack/* components may pass instances of Error as meta.
```javascript

@@ -398,3 +412,3 @@

let winstonLogger = function ( level, path, message, meta ) {
let winstonLogger = function ( level, component, message, meta ) {

@@ -407,3 +421,3 @@ // pass the event to your favorite logger, such as https://www.npmjs.com/package/winston OR, just console it.

winston.log( level, `[${process.pid}] ${path}: ${message}: ${typeof meta === 'string' ? meta : JSON.stringify( meta )}`);
winston.log( level, `[${process.pid}] ${component}: ${message}: ${typeof meta === 'string' ? meta : JSON.stringify( meta )}`);

@@ -490,3 +504,41 @@ }

## Logging from Custom Components
Accessing the logging function from within your custom component is accomplished like this.
```javascript
class CustomComponent {
constructor(deps) {
this._log = deps.get( 'logger' );
this._log( 'info', 'I got my logger!' ); // notice you don't have to supply the component name
}
// ...
someMethod( done ) {
somethingElse( ( err ) => {
if ( err ) {
this._log('err', 'Error doing something', err);
}
done( err || null );
})
}
}
module.exports = CustomComponent;
```
# Daemonix for Linux Signal Management

@@ -501,3 +553,3 @@

With Daemonix you can run your application like this.
With Daemonix you can run your entire StringStack application like this.

@@ -512,4 +564,5 @@ ```javascript

rootComponents: [
'./lib/some-component-a',
'./lib/some-component-b',
'./lib/setup.config',
'./lib/custom-component-a',
'./lib/custom-component-b',
]

@@ -528,9 +581,5 @@ } );

libraries, such as StringStack/express, will require config. Each of these components will specify where they will look
for config within the nconf component. The 3rd party component will also specify when the component expects config to be
available. For example, it may require config to be available at init time. This means you can provide config at load
or init time, since load time is before init.
for config within the nconf component.
Another component may require its config to be available at load time so that it may access config in its constructor or
load method. However, we have yet to encounter a situation where load time config requirements is the result of anything
other than bad programming. If the developer of your 3rd party component requires load time config and has not made a
solid case for why they can't wait until init time, you should consider choosing a different 3rd party component.
See the configuration section above for an example pattern on how to load config (even asychronously) into the config
instance before 3rd part components need the config.

@@ -0,1 +1,2 @@

/* eslint-disable no-undefined */
'use strict';

@@ -49,4 +50,4 @@

if ( app._loader._components.hasOwnProperty( targetPath ) ) {
return app._loader._components[ targetPath ].instance;
if ( app._loader._componentInstances.hasOwnProperty( targetPath ) ) {
return app._loader._componentInstances[ targetPath ];
}

@@ -80,3 +81,3 @@

rootComponents: [
'./test/lib/class.f'
'./test/lib/general/class.f'
]

@@ -87,3 +88,3 @@ } );

// reset event log
getComponentManually( app, './test/lib/class.f' )._resetEvents();
getComponentManually( app, './test/lib/general/class.f' )._resetEvents();

@@ -96,7 +97,3 @@ } );

let App = core.createApp( {
rootComponents: [
'./test/lib/class.a'
]
} );
let App = core.createApp();
let app = new App( 'test' );

@@ -135,7 +132,3 @@

let App = core.createApp( {
rootComponents: [
'./test/lib/class.a'
]
} );
let App = core.createApp();
let app = new App( 'test' );

@@ -187,7 +180,3 @@

let App = core.createApp( {
rootComponents: [
'./test/lib/class.a'
]
} );
let App = core.createApp();
let app = new App( 'test' );

@@ -251,3 +240,4 @@

rootComponents: [
'./test/lib/class.a'
'./test/lib/general/class.config.setup',
'./test/lib/general/class.a'
]

@@ -257,2 +247,4 @@ } );

// console.log( 'STACK', JSON.stringify( app._loader._components, null, 4 ) );
// init/dinit over and over. It is up to the actual modules to ensure they reset their internal state

@@ -288,74 +280,74 @@ // correctly on subsequent init/dinit cycles.

let actualEvents = getComponentManually( app, './test/lib/class.f' )._getEvents();
let actualEvents = getComponentManually( app, './test/lib/general/class.a' )._getEvents();
let expectedEvents = [
"TestA:instantiate",
"TestB:instantiate",
"TestDatabase:instantiate",
"TestConfig:instantiate",
"TestC:instantiate",
"TestD:instantiate",
"TestE:instantiate",
"StaticH:instantiate",
"TestF:instantiate",
"TestG:instantiate",
"TestConfig:init",
"TestDatabase:init",
"TestG:init",
"TestF:init",
"StaticH:init",
"TestE:init",
"TestD:init",
"TestC:init",
"TestB:init",
"TestA:init",
"TestA:dinit",
"TestB:dinit",
"TestC:dinit",
"TestD:dinit",
"TestE:dinit",
"StaticH:dinit",
"TestF:dinit",
"TestG:dinit",
"TestDatabase:dinit",
"TestConfig:dinit",
"TestConfig:init",
"TestDatabase:init",
"TestG:init",
"TestF:init",
"StaticH:init",
"TestE:init",
"TestD:init",
"TestC:init",
"TestB:init",
"TestA:init",
"TestA:dinit",
"TestB:dinit",
"TestC:dinit",
"TestD:dinit",
"TestE:dinit",
"StaticH:dinit",
"TestF:dinit",
"TestG:dinit",
"TestDatabase:dinit",
"TestConfig:dinit",
"TestConfig:init",
"TestDatabase:init",
"TestG:init",
"TestF:init",
"StaticH:init",
"TestE:init",
"TestD:init",
"TestC:init",
"TestB:init",
"TestA:init",
"TestA:dinit",
"TestB:dinit",
"TestC:dinit",
"TestD:dinit",
"TestE:dinit",
"StaticH:dinit",
"TestF:dinit",
"TestG:dinit",
"TestDatabase:dinit",
"TestConfig:dinit"
'TestConfigSetup:instantiate',
'TestA:instantiate',
'TestB:instantiate',
'TestDatabase:instantiate',
'TestC:instantiate',
'TestD:instantiate',
'TestE:instantiate',
'StaticH:instantiate',
'TestF:instantiate',
'TestG:instantiate',
'TestConfigSetup:init',
'TestDatabase:init',
'TestG:init',
'TestF:init',
'StaticH:init',
'TestE:init',
'TestD:init',
'TestC:init',
'TestB:init',
'TestA:init',
'TestA:dinit',
'TestB:dinit',
'TestC:dinit',
'TestD:dinit',
'TestE:dinit',
'StaticH:dinit',
'TestF:dinit',
'TestG:dinit',
'TestDatabase:dinit',
'TestConfigSetup:dinit',
'TestConfigSetup:init',
'TestDatabase:init',
'TestG:init',
'TestF:init',
'StaticH:init',
'TestE:init',
'TestD:init',
'TestC:init',
'TestB:init',
'TestA:init',
'TestA:dinit',
'TestB:dinit',
'TestC:dinit',
'TestD:dinit',
'TestE:dinit',
'StaticH:dinit',
'TestF:dinit',
'TestG:dinit',
'TestDatabase:dinit',
'TestConfigSetup:dinit',
'TestConfigSetup:init',
'TestDatabase:init',
'TestG:init',
'TestF:init',
'StaticH:init',
'TestE:init',
'TestD:init',
'TestC:init',
'TestB:init',
'TestA:init',
'TestA:dinit',
'TestB:dinit',
'TestC:dinit',
'TestD:dinit',
'TestE:dinit',
'StaticH:dinit',
'TestF:dinit',
'TestG:dinit',
'TestDatabase:dinit',
'TestConfigSetup:dinit'
];

@@ -386,3 +378,3 @@

rootComponents: [
'./test/lib/class.node-module'
'./test/lib/general/class.node-module'
]

@@ -433,40 +425,37 @@ } );

let actualEvents = getComponentManually( app, './test/lib/class.node-module' )._getEvents();
let actualEvents = getComponentManually( app, './test/lib/general/class.node-module' )._getEvents();
let expectedEvents = [
"TestNodeModule:instantiate",
"TestFakeModule:instantiate",
"TestA:instantiate",
"TestB:instantiate",
"TestDatabase:instantiate",
"TestConfig:instantiate",
"TestC:instantiate",
"TestD:instantiate",
"TestE:instantiate",
"StaticH:instantiate",
"TestF:instantiate",
"TestG:instantiate",
"TestConfig:init",
"TestDatabase:init",
"TestG:init",
"TestF:init",
"StaticH:init",
"TestE:init",
"TestD:init",
"TestC:init",
"TestB:init",
"TestA:init",
"TestFakeModule:init",
"TestNodeModule:init",
"TestNodeModule:dinit",
"TestFakeModule:dinit",
"TestA:dinit",
"TestB:dinit",
"TestC:dinit",
"TestD:dinit",
"TestE:dinit",
"StaticH:dinit",
"TestF:dinit",
"TestG:dinit",
"TestDatabase:dinit",
"TestConfig:dinit"
'TestNodeModule:instantiate',
'TestFakeModule:instantiate',
'TestA:instantiate',
'TestB:instantiate',
'TestDatabase:instantiate',
'TestC:instantiate',
'TestD:instantiate',
'TestE:instantiate',
'StaticH:instantiate',
'TestF:instantiate',
'TestG:instantiate',
'TestDatabase:init',
'TestG:init',
'TestF:init',
'StaticH:init',
'TestE:init',
'TestD:init',
'TestC:init',
'TestB:init',
'TestA:init',
'TestFakeModule:init',
'TestNodeModule:init',
'TestNodeModule:dinit',
'TestFakeModule:dinit',
'TestA:dinit',
'TestB:dinit',
'TestC:dinit',
'TestD:dinit',
'TestE:dinit',
'StaticH:dinit',
'TestF:dinit',
'TestG:dinit',
'TestDatabase:dinit'
];

@@ -497,4 +486,4 @@

rootComponents: [
'./test/lib/class.root-a',
'./test/lib/class.root-c'
'./test/lib/root/class.a',
'./test/lib/root/class.c'
]

@@ -519,17 +508,17 @@ } );

let actualEvents = getComponentManually( app, './test/lib/class.root-a' )._getEvents();
let actualEvents = getComponentManually( app, './test/lib/root/class.a' )._getEvents();
let expectedEvents = [
"TestRootA:instantiate",
"TestRootB:instantiate",
"TestRootC:instantiate",
"TestRootD:instantiate",
"TestRootD:init",
"TestRootC:init",
"TestRootB:init",
"TestRootA:init",
"TestRootA:dinit",
"TestRootB:dinit",
"TestRootC:dinit",
"TestRootD:dinit"
'TestRootA:instantiate',
'TestRootB:instantiate',
'TestRootC:instantiate',
'TestRootD:instantiate',
'TestRootD:init',
'TestRootB:init',
'TestRootC:init',
'TestRootA:init',
'TestRootA:dinit',
'TestRootC:dinit',
'TestRootB:dinit',
'TestRootD:dinit'
];

@@ -559,3 +548,3 @@

rootComponents: [
'./test/lib/class.a'
'./test/lib/general/class.a'
]

@@ -597,3 +586,3 @@ } );

rootComponents: [
'./test/lib/class.err.get_init'
'./test/lib/err/class.get_init'
]

@@ -615,3 +604,3 @@ } );

assert.equal( err.message,
'you must access your dependencies in your constructor only',
'you must access your dependencies in your constructor or load() method only',
'error message does not match' );

@@ -635,3 +624,3 @@

rootComponents: [
'./test/lib/class.err.get_dinit'
'./test/lib/err/class.get_dinit'
]

@@ -661,3 +650,3 @@ } );

assert.equal( err.message,
'you must access your dependencies in your constructor only',
'you must access your dependencies in your constructor or load() method only',
'error message does not match' );

@@ -675,3 +664,3 @@

it( 'should return throw an error if attempting to get a dependency in any general method', function ( done ) {
it( 'should throw an error if attempting to get a dependency in any general method', function ( done ) {

@@ -682,3 +671,3 @@ let core = new Core();

rootComponents: [
'./test/lib/class.err.get_method'
'./test/lib/err/class.get_method'
]

@@ -700,3 +689,3 @@ } );

try {
getComponentManually( app, './test/lib/class.err.get_method' ).method( done );
getComponentManually( app, './test/lib/err/class.get_method' ).method( done );
} catch ( e ) {

@@ -720,3 +709,3 @@ return done( e );

assert.equal( err.message,
'you must access your dependencies in your constructor only',
'you must access your dependencies in your constructor or load() method only',
'error message does not match' );

@@ -740,3 +729,3 @@

rootComponents: [
'./test/lib/class.err.load-self'
'./test/lib/err/class.load-self'
]

@@ -747,3 +736,6 @@ } );

try {
let app = new App( 'test' );
// eslint-disable-next-line no-new
new App( 'test' );
} catch ( e ) {

@@ -759,2 +751,28 @@ exception = e;

it( 'should throw an error if a dependency cycle is created', function () {
let core = new Core();
let App = core.createApp( {
rootComponents: [
'./test/lib/cycle.err/class.a'
]
} );
let exception = null;
try {
// eslint-disable-next-line no-new
new App( 'test' );
} catch ( e ) {
exception = e;
}
assert.ok( exception, 'failed to throw exception' );
assert.equal( exception.message, 'dependency cycle created' );
} );
it( 'should allow shared dependency chains without cycles (dependency paths need not be a tree)',

@@ -767,3 +785,3 @@ function ( done ) {

rootComponents: [
'./test/lib/class.cycle-a'
'./test/lib/non-cycle/class.a'
]

@@ -787,31 +805,31 @@ } );

let actualEvents = getComponentManually( app, './test/lib/class.cycle-a' )._getEvents();
let actualEvents = getComponentManually( app, './test/lib/non-cycle/class.a' )._getEvents();
let expectedEvents = [
"TestCycleA:instantiate",
"TestCycleB:instantiate",
"TestCycleC:instantiate",
"TestCycleD:instantiate",
"TestCycleE:instantiate",
"TestCycleF:instantiate",
"TestCycleI:instantiate",
"TestCycleG:instantiate",
"TestCycleH:instantiate",
"TestCycleI:init",
"TestCycleF:init",
"TestCycleE:init",
"TestCycleD:init",
"TestCycleC:init",
"TestCycleH:init",
"TestCycleG:init",
"TestCycleB:init",
"TestCycleA:init",
"TestCycleA:dinit",
"TestCycleB:dinit",
"TestCycleG:dinit",
"TestCycleH:dinit",
"TestCycleC:dinit",
"TestCycleD:dinit",
"TestCycleE:dinit",
"TestCycleF:dinit",
"TestCycleI:dinit"
'TestNonCycleA:instantiate',
'TestNonCycleB:instantiate',
'TestNonCycleC:instantiate',
'TestNonCycleD:instantiate',
'TestNonCycleE:instantiate',
'TestNonCycleF:instantiate',
'TestNonCycleI:instantiate',
'TestNonCycleG:instantiate',
'TestNonCycleH:instantiate',
'TestNonCycleI:init',
'TestNonCycleF:init',
'TestNonCycleE:init',
'TestNonCycleD:init',
'TestNonCycleC:init',
'TestNonCycleH:init',
'TestNonCycleG:init',
'TestNonCycleB:init',
'TestNonCycleA:init',
'TestNonCycleA:dinit',
'TestNonCycleB:dinit',
'TestNonCycleG:dinit',
'TestNonCycleH:dinit',
'TestNonCycleC:dinit',
'TestNonCycleD:dinit',
'TestNonCycleE:dinit',
'TestNonCycleF:dinit',
'TestNonCycleI:dinit'
];

@@ -844,3 +862,3 @@

rootComponents: [
'./test/lib/class.log.a'
'./test/lib/log/class.a'
],

@@ -872,163 +890,175 @@ log: ( level, path, message, meta ) => {

[
"info",
"loader",
"instantiating class component: " + dir + "/test/lib/class.log.a",
'info',
'loader',
'instantiating class component: ' + dir + '/test/lib/log/class.a',
undefined
],
[
"info",
dir + "/test/lib/class.log.a",
"TestLogA constructor",
'info',
dir + '/test/lib/log/class.a',
'TestLogA constructor',
{
"meta": "data"
'meta': 'data'
}
],
[
"info",
"loader",
"instantiating class component: " + dir + "/test/lib/class.log.b",
'info',
'loader',
'instantiating class component: ' + dir + '/test/lib/log/class.b',
undefined
],
[
"info",
dir + "/test/lib/class.log.b",
"TestLogB constructor",
'info',
dir + '/test/lib/log/class.b',
'TestLogB constructor',
{
"meta": "data"
'meta': 'data'
}
],
[
"verbose",
dir + "/test/lib/class.log.b",
"TestLogB constructor",
'verbose',
dir + '/test/lib/log/class.b',
'TestLogB constructor',
{
"meta": "data"
'meta': 'data'
}
],
[
"notice",
"app",
"instantiated",
'notice',
'app',
'instantiated',
undefined
],
[
"notice",
"loader",
"begin initializing components",
'notice',
'loader',
'begin initializing components',
undefined
],
[
"debug",
dir + "/test/lib/class.log.b",
"TestLogB init",
'debug',
dir + '/test/lib/log/class.b',
'TestLogB init',
{
"meta": "data"
'meta': 'data'
}
],
[
"info",
"loader",
"initialized component " + dir + "/test/lib/class.log.b",
'info',
'loader',
'initialized component ' + dir + '/test/lib/log/class.b',
undefined
],
[
"debug",
dir + "/test/lib/class.log.a",
"TestLogA init",
'debug',
dir + '/test/lib/log/class.a',
'TestLogA init',
{
"meta": "data"
'meta': 'data'
}
],
[
"warning",
dir + "/test/lib/class.log.a",
"TestLogA init warn",
'warning',
dir + '/test/lib/log/class.a',
'TestLogA init warn',
undefined
],
[
"warning",
dir + "/test/lib/class.log.a",
"TestLogA init warning",
'warning',
dir + '/test/lib/log/class.a',
'TestLogA init warning',
undefined
],
[
"info",
"loader",
"initialized component " + dir + "/test/lib/class.log.a",
'info',
'loader',
'initialized component ' + dir + '/test/lib/log/class.a',
undefined
],
[
"info",
"loader",
"initialized component config",
'info',
'loader',
'initialized component config',
undefined
],
[
"info",
"loader",
"initialized component env",
'info',
'loader',
'initialized component env',
undefined
],
[
"notice",
"loader",
"finished initializing components",
'info',
'loader',
'initialized component app',
undefined
],
[
"notice",
"loader",
"begin d-initializing components",
'notice',
'loader',
'finished initializing components',
undefined
],
[
"info",
"loader",
"d-initialized component env",
'notice',
'loader',
'begin d-initializing components',
undefined
],
[
"info",
"loader",
"d-initialized component config",
'info',
'loader',
'd-initialized component app',
undefined
],
[
"debug",
dir + "/test/lib/class.log.a",
"TestLogA dinit",
'info',
'loader',
'd-initialized component env',
undefined
],
[
'info',
'loader',
'd-initialized component config',
undefined
],
[
'debug',
dir + '/test/lib/log/class.a',
'TestLogA dinit',
{
"meta": "data"
'meta': 'data'
}
],
[
"info",
"loader",
"d-initialized component " + dir + "/test/lib/class.log.a",
'info',
'loader',
'd-initialized component ' + dir + '/test/lib/log/class.a',
undefined
],
[
"debug",
dir + "/test/lib/class.log.b",
"TestLogB dinit",
'debug',
dir + '/test/lib/log/class.b',
'TestLogB dinit',
{
"meta": "data"
'meta': 'data'
}
],
[
"info",
dir + "/test/lib/class.log.b",
"TestLogB information",
'info',
dir + '/test/lib/log/class.b',
'TestLogB information',
undefined
],
[
"info",
"loader",
"d-initialized component " + dir + "/test/lib/class.log.b",
'info',
'loader',
'd-initialized component ' + dir + '/test/lib/log/class.b',
undefined
],
[
"notice",
"loader",
"finished d-initializing components",
'notice',
'loader',
'finished d-initializing components',
undefined

@@ -1051,2 +1081,2 @@ ]

} );
} );

@@ -11,3 +11,3 @@ 'use strict';

this._a = deps.get( './test/lib/class.a' );
this._a = deps.get( './test/lib/general/class.a' );

@@ -18,2 +18,2 @@ }

module.exports = TestFakeModule;
module.exports = TestFakeModule;

Sorry, the diff of this file is not supported yet

{
"name": "@stringstack/core",
"version": "0.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true
},
"async": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz",
"integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==",
"requires": {
"lodash": "^4.14.0"
}
},
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"browser-stdout": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
"integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
"dev": true
},
"camelcase": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz",
"integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=",
"dev": true
},
"cliui": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
"integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=",
"dev": true,
"requires": {
"string-width": "^1.0.1",
"strip-ansi": "^3.0.1",
"wrap-ansi": "^2.0.0"
}
},
"code-point-at": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"dev": true
},
"commander": {
"version": "2.11.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz",
"integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==",
"dev": true
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"dev": true,
"requires": {
"ms": "2.0.0"
}
},
"decamelize": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
"dev": true
},
"diff": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
"dev": true
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true
},
"glob": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
},
"growl": {
"version": "1.10.3",
"resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz",
"integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==",
"dev": true
},
"has-flag": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
"integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
"dev": true
},
"he": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz",
"integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=",
"dev": true
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true,
"requires": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"dev": true
},
"ini": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
"dev": true
},
"invert-kv": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
"integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=",
"dev": true
},
"is-fullwidth-code-point": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"dev": true,
"requires": {
"number-is-nan": "^1.0.0"
}
},
"lcid": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
"integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
"dev": true,
"requires": {
"invert-kv": "^1.0.0"
}
},
"lodash": {
"version": "4.17.10",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg=="
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true
},
"mkdirp": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true,
"requires": {
"minimist": "0.0.8"
}
},
"mocha": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-5.1.1.tgz",
"integrity": "sha512-kKKs/H1KrMMQIEsWNxGmb4/BGsmj0dkeyotEvbrAuQ01FcWRLssUNXCEUZk6SZtyJBi6EE7SL0zDDtItw1rGhw==",
"dev": true,
"requires": {
"browser-stdout": "1.3.1",
"commander": "2.11.0",
"debug": "3.1.0",
"diff": "3.5.0",
"escape-string-regexp": "1.0.5",
"glob": "7.1.2",
"growl": "1.10.3",
"he": "1.1.1",
"minimatch": "3.0.4",
"mkdirp": "0.5.1",
"supports-color": "4.4.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
"dev": true
},
"nconf": {
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/nconf/-/nconf-0.10.0.tgz",
"integrity": "sha512-fKiXMQrpP7CYWJQzKkPPx9hPgmq+YLDyxcG9N8RpiE9FoCkCbzD0NyW0YhE3xn3Aupe7nnDeIx4PFzYehpHT9Q==",
"dev": true,
"requires": {
"async": "^1.4.0",
"ini": "^1.3.0",
"secure-keys": "^1.0.0",
"yargs": "^3.19.0"
},
"dependencies": {
"async": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
"integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=",
"dev": true
}
}
},
"ncp": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz",
"integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=",
"dev": true
},
"number-is-nan": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
"dev": true
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true,
"requires": {
"wrappy": "1"
}
},
"os-locale": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
"integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
"dev": true,
"requires": {
"lcid": "^1.0.0"
}
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true
},
"secure-keys": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/secure-keys/-/secure-keys-1.0.0.tgz",
"integrity": "sha1-8MgtmKOxOah3aogIBQuCRDEIf8o=",
"dev": true
},
"string-width": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"dev": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
"strip-ansi": "^3.0.0"
}
},
"strip-ansi": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true,
"requires": {
"ansi-regex": "^2.0.0"
}
},
"supports-color": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
"integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
"dev": true,
"requires": {
"has-flag": "^2.0.0"
}
},
"window-size": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz",
"integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=",
"dev": true
},
"wrap-ansi": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
"integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
"dev": true,
"requires": {
"string-width": "^1.0.1",
"strip-ansi": "^3.0.1"
}
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true
},
"y18n": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
"integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=",
"dev": true
},
"yargs": {
"version": "3.32.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz",
"integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=",
"dev": true,
"requires": {
"camelcase": "^2.0.1",
"cliui": "^3.0.3",
"decamelize": "^1.1.1",
"os-locale": "^1.4.0",
"string-width": "^1.0.1",
"window-size": "^0.1.4",
"y18n": "^3.2.0"
}
}
}
}
'use strict';
const TestBase = require( './class.base' );
class TestA extends TestBase {
constructor( deps ) {
super( deps, 'TestA' );
this._b = deps.get( './test/lib/class.b' );
}
}
module.exports = TestA;
'use strict';
const TestBase = require( './class.base' );
class TestB extends TestBase {
constructor( deps ) {
super( deps, 'TestB' );
this._database = deps.get( './test/lib/class.database' );
this._c = deps.get( './test/lib/class.c' );
}
}
module.exports = TestB;
'use strict';
const TestBase = require( './class.base' );
class TestC extends TestBase {
constructor( deps ) {
super( deps, 'TestC' );
this._config = deps.get( './test/lib/class.config' );
this._d = deps.get( './test/lib/class.d' );
this._e = deps.get( './test/lib/class.e' );
}
}
module.exports = TestC;
'use strict';
const TestBase = require( './class.base' );
class TestConfig extends TestBase {
constructor( deps ) {
super( deps, 'TestConfig' );
}
}
module.exports = TestConfig;
'use strict';
const TestBase = require( './class.base' );
class TestCycleA extends TestBase {
constructor( deps ) {
super( deps, 'TestCycleA' );
this._b = deps.get( './test/lib/class.cycle-b' );
}
}
module.exports = TestCycleA;
'use strict';
const TestBase = require( './class.base' );
class TestCycleB extends TestBase {
constructor( deps ) {
super( deps, 'TestCycleB' );
this._c = deps.get( './test/lib/class.cycle-c' );
this._g = deps.get( './test/lib/class.cycle-g' );
}
}
module.exports = TestCycleB;
'use strict';
const TestBase = require( './class.base' );
class TestCycleC extends TestBase {
constructor( deps ) {
super( deps, 'TestCycleC' );
this._d = deps.get( './test/lib/class.cycle-d' );
this._e = deps.get( './test/lib/class.cycle-e' );
}
}
module.exports = TestCycleC;
'use strict';
const TestBase = require( './class.base' );
class TestCycleD extends TestBase {
constructor( deps ) {
super( deps, 'TestCycleD' );
this._e = deps.get( './test/lib/class.cycle-e' );
}
}
module.exports = TestCycleD;
'use strict';
const TestBase = require( './class.base' );
class TestCycleE extends TestBase {
constructor( deps ) {
super( deps, 'TestCycleE' );
this._f = deps.get( './test/lib/class.cycle-f' );
this._i = deps.get( './test/lib/class.cycle-i' );
}
}
module.exports = TestCycleE;
'use strict';
const TestBase = require( './class.base' );
class TestCycleF extends TestBase {
constructor( deps ) {
super( deps, 'TestCycleF' );
}
}
module.exports = TestCycleF;
'use strict';
const TestBase = require( './class.base' );
class TestCycleG extends TestBase {
constructor( deps ) {
super( deps, 'TestCycleG' );
this._h = deps.get( './test/lib/class.cycle-h' );
}
}
module.exports = TestCycleG;
'use strict';
const TestBase = require( './class.base' );
class TestCycleH extends TestBase {
constructor( deps ) {
super( deps, 'TestCycleH' );
this._i = deps.get( './test/lib/class.cycle-i' );
this._c = deps.get( './test/lib/class.cycle-c' );
}
}
module.exports = TestCycleH;
'use strict';
const TestBase = require( './class.base' );
class TestCycleI extends TestBase {
constructor( deps ) {
super( deps, 'TestCycleI' );
}
}
module.exports = TestCycleI;
'use strict';
const TestBase = require( './class.base' );
class TestD extends TestBase {
constructor( deps ) {
super( deps, 'TestD' );
}
}
module.exports = TestD;
'use strict';
const TestBase = require( './class.base' );
class TestDatabase extends TestBase {
constructor( deps ) {
super( deps, 'TestDatabase' );
this._config = deps.get( './test/lib/class.config' );
}
}
module.exports = TestDatabase;
'use strict';
const TestBase = require( './class.base' );
class TestE extends TestBase {
constructor( deps ) {
super( deps, 'TestE' );
this._config = deps.get( './test/lib/class.config' );
this._database = deps.get( './test/lib/class.database' );
this._h = deps.get( './test/lib/static.h' );
this._f = deps.get( './test/lib/class.f' );
}
}
module.exports = TestE;
'use strict';
const TestBase = require( './class.base' );
class ErrGetDinit extends TestBase {
constructor( deps ) {
super( deps, 'ErrGetDinit' );
}
dinit( done ) {
this._f = this._deps.get( './test/lib/class.f' );
super.dinit( done );
}
}
module.exports = ErrGetDinit;
'use strict';
const TestBase = require( './class.base' );
class ErrGetInit extends TestBase {
constructor( deps ) {
super( deps, 'ErrGetInit' );
}
init( done ) {
this._f = this._deps.get( './test/lib/class.f' );
super.init( done );
}
}
module.exports = ErrGetInit;
'use strict';
const TestBase = require( './class.base' );
class ErrGetMethod extends TestBase {
constructor( deps ) {
super( deps, 'ErrGetMethod' );
}
method( done ) {
this._c = this._deps.get( './test/lib/class.c' );
done();
}
}
module.exports = ErrGetMethod;
'use strict';
const TestBase = require( './class.base' );
class TestLoadApp extends TestBase {
constructor( deps ) {
super( deps, 'TestLoadApp' );
this._err_load_self = deps.get( 'app' );
}
}
module.exports = TestLoadApp;
'use strict';
const TestBase = require( './class.base' );
class TestLoadSelf extends TestBase {
constructor( deps ) {
super( deps, 'TestLoadSelf' );
this._err_load_self = deps.get( './test/lib/class.err.load-self' );
}
}
module.exports = TestLoadSelf;
'use strict';
const TestBase = require( './class.base' );
class TestF extends TestBase {
constructor( deps ) {
super( deps, 'TestF' );
this._database = deps.get( './test/lib/class.database' );
this._g = deps.get( './test/lib/class.g' );
this._json = deps.get( './test/lib/data.json' );
}
}
module.exports = TestF;
'use strict';
const TestBase = require( './class.base' );
class TestG extends TestBase {
constructor( deps ) {
super( deps, 'TestG' );
this._database = deps.get( './test/lib/class.database' );
}
}
module.exports = TestG;
'use strict';
const TestBase = require( './class.base' );
class TestLogA extends TestBase {
constructor( deps ) {
super( deps, 'TestLogA' );
this._logger = deps.get( 'logger' );
this._logger( 'info', 'TestLogA constructor', { meta: 'data' } );
this._logb = deps.get( './test/lib/class.log.b' );
}
init( done ) {
this._logger( 'debug', 'TestLogA init', { meta: 'data' } );
this._logger( 'warn', 'TestLogA init warn' );
this._logger( 'warning', 'TestLogA init warning' );
super.init( done );
}
dinit( done ) {
this._logger( 'debug', 'TestLogA dinit', { meta: 'data' } );
super.dinit( done );
}
}
module.exports = TestLogA;
'use strict';
const TestBase = require( './class.base' );
class TestLogB extends TestBase {
constructor( deps ) {
super( deps, 'TestLogB' );
this._logger = deps.get( 'logger' );
this._logger( 'info', 'TestLogB constructor', { meta: 'data' } );
this._logger( 'verbose', 'TestLogB constructor', { meta: 'data' } );
}
init( done ) {
this._logger( 'debug', 'TestLogB init', { meta: 'data' } );
super.init( done );
}
dinit( done ) {
this._logger( 'debug', 'TestLogB dinit', { meta: 'data' } );
this._logger( 'information', 'TestLogB information' );
super.dinit( done );
}
}
module.exports = TestLogB;
'use strict';
const TestBase = require( './class.base' );
class TestNodeModule extends TestBase {
constructor( deps ) {
super( deps, 'TestNodeModule' );
// pulls from node_modules, not test/lib/fake-module.js
this._fakeModule = deps.get( 'fake-module' );
}
}
module.exports = TestNodeModule;
'use strict';
const TestBase = require( './class.base' );
class TestRootA extends TestBase {
constructor( deps ) {
super( deps, 'TestRootA' );
this._root_b = deps.get( './test/lib/class.root-b' );
}
}
module.exports = TestRootA;
'use strict';
const TestBase = require( './class.base' );
class TestRootB extends TestBase {
constructor( deps ) {
super( deps, 'TestRootB' );
}
}
module.exports = TestRootB;
'use strict';
const TestBase = require( './class.base' );
class TestRootC extends TestBase {
constructor( deps ) {
super( deps, 'TestRootC' );
this._root_d = deps.get( './test/lib/class.root-d' );
}
}
module.exports = TestRootC;
'use strict';
const TestBase = require( './class.base' );
class TestRootD extends TestBase {
constructor( deps ) {
super( deps, 'TestRootD' );
}
}
module.exports = TestRootD;
'use strict';
const TestBase = require( './class.base' );
let testBase = null;
// static modules get load, init, dinit called, which are parallels to new, init, dinit on class modules.
let StaticH = {
load: ( deps ) => {
testBase = new TestBase( deps, 'StaticH' );
},
init: ( done ) => {
testBase.init( done );
},
dinit: ( done ) => {
testBase.dinit( done );
}
};
module.exports = StaticH;