{"version":3,"sources":["webpack:///webpack/bootstrap f2f9ce06a011c2c01759","webpack:///./src/browser.js","webpack:///./src/index.js","webpack:///./src/collection.js","webpack:///./src ^\\.\\/.*$","webpack:///./src/utils.js"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,wC;;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,sD;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA,WAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA,2CAA0C,aAAa;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA,6CAA4C,aAAa;AACzD;AACA;AACA;AACA;AACA,aAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY,MAAM;AAClB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY,uBAAuB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB;AACA,aAAY,MAAM;AAClB;AACA,aAAY,UAAU;AACtB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,8DAA6D;AAC7D,oCAAmC;AACnC;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,sBAAsB;AACjC,YAAW,SAAS;AACpB;AACA,aAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,sBAAsB;AACjC,YAAW,SAAS;AACpB;AACA,aAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,sBAAsB;AACjC,YAAW,SAAS;AACpB;AACA,aAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,sBAAsB;AACjC,YAAW,SAAS;AACpB;AACA,aAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA,YAAW,SAAS;AACpB;AACA;AACA,aAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA,YAAW,gBAAgB;AAC3B,YAAW,SAAS;AACpB;AACA,aAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY,MAAM;AAClB,aAAY,SAAS;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,gBAAgB;AAC3B;AACA;AACA;AACA,YAAW,gBAAgB;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA;AACA,aAAY,MAAM;AAClB;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB;AACA,aAAY,KAAK;AACjB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;ACrjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY,UAAU;AACtB;AACA;;AAEA;AACA;AACA;AACA,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY,KAAK;AACjB,aAAY,UAAU;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY,WAAW;AACvB,aAAY,UAAU;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,MAAM;AACjB,aAAY,WAAW;AACvB,aAAY,UAAU;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA,YAAW,OAAO;AAClB;AACA,aAAY,WAAW;AACvB,aAAY,UAAU;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA,YAAW,OAAO;AAClB;AACA;AACA;AACA,aAAY,WAAW;AACvB,aAAY,UAAU;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA,YAAW,MAAM;AACjB;AACA,YAAW,KAAK;AAChB;AACA;AACA;AACA,aAAY,WAAW;AACvB;AACA,aAAY,UAAU;AACtB;AACA,aAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA,YAAW,KAAK;AAChB;AACA;AACA;AACA,aAAY,WAAW;AACvB;AACA,aAAY,UAAU;AACtB,aAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAY,OAAO;AACnB,YAAW,UAAU;AACrB;AACA,aAAY,WAAW;AACvB,aAAY,UAAU;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAY,OAAO;AACnB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA,YAAW,MAAM;AACjB;AACA;AACA;AACA,YAAW,KAAK;AAChB;AACA;AACA;AACA,aAAY,MAAM;AAClB,aAAY,MAAM;AAClB;AACA;AACA;AACA;AACA,aAAY,UAAU;AACtB,aAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA,OAAM;AACN;AACA,YAAW,OAAO;AAClB;AACA,YAAW,MAAM;AACjB;AACA;AACA;AACA,YAAW,KAAK;AAChB;AACA;AACA;AACA,aAAY,MAAM;AAClB;AACA,aAAY,MAAM;AAClB;AACA;AACA;AACA;AACA,aAAY,UAAU;AACtB;AACA,aAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA,YAAW,sBAAsB;AACjC;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB;AACA;AACA;AACA,aAAY,MAAM;AAClB;AACA,aAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA,YAAW,sBAAsB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB;AACA;AACA;AACA,aAAY,MAAM;AAClB;AACA,aAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY,gBAAgB;AAC5B;AACA;AACA,YAAW,SAAS;AACpB;AACA;AACA,aAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,aAAY,MAAM;AAClB,aAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA,YAAW,SAAS;AACpB;AACA;AACA,aAAY,WAAW;AACvB;AACA,aAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA,YAAW,OAAO;AAClB,YAAW,sBAAsB;AACjC,YAAW,SAAS;AACpB;AACA,aAAY,WAAW;AACvB;AACA,aAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA,YAAW,OAAO;AAClB,YAAW,sBAAsB;AACjC,YAAW,SAAS;AACpB;AACA,aAAY,WAAW;AACvB;AACA,aAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;AAGA,6B;;;;;;;;;AC3xBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAiC,uDAAuD;AACxF;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAa;AACb,cAAa;AACb;AACA;AACA,YAAW;AACX;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,aAAY,OAAO;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,YAAW,aAAa;AACxB,YAAW,gBAAgB;AAC3B,aAAY,OAAO;AACnB;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,kBAAiB,YAAY;AAC7B;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap f2f9ce06a011c2c01759\n **/","/**\n * This file is part of Noder.io.\n *\n * (c) Nicolas Tallefourtane \n *\n * For the full copyright and license information, please view\n * the LICENSE file that was distributed with this source code\n * or visit http://noder.io.\n *\n * @author Nicolas Tallefourtane \n */\n\n'use strict';\n\n/*----------------------------------------------------------------------------*\\\n Polyfill\n\\*----------------------------------------------------------------------------*/\n\nif(!Array.isArray) {\n\n var toString = Object.prototype.toString();\n\n Array.isArray = function isArray(array) {\n\n if (toString.call(array) === '[object Array]') {\n return true;\n } else if ( typeof array.slice === 'function' &&\n typeof array.length === 'number') {\n return true;\n }\n\n return false;\n };\n}\n\n// expose\nwindow.noder = require('./index');\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/browser.js\n ** module id = 0\n ** module chunks = 0\n **/","/**\n * This file is part of Noder.io.\n *\n * (c) Nicolas Tallefourtane \n *\n * For the full copyright and license information, please view\n * the LICENSE file that was distributed with this source code\n * or visit http://noder.io.\n *\n * @author Nicolas Tallefourtane \n */\n\n'use strict';\n\nvar Collection = require('./collection');\n\n// modules loaded\nvar loaded = {};\n\n/**\n * `Noder` constructor.\n *\n * The `Noder` instance is created when the first usage of `require('noder.io')`,\n * then the same object (reference) is returned by `require('noder.io')` in the next usages.\n *\n * @example\n * // file: a.js\n * var noder = require('noder.io');\n *\n * // true\n * console.log(typeof noder === 'object');\n *\n * // true\n * console.log(noder instanceof noder.Noder);\n *\n * noder.$di.set('hello', '-> Hello from a.js file.');\n *\n * // file: b.js\n * var noder = require('noder.io');\n *\n * // -> Hello from a.js file.\n * console.log(noder.$di.get('hello'));\n *\n * @constructor\n *\n * @see Noder.Noder\n */\nfunction Noder() {\n\n this.$di = new Noder.prototype.$di();\n\n this.$di.addAll({\n '$api' : this,\n '$di' : this.$di,\n '$container' : this.$di._container,\n '$invoke' : this.$wrap(this.$invoke),\n '$inject' : this.$wrap(this.$inject),\n '$provider' : this.$wrap(this.$provider),\n '$factory' : this.$wrap(this.$factory),\n '$singleton' : this.$wrap(this.$singleton),\n '$apply' : this.$wrap(this.$apply),\n '$wrap' : this.$wrap(this.$wrap)\n });\n}\n\n/**\n * `Noder` constructor.\n * For creating a new instance of `Noder`.\n *\n * @example\n * var api = new noder.Noder();\n *\n * @constructor\n * @type {function}\n */\nNoder.prototype.Noder = Noder;\n\n/**\n * IOC container.\n *\n * See [Collection API doc](collection.html).\n *\n * @example\n * noser.$di.set('name', Nico);\n *\n * var hello = noder.$di.apply(function() {\n * return 'Hello ' + this.name;\n * });\n *\n * @type {Collection}\n *\n * @see Noder.$invoke()\n * @see Noder.$inject()\n * @see Noder.$provider()\n * @see Noder.$factory()\n * @see Noder.$singleton()\n * @see Noder.$apply()\n * @see Noder.$wrap()\n */\nNoder.prototype.$di = Collection;\n\n/**\n * `Collection` constructor.\n * For creating a new instance of `Collection`.\n *\n * @example\n * var collection = new noder.Collection();\n *\n * collection.set('keyName', 'any value');\n *\n * // any value\n * console.log(collection.get('keyName'));\n *\n *\n * @constructor\n *\n * @param {object} [values] (Optional) values to add in the collection.\n * ```js\n * var collection = new noder.Collection({'foo': 'bar'});\n *\n * // display \"bar\"\n * console.log(collection.get('foo'));\n * ```\n *\n * @see Noder.createCollection()\n * @see Noder.Noder\n */\nNoder.prototype.Collection = Collection;\n\n/**\n * Create a collection container.\n *\n * @example\n * var collection = noder.createCollection();\n *\n * // true\n * console.log(collection instanceof noder.Collection);\n *\n * collection.set('keyName', 'any value');\n *\n * // any value\n * console.log(collection.get('keyName'));\n *\n * @param {object} [values] Optional values to add in the new collection.\n * ```js\n * var collection = noder.createCollection({'foo': 'bar'});\n *\n * // display \"bar\"\n * console.log(collection.get('foo'));\n * ```\n * @return {Collection} The new `Collection` instance\n *\n * @see Noder.Collection\n * @see Noder.createNoder()\n */\nNoder.prototype.createCollection = function createCollection(values) {\n\n if(values) {\n return new this.Collection(values);\n }\n\n return new this.Collection();\n};\n\n/**\n * Create a new `Noder` instance.\n *\n * @example\n * var api = noder.createNoder();\n *\n * // true\n * console.log(api instanceof noder.Noder);\n *\n * @return {Noder} The new `Noder` instance\n */\nNoder.prototype.createNoder = function createNoder() {\n\n return new this.Noder();\n};\n\n/**\n * Use a noder plugin.\n * A plugin is initialized by the method `__noder()`.\n *\n * See also [plugins](/guide/plugins.html) in the guide.\n *\n * @example\n * // example-plugin.js *\n * module.exports.__noder = examplePlugin(noder, arg1, arg2) {\n *\n * noder.$di.set('foo', arg1 + ' and ' + arg2);\n *\n * return noder;\n * };\n *\n * // app.js\n * var noder = require('noder.io').createNoder();\n * var examplePlugin = require('./example-plugin');\n *\n * noder.use(examplePlugin, 'any value 1', 'any value 2');\n *\n * // displays: 'any value 1 and any value 2'\n * console.log(noder.$di.get('foo'));\n *\n * @param {string|object|function} noderPlugin A noder plugin.\n * If `noderPlugin` is:\n *\n * * `string`: the plugin is loaded with `require`\n * and called by passing the current instance of `noder` like\n *\n * ```js\n * require(noderPlugin).__noder(noder [, optional argument, ...]);\n * ```\n * * `object` or `function`: the method `__noder()` is called by passing\n * the current instance of `noder` like\n *\n * ```js\n * noderPlugin.__noder(noder [, optional argument, ...]);\n * ```\n *\n * @param {...mixed} [arguments] Zero, one or several arguments passed to plugin.\n *\n * @return {Noder} The current `Noder` instance.\n *\n * @throws {TypeError} If the plugin has not the method [__noder()](/guide/plugins.html).\n */\nNoder.prototype.use = function use(noderPlugin) {\n\n var initPlugin = function(plugin, args) {\n\n if(typeof plugin.__noder != 'function') {\n throw new TypeError(\n 'Argument #1 passed to Noder.use() is not a valid plugin for Noder.io.' +\n 'A plugin must implement a method named `__noder()` that is used for ' +\n 'initialization. Example: ' +\n '`module.exports.__noder = function MyPlugin(noder) {\\n ' +\n '// here, the bootstrap\\n};`' +\n '\\n\\nAPI doc: http://noder.io/api/noder.html#use'\n );\n }\n\n plugin = plugin.__noder;\n\n args.length > 1 ?\n plugin.apply(null,\n Array.prototype.concat.apply(\n [this], Array.prototype.slice.call(args, 1)\n )\n )\n : plugin(this);\n\n }.bind(this);\n\n if(typeof noderPlugin == 'string') {\n\n initPlugin(require(noderPlugin), arguments);\n\n }else{\n\n initPlugin(noderPlugin, arguments);\n }\n\n return this;\n};\n\n/**\n * Shortcut of `noder.$di.invoke()`.\n *\n * Call a function with dependencies injection.\n *\n * Unlike `noder.$invoke()`,\n * the returned value of each dependency is passed to `fn`.\n *\n * @param {string|array|function} deps See [Collection.invoke()](collection.html#invoke).\n * @param {function} [fn] See [Collection.invoke()](collection.html#invoke).\n *\n * @return {mixed} The result of `fn`.\n *\n * @see Collection.invoke()\n * @see Noder.$inject()\n */\nNoder.prototype.$invoke = function $invoke(deps, fn) {\n\n return this.$di.invoke(deps, fn);\n};\n\n/**\n * Shortcut of `noder.$di.inject()`.\n *\n * Call a function with dependencies injection.\n *\n * Unlike `noder.$invoke()`,\n * the raw value of each dependency is passed to `fn`.\n *\n * @param {string|array|function} deps See [Collection.inject()](collection.html#inject).\n * @param {function} [fn] See [Collection.inject()](collection.html#inject).\n *\n * @return {mixed} The result of `fn`.\n *\n * @see Collection.inject()\n * @see Noder.$invoke()\n */\nNoder.prototype.$inject = function $inject(deps, fn) {\n\n return this.$di.inject(deps, fn);\n};\n\n/**\n * Shortcut of `noder.$di.provider()`.\n *\n * Create a `provider` that supports dependencies injection.\n * When the item `key` is called,\n * it calls the function `fn` by passing dependencies `deps`.\n *\n * This method defines a function that returns the result\n * of `noder.$di.inject(deps, fn)`.\n *\n * @param {string} key The key (provider identifier).\n * @param {string|array|function} deps See [Noder.$inject()](#$inject).\n * @param {function} [fn] See [Noder.$inject()](#$inject).\n *\n * @return {Noder} The current `Noder` instance.\n *\n * @see Collection.provider()\n * @see Noder.$inject()\n * @see Noder.$factory()\n * @see Noder.$singleton()\n * @see Noder.$wrap()\n */\nNoder.prototype.$provider = function $provider(key, deps, fn) {\n\n this.$di.provider(key, deps, fn);\n\n return this;\n};\n\n/**\n * Shortcut of `noder.$di.factory()`.\n *\n * Create a `factory` that supports dependencies injection.\n * When the item `key` is called,\n * it calls the function `fn` by passing dependencies `deps`.\n *\n * This method defines a function that returns the result\n * of `noder.$di.invoke(deps, fn)`.\n *\n * @param {string} key The key (factory identifier).\n * @param {string|array|function} deps See [Noder.$invoke()](#$invoke).\n * @param {function} [fn] See [Noder.$invoke()](#$invoke).\n *\n * @return {Noder} The current `Noder` instance.\n *\n * @see Collection.factory()\n * @see Noder.$invoke()\n * @see Noder.$provider()\n * @see Noder.$singleton()\n * @see Noder.$wrap()\n */\nNoder.prototype.$factory = function $factory(key, deps, fn) {\n\n this.$di.factory(key, deps, fn);\n\n return this;\n};\n\n/**\n * Shortcut of `noder.$di.singleton()`.\n *\n * Create a singleton (function shared).\n *\n * @param {string} key The key (function identifier).\n *\n * @param {function} fn The function, executed once,\n * after the value is returned when is again called.\n *\n * @return {Noder} The current `Noder` instance.\n *\n * @see Collection.singleton()\n * @see Noder.$provider()\n * @see Noder.$factory()\n * @see Noder.$wrap()\n */\nNoder.prototype.$singleton = function $singleton(key, fn) {\n\n this.$di.singleton(key, fn);\n\n return this;\n};\n\n/**\n * Shortcut of `noder.$di.apply()`.\n *\n * Calls a given function by binding the scope (`this`) to the `$di` container\n * (`noder.$di._container`).\n *\n * @example\n * noder.$di.set('name', 'Nico');\n *\n * // returns 'Nico'\n * noder.$apply(function() {\n * return this.name;\n * });\n *\n * @param {function|object} bindable See [Collection.apply()](collection.html#apply).\n * @param {...mixed} [arguments] Zero, one or more arguments passed to `bindable`.\n *\n * @return {mixed} The value returned by `bindable`.\n *\n * @see Collection.apply()\n * @see Noder.inject()\n */\nNoder.prototype.$apply = function $apply(bindable) {\n\n return this.$di.apply(bindable);\n};\n\n/**\n * Shortcut of `noder.$di.wrap()`.\n *\n * Wrap a value.\n * Useful to avoid calling a function in the implementation\n * of a _provider_ or a _factory_.\n *\n * @param {mixed} value The value to wrap.\n * @return {function} `value` wrapped by a function.\n *\n * @see Collection.wrap()\n */\nNoder.prototype.$wrap = function $wrap(value) {\n\n return this.$di.wrap(value);\n};\n\n/**\n * Lazy `require()`, register a new lazy loadable property\n * whose the value will be assigned on the fly with `require()` only when it is used.\n *\n * The property configuration is :\n * * enumerable: true,\n * * configurable: false,\n * * writable: false\n *\n * @example\n * // Register `markdown` property\n * // Note: `marked` module is not loaded\n * noder.$require('markdown', 'marked');\n *\n * // Now load the `marked` module in the `markdown` property\n * noder.markdown;\n *\n * @example\n * // Register a sub-property.\n * noder.models = {};\n *\n * noder.$require('User', './models/user', noder.models);\n *\n * // Load the `./models/user` module in `noder.models.User` property.\n * noder.models.User.someMethod();\n *\n * @param {string|function} property The property name\n * or `required` value if the `required`\n * argument is not provided (shortcut).\n *\n * @param {string|function} [required] The module name or the JS file path\n * required to set the property value.\n * Or a custom loader handler\n * via a given function, the scope (`this`)\n * bind to `noder.$di._container`\n * like `noder.$apply()`.\n *\n * Note:\n * * The `required` argument is passed to the function `require()`.\n * * The `required` item is only loaded the first time (singleton).\n *\n * @param {object} [obj] The object where the property is created.\n * If is not provided, it's the current instance of `Noder`.\n *\n * @return {Noder} The current `Noder` instance.\n */\nNoder.prototype.$require = function $require(property, required, obj) {\n\n var ref;\n var _this = this;\n\n obj = obj || this;\n\n Object.defineProperty(obj, property, {\n\n enumerable : true,\n configurable : false,\n\n get: function() {\n\n // most cases, faster checking\n if (typeof ref != 'undefined') {\n return ref;\n }\n\n // rare cases, ensure the modules with undefined return\n if(_this.$require.isLoaded(property, obj)) {\n return ref;\n }\n\n if(!required) {\n required = property;\n }\n\n ref = (typeof required === 'function' ?\n required.call(_this.$di._container) : require(required));\n\n if(!loaded[property]) {\n loaded[property] = [];\n }\n\n loaded[property].push(obj);\n\n return ref;\n },\n\n set: function() {\n throw new Error(\n '\"' + property +'\" property is not writable because is a placeholder ' +\n 'of a property of a lazy loading module.'\n );\n }\n });\n\n return this;\n};\n\n/**\n * Check if a given module is loaded.\n *\n * @example\n * noder.$require('express');\n *\n * // false\n * console.log(noder.$require.isLoaded('express'));\n *\n * var express = noder.express;\n *\n * // true\n * console.log(noder.$require.isLoaded('express'));\n *\n * @param {string} property The property name.\n * @param {object} [obj] Object to check the property. If is not provided,\n * it's the current instance of `Noder`.\n * @return {bool} `true` if the given module is loaded, `false` otherwise.\n * @see Noder.$require()\n */\nNoder.prototype.$require.isLoaded = function isLoaded(property, obj) {\n\n if(!obj) {\n return loaded[property] ? true : false;\n }\n\n if(!loaded[property]) {\n return false;\n }\n\n obj = obj || this;\n\n return (loaded[property].indexOf(obj) !== -1);\n};\n\nmodule.exports = new Noder();\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/index.js\n ** module id = 1\n ** module chunks = 0\n **/","/**\n * This file is part of Noder.io.\n *\n * (c) Nicolas Tallefourtane \n *\n * For the full copyright and license information, please view\n * the LICENSE file that was distributed with this source code\n * or visit http://noder.io.\n *\n * @author Nicolas Tallefourtane \n */\n\n'use strict';\n\nvar utils = require('./utils');\n\n/**\n * Create a new collection.\n *\n * @constructor\n *\n * @example\n * var items = new Collection();\n *\n * @param {object} [values] Values to add in the collection.\n * @throws {TypeError} If the arguments `values` is provided is not an `object`.\n */\nfunction Collection(values) {\n\n /**\n * Items container.\n * All values of the collection are stored in the container.\n * @type {object}\n */\n this._container = values || {};\n\n if (values && typeof values !== 'object') {\n throw new TypeError(\n 'Argument #1 passed to Collection must be an object'\n );\n }\n}\n\n/**\n * Get all keys of the collection.\n *\n * @example\n * items.keys();\n *\n * @return {array} An array of keys.\n */\nCollection.prototype.keys = function keys() {\n return Object.keys(this._container);\n};\n\n/**\n * Checks if an item exists\n *\n * @example\n * items.set('keyName', 'any value');\n *\n * if(items.has('keyName')) {\n * console.log('has `keyName`');\n * }\n *\n * @param {string} key The key of the item to check.\n * @return {bool} `true` if exists, `false` otherwise.\n * @throws {TypeError} If `key` is not a `string`.\n */\nCollection.prototype.has = function has(key) {\n\n if (typeof key !== 'string') {\n throw new TypeError(\n 'Argument #1 passed to Collection.has() must be a string identifier, ' +\n Object.prototype.toString(key) + ' given'\n );\n }\n\n return (key in this._container === true);\n};\n\n/**\n * Remove an item.\n *\n * @example\n * items.set('keyName', 'any value');\n *\n * // true\n * console.log(items.has('keyName'));\n *\n * items.remove('keyName');\n *\n * // false\n * console.log(items.has('keyName'));\n *\n * @param {string} key The key of item to remove.\n * @return {Collection} The current ìnstance.\n * @throws {TypeError} If `key` is not a `string`.\n */\nCollection.prototype.remove = function remove(key) {\n\n if (typeof key !== 'string') {\n throw new TypeError(\n 'Argument #1 passed to Collection.remove() must be a string ' +\n 'identifier'\n );\n }\n\n delete this._container[key];\n\n return this;\n};\n\n/**\n * Set an item.\n *\n * @example\n * items.set('hello', 'Hello World!');\n *\n * // Hello World!\n * console.log(items.get('hello'));\n *\n * @param {string} key Key name.\n * @param {mixed} value The value.\n * @return {Collection} The current ìnstance.\n * @throws {TypeError} If `key` is not a `string`.\n */\nCollection.prototype.set = function set(key, value) {\n\n if (typeof key !== 'string') {\n throw new TypeError(\n 'Argument #1 passed to Collection.set() must be a string identifier'\n );\n }\n\n this._container[key] = value;\n\n return this;\n};\n\n/**\n * Set all items of the collection.\n * All collection is overwritten by the given set of items.\n *\n * @example\n * items.setAll({\n * a: 'value 1',\n * b: 'value 2',\n * c: 'value 3'\n * });\n *\n * @param {values} values The new values of the collection.\n *\n * @return {Collection} The current ìnstance.\n * @throws {TypeError} If `values` is not an `object`.\n */\nCollection.prototype.setAll = function setAll(values) {\n\n if (typeof values !== 'object') {\n throw new TypeError(\n 'Argument #1 passed to Collection.setAll() must be an object'\n );\n }\n\n this._container = values;\n\n return this;\n};\n\n/**\n * Add all items in the collection.\n *\n * items.addAll({\n * a: 'value 1',\n * b: 'value 2',\n * c: 'value 3'\n * });\n *\n * @param {object} values The values to add.\n * The existing values are overwritten,\n * the other items are preserved.\n *\n * @return {Collection} The current ìnstance.\n * @throws {TypeError} If `values` is not an `object` or if a key is not a `string`.\n */\nCollection.prototype.addAll = function addAll(values) {\n\n if (typeof values !== 'object') {\n throw new TypeError(\n 'Argument #1 passed to Collection.addAll() must be an object'\n );\n }\n\n for (var key in values) {\n this.set(key, values[key]);\n }\n\n return this;\n};\n\n/**\n * Add once an item in the collection.\n * Identical to [Collection.set()](#set) method, except the item is added only\n * if it is not already defined in the collection.\n *\n * @param {string} key The key name.\n *\n * @param {mixed} value The value.\n *\n * @param {bool} [skip_if_exists] Defines the behavior if the given key exists:\n * * if `truthy`, nothing happens and the item already defined is not overwritten\n * * if `falsy` (by default) an `Error` is thrown\n *\n * @return {Collection} The current ìnstance.\n *\n * @throws {TypeError} If `key` is not a `string`.\n *\n * @throws {Error} If an item is already defined\n * with the same `key` and `skip_if_exists` is not `truthy`.\n *\n * @see Collection.addOnceAll()\n * @see Collection.set()\n */\nCollection.prototype.addOnce = function addOnce(key, value, skip_if_exists) {\n\n if (this.has(key)) {\n\n if (skip_if_exists){\n return this;\n }\n\n throw new Error(\n 'Identifier ' + key + ' passed to Collection.addOnce() ' +\n 'is already defined'\n );\n }\n\n return this.set(key, value);\n};\n\n/**\n * Add all items in the collection only if not already defined.\n *\n * @param {object} values Identical to [Collection.addAll()](#addAll) method.\n *\n * @param {bool} [skip_if_exists] Defines the behavior if an item exists:\n * * if `truthy`, nothing happens and the item already defined is not overwritten\n * * if `falsy` (by default) an `Error` is thrown\n *\n * @return {Collection} The current ìnstance.\n *\n * @throws {TypeError} If `values` is not an `object` or if a key is not a `string`.\n * @throws {Error} If an item is already defined and `skip_if_exists` is not `truthy`.\n *\n * @see Collection.addOnce()\n * @see Collection.addAll()\n */\nCollection.prototype.addOnceAll = function addOnceAll(values, skip_if_exists) {\n\n if (typeof values !== 'object') {\n throw new TypeError(\n 'Argument #1 passed to Collection.addOnceAll() must be an object'\n );\n }\n\n for (var key in values) {\n this.addOnce(key, values[key], skip_if_exists);\n }\n\n return this;\n};\n\n/**\n * Merge `values` (recursive) in the collection.\n *\n * @param {object} values Values to merge.\n * @param {...object} [values] Zero, one or several other objects.\n *\n * @return {Collection} The current ìnstance.\n * @throws {TypeError} If `values` is not an `object`.\n */\nCollection.prototype.merge = function merge(values) {\n\n if (typeof values !== 'object') {\n throw new TypeError(\n 'Argument #1 passed to Collection.merge() must be an object'\n );\n }\n\n var args = Array.prototype.concat.apply([this._container], arguments);\n\n this._container = utils.mergeRecursive.apply(utils, args);\n\n return this;\n};\n\n/**\n * Get all items of the collection.\n *\n * @return {object} All items defined in the collection.\n */\nCollection.prototype.getAll = function getAll() {\n\n return this._container;\n};\n\n/**\n * Get an item value.\n *\n * If the item is a function, the fonction is called\n * and `get()` returns the value returned by the function called.\n *\n * If you want the raw value, uses [Collection.raw()](#raw).\n *\n * @example\n * items.addAll({\n * a: 'value of \"a\"',\n * b: function() {\n * 'value of \"b\"'\n * }\n * });\n *\n * // value of \"a\", string\n * console.log(items.get('a'), typeof items.get('a'));\n *\n * // value of \"b\", string\n * console.log(items.get('b'), typeof items.get('b'));\n *\n * // value of \"a\", string\n * console.log(items.raw('a'), typeof items.raw('a'));\n *\n * // [Function], function\n * console.log(items.raw('b'), typeof items.raw('b'));\n *\n * @param {string} key The key of the item\n *\n * @param {mixed} [default_value] The default value if the item\n * does not exist (`default_value` is ignored\n * if `strict` is `truthy`).\n *\n * @param {bool} [strict] If `truthy` and the item does not exist,\n * throws an `Error` (`default_value` is ignored\n * if `strict` is `truthy`).\n *\n * @return {mixed} The item value (if defined).\n * @return {mixed} Returns `default_value` if:\n * * a default value is defined\n * * `strict` is not `truthy`\n * * the item (`key`) does not exist\n *\n * @throws {TypeError} If `key` is not a `string`.\n * @throws {Error} If `strict` is `truthy` and the item does not exist.\n *\n * @see Collection.raw()\n * @see Collection.apply()\n * @see Collection.invoke()\n */\nCollection.prototype.get = function get(key, default_value, strict) {\n\n if (typeof this._container[key] === 'function') {\n return this._container[key]();\n }\n\n if (this.has(key)) {\n return this._container[key];\n }\n\n if (typeof default_value === 'function') {\n return this.raw(key, default_value, strict)();\n }\n\n return this.raw(key, default_value, strict);\n};\n\n/**\n * Get an item.\n *\n * @example\n * items.set('multiply', function(a, b) {\n * return a * b;\n * });\n *\n * var multiply = items.raw('multiply');\n *\n * // returns 8\n * multiply(2, 4);\n *\n * // or directly\n * // returns 8\n * items.raw('multiply')(2, 4);\n *\n * // or equivalent by injection\n *\n * // returns 8\n * items.inject('multiply', function(multiply) {\n * return multiply(2, 4);\n * });\n *\n * // returns 8\n * items.apply(function() {\n * return this.multiply(2, 4);\n * });\n *\n * @param {string} key The key of the item\n *\n * @param {mixed} [default_value] The default value if the item\n * does not exist (`default_value` is ignored\n * if `strict` is `truthy`).\n *\n * @param {bool} [strict] If `truthy` and the item does not exist,\n * throws an `Error` (`default_value` is ignored\n * if `strict` is `truthy`).\n *\n * @return {mixed} The item value (if defined).\n *\n * @return {mixed} Returns `default_value` if:\n * * a default value is defined\n * * `strict` is not `truthy`\n * * the item (`key`) does not exist\n *\n * @throws {TypeError} If `key` is not a `string`.\n *\n * @throws {Error} If `strict` is `truthy` and the item does not exist.\n *\n * @see Collection.get()\n * @see Collection.apply()\n * @see Collection.inject()\n */\nCollection.prototype.raw = function raw(key, default_value, strict) {\n\n if (this.has(key)) {\n return this._container[key];\n }\n\n if (strict){\n throw new Error('Identifier ' + key + ' is not defined');\n }\n\n return default_value;\n};\n\n/**\n * Call a function with dependencies injection.\n *\n * Unlike `Collection.invoke()`,\n * the raw value of each dependency is passed to `fn`.\n *\n * @example\n * items.set('multiply', function(a, b) {\n * return a * b;\n * });\n *\n * // returns 8\n * items.inject('multiply', function(multiply) {\n * return multiply(2, 4);\n * });\n *\n * // or equivalent\n *\n * // return 8\n * items.apply(function() {\n * return this.multiply(2, 4);\n * });\n *\n * // returns 8\n * items.raw('multiply')(2, 4);\n *\n * @param {string|array|function} deps Dependencies to inject as arguments of\n * the function (`fn`).\n * Or only a function that receives\n * in first argument\n * the container of `Collection` instance.\n *\n * @param {function} [fn] Function to call. Dependencies are passed as arguments\n * in the order of declaration.\n * If `deps` is a function, this argument is ignored.\n *\n * @return {mixed} The value returned by the given function.\n *\n * @throws {TypeError} If a key is not a `string`.\n *\n * @see Collection.invoke()\n * @see Collection.raw()\n * @see Collection.apply()\n */\nCollection.prototype.inject = function inject(deps, fn) {\n\n if (Array.isArray(deps)) {\n\n for(var i in deps) {\n deps[i] = this.raw(deps[i]);\n }\n\n return fn.apply(null, deps);\n }\n\n return typeof deps === 'function' ? deps(this._container) : fn(this.raw(deps));\n};\n\n/**\n * Call a function with dependencies injection.\n *\n * Unlike `Collection.inject()`,\n * the returned value of each dependency is passed to `fn`.\n *\n * @example\n * items.addAll({\n * name: 'Nico',\n * hello: function(){\n * return 'Hello ' + this.name;\n * }\n * });\n *\n * items.invoke('hello', function(hello) {\n *\n * // Hello Nico\n * console.log(hello);\n * });\n *\n * @param {string|array|function} deps Dependencies to call and inject the\n * returned value as arguments of\n * the function (`fn`).\n * Or only a function that receives\n * in first argument\n * the container of `Collection` instance.\n *\n * @param {function} [fn] Function to call. Dependencies are passed as arguments\n * in the order of declaration.\n * If `deps` is a function, this argument is ignored.\n *\n * @return {mixed} The value returned by the given function.\n *\n * @throws {TypeError} If a key is not a `string`.\n *\n * @see Collection.get()\n * @see Collection.inject()\n * @see Collection.apply()\n */\nCollection.prototype.invoke = function invoke(deps, fn) {\n\n if (Array.isArray(deps)) {\n\n for(var i in deps) {\n deps[i] = this.get(deps[i]);\n }\n\n return fn.apply(null, deps);\n }\n\n return typeof deps === 'function' ? deps(this._container) : fn(this.get(deps));\n};\n\n/**\n * Calls a given function by binding the scope (`this`) to the container\n * (`Collection._container`).\n *\n * The javascript function implements natively the methods `call()` and `apply()`.\n *\n * It is possible that `bindable` argument is not a function,\n * in this case it is necessary that the object implements\n * `call(container)` and `apply(container, args)`, then handles the logic.\n *\n * @example\n * var fn = function() {\n * return this === items._container;\n * };\n *\n * // true\n * console.log(items.apply(fn));\n *\n * @param {function|object} bindable Function or object to call and whose\n * the scope (`this`) will bind to container.\n *\n * @param {...mixed} [arguments] Zero, one or more arguments\n * passed to `bindable`.\n *\n * @return {mixed} The value returned by `bindable`.\n *\n * @see Collection.inject()\n * @see Collection.invoke()\n */\nCollection.prototype.apply = function apply(bindable) {\n\n if(arguments.length > 1) {\n\n var args = Array.prototype.slice.call(arguments, 1);\n\n return bindable.apply(this._container, args);\n }\n\n return bindable.call(this._container);\n};\n\n\n/**\n * Wrap a value.\n * Useful to avoid calling a function in the implementation\n * of a _provider_ or a _factory_.\n *\n * @param {mixed} value The value to wrap.\n * @return {function} `value` wrapped by a function\n *\n * @see Collection.singleton()\n * @see Collection.provider()\n * @see Collection.factory()\n */\nCollection.prototype.wrap = function wrap(value) {\n\n return function wrapper() {\n return value;\n };\n};\n\n/**\n * Create a singleton (function shared).\n *\n * @param {string} key The key (function identifier).\n *\n * @param {function} fn The function, executed once,\n * after the value is returned when is again called.\n *\n * @return {Collection} The current ìnstance.\n *\n * @throws {TypeError} If `key` is not a `string` or if `fn` is not a `function`.\n *\n * @see Collection.provider()\n * @see Collection.factory()\n * @see Collection.wrap()\n */\nCollection.prototype.singleton = function singleton(key, fn) {\n\n var ret;\n var shared;\n\n if (typeof key !== 'string') {\n throw new TypeError(\n 'Argument #1 passed to Collection.singleton() must be a string ' +\n 'identifier'\n );\n }\n\n if (typeof fn !== 'function') {\n throw new TypeError(\n 'Argument #2 passed to Collection.singleton() must be a function'\n );\n }\n\n this._container[key] = function() {\n\n if (!ret) {\n ret = true;\n shared = arguments.length ? fn.apply(null, arguments) : fn();\n }\n\n return shared;\n };\n\n return this;\n};\n\n/**\n * Create a _provider_ that supports dependencies injection.\n * When the item `key` is called,\n * it calls the function `fn` by passing dependencies `deps`.\n *\n * This method defines a function that returns the result\n * of [Collection.inject(deps, fn)](#inject).\n *\n * @example\n * items.set('hello', function() {\n * return 'Hello World!';\n * });\n *\n * items.provider('sayHello', ['hello'], function(hello) {\n * return hello();\n * });\n *\n * // 'Hello World!'\n * items.get('sayHello');\n *\n * // or with the scope in any injector\n * items.apply(function() {\n *\n * // 'Hello World!'\n * console.log(this.sayHello);\n * });\n *\n * @param {string} key The key (provider identifier).\n * @param {string|array|function} deps See [Collection.inject()](#inject).\n * @param {function} [fn] See [Collection.inject()](#inject).\n *\n * @return {Collection} The current ìnstance.\n *\n * @throws {TypeError} If `key` is not a `string`\n * or if a given key in `deps` is not a `string`.\n *\n * @see Collection.inject()\n * @see Collection.factory()\n * @see Collection.singleton()\n * @see Collection.wrap()\n */\nCollection.prototype.provider = function provider(key, deps, fn) {\n\n var _this = this;\n var ret;\n var shared;\n\n if (typeof key !== 'string') {\n throw new TypeError(\n 'Argument #1 passed to Collection.provider() must be a string ' +\n 'identifier'\n );\n }\n\n this._container[key] = function() {\n\n if(!ret) {\n ret = true;\n shared = _this.inject(deps, fn);\n }\n\n return shared;\n };\n\n return this;\n};\n\n/**\n * Create a _factory_ that supports dependencies injection.\n * When the item `key` is called,\n * it calls the function `fn` by passing dependencies `deps`.\n *\n * This method defines a function that returns the result\n * of [Collection.invoke(deps, fn)](#invoke).\n *\n * @example\n * items.set('hello', function() {\n * return 'Hello World!';\n * });\n *\n * items.factory('sayHello', ['hello'], function(hello) {\n * return hello;\n * });\n *\n * // 'Hello World!'\n * items.get('sayHello');\n *\n * // or with the scope in any injector\n * items.apply(function() {\n *\n * // 'Hello World!'\n * console.log(this.sayHello);\n * });\n *\n * @param {string} key The key (factory identifier).\n * @param {string|array|function} deps See `Collection.invoke()`.\n * @param {function} [fn] See `Collection.invoke()`.\n *\n * @return {Collection} The current ìnstance.\n *\n * @throws {TypeError} If `key` is not a `string`\n * or if a given key in `deps` is not a `string`.\n *\n * @see Collection.invoke()\n * @see Collection.provider()\n * @see Collection.singleton()\n * @see Collection.wrap()\n */\nCollection.prototype.factory = function factory(key, deps, fn) {\n\n var _this = this;\n var ret;\n var shared;\n\n if (typeof key !== 'string') {\n throw new TypeError(\n 'Argument #1 passed to Collection.factory() must be a string ' +\n 'identifier'\n );\n }\n\n this._container[key] = function() {\n\n if(!ret) {\n ret = true;\n shared = _this.invoke(deps, fn);\n }\n\n return shared;\n };\n\n return this;\n};\n\n\nmodule.exports = Collection;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/collection.js\n ** module id = 2\n ** module chunks = 0\n **/","var map = {\n\t\"./collection\": 2,\n\t\"./collection.js\": 2,\n\t\"./index\": 1,\n\t\"./index.js\": 1,\n\t\"./utils\": 4,\n\t\"./utils.js\": 4\n};\nfunction webpackContext(req) {\n\treturn __webpack_require__(webpackContextResolve(req));\n};\nfunction webpackContextResolve(req) {\n\treturn map[req] || (function() { throw new Error(\"Cannot find module '\" + req + \"'.\") }());\n};\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src ^\\.\\/.*$\n ** module id = 3\n ** module chunks = 0\n **/","/**\n * This file is part of Noder.io.\n *\n * (c) Nicolas Tallefourtane \n *\n * For the full copyright and license information, please view\n * the LICENSE file that was distributed with this source code\n * or visit http://noder.io.\n *\n * @author Nicolas Tallefourtane \n */\n\n'use strict';\n\n/**\n * Merge object `b` in object `a`.\n *\n * @example\n * var a = { foo: 'bar' };\n * var b = { bar: 'baz' };\n *\n * utils.merge(a, b);\n * // => { foo: 'bar', bar: 'baz' }\n *\n * @param {Object} a Object that receives the value of `b`.\n * @param {Object} b Object to merge in `a`.\n * @return {Object} `a` merged\n */\nfunction merge(a, b) {\n\n if (a && b) {\n for (var key in b) {\n a[key] = b[key];\n }\n }\n\n return a;\n}\n\n/**\n * Merge recursive.\n *\n * @param {object|array} obj Object that receives the value of `from`\n * @param {...object|array} from One or more objects to merge in `obj`.\n * @return {Object} `obj` merged\n */\nfunction mergeRecursive(obj) {\n\n var argLen = arguments.length;\n\n if (argLen < 2) {\n throw new Error('There should be at least 2 arguments passed to utils.mergeRecursive()');\n }\n\n for (var i = 1; i < argLen; i++) {\n for (var p in arguments[i]) {\n if (obj[p] && typeof obj[p] === 'object') {\n obj[p] = mergeRecursive(obj[p], arguments[i][p]);\n } else {\n obj[p] = arguments[i][p];\n }\n }\n }\n\n return obj;\n}\n\n\n/*----------------------------------------------------------------------------*\\\n Expose\n\\*----------------------------------------------------------------------------*/\n\nmodule.exports.merge = merge;\nmodule.exports.mergeRecursive = mergeRecursive;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/utils.js\n ** module id = 4\n ** module chunks = 0\n **/"],"sourceRoot":"","file":"noder-dev.js"}