{"_id":"preceptor-core","_rev":"21-c963204be180a9596372778f282b8da6","name":"preceptor-core","description":"Core components for the preceptor test runner and aggregator","dist-tags":{"latest":"0.10.1"},"versions":{"0.9.0":{"name":"preceptor-core","version":"0.9.0","description":"Core components for the preceptor test-runner and aggregator","license":"MIT","main":"index.js","homepage":"https://github.com/yahoo/preceptor-core","bugs":{"url":"https://github.com/yahoo/preceptor-core/issues"},"author":{"name":"Marcel Erz","email":"erz@yahoo-inc.com"},"repository":{"type":"git","url":"https://github.com/yahoo/preceptor-core.git"},"keywords":["testing"],"scripts":{"test":"istanbul cover -- _mocha --reporter spec","docs":"yuidoc ."},"dependencies":{"underscore":"1.7.0"},"devDependencies":{"chai":"1.9.1","istanbul":"0.3.2","mocha":"1.21.4","yuidocjs":"0.3.50"},"gitHead":"25da45abb7ca9f8a9e7416bb9fae6c34bc6d972a","_id":"preceptor-core@0.9.0","_shasum":"b2dce0a3829937b7b6849180613cc19815e59d86","_from":".","_npmVersion":"1.5.0-alpha-2","_npmUser":{"name":"marcelerz","email":"marcel.erz@gmail.com"},"maintainers":[{"name":"marcelerz","email":"marcel.erz@gmail.com"}],"dist":{"shasum":"b2dce0a3829937b7b6849180613cc19815e59d86","tarball":"https://registry.npmjs.org/preceptor-core/-/preceptor-core-0.9.0.tgz","integrity":"sha512-OtL0mIXzi7uV5aVyrsgT7TxSJQo3b1PTj+k/SgERpQHJ/83Ze2vPM5eN+UWUEaMX5VJ4dZz1dZ+Fw7B+Wu6hlw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIErmmJw3EaC3FvyLt4G4HLRE+mIW2tOGB0GfpOyk6sogAiEA+seD1zViWMpstQarXXZzgXsbVjp+lQE3UuIdTRNznT0="}]},"directories":{}},"0.9.1":{"name":"preceptor-core","version":"0.9.1","description":"Core components for the preceptor test-runner and aggregator","license":"MIT","main":"index.js","homepage":"https://github.com/yahoo/preceptor-core","bugs":{"url":"https://github.com/yahoo/preceptor-core/issues"},"author":{"name":"Marcel Erz","email":"erz@yahoo-inc.com"},"repository":{"type":"git","url":"https://github.com/yahoo/preceptor-core.git"},"keywords":["testing"],"scripts":{"test":"istanbul cover -- _mocha --reporter spec","docs":"yuidoc ."},"dependencies":{"underscore":"1.7.0","mkdirp":"0.5.0"},"devDependencies":{"chai":"1.9.1","coveralls":"2.11.2","istanbul":"0.3.2","mocha":"1.21.4","yuidocjs":"0.3.50"},"gitHead":"4073c2c5a9bc5239b6812150b28626f0f0773093","_id":"preceptor-core@0.9.1","_shasum":"56a1b3b3e1575a0a31654a968425ba761c4cdc2a","_from":".","_npmVersion":"1.5.0-alpha-2","_npmUser":{"name":"marcelerz","email":"marcel.erz@gmail.com"},"maintainers":[{"name":"marcelerz","email":"marcel.erz@gmail.com"},{"name":"davglass","email":"davglass@gmail.com"}],"dist":{"shasum":"56a1b3b3e1575a0a31654a968425ba761c4cdc2a","tarball":"https://registry.npmjs.org/preceptor-core/-/preceptor-core-0.9.1.tgz","integrity":"sha512-htjYSJm7t0sB8sgGkqHmTX8sIy2Y0eS2O7eWn44u/QoQtGcBYGoUNMCKQbAmiWYPUkQANE0StYAyqo1P721RKg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCj7++enEgghd1W6w+zRAHjuNoj1cXPhDgmFs9vgewqugIhAIDeQFg1XNMi//wdfDhxUWswhmjDAxWRlfms+efZY4sa"}]},"directories":{}},"0.9.2":{"name":"preceptor-core","version":"0.9.2","description":"Core components for the preceptor test-runner and aggregator","license":"MIT","main":"index.js","homepage":"https://github.com/yahoo/preceptor-core","bugs":{"url":"https://github.com/yahoo/preceptor-core/issues"},"author":{"name":"Marcel Erz","email":"erz@yahoo-inc.com"},"repository":{"type":"git","url":"https://github.com/yahoo/preceptor-core.git"},"keywords":["testing"],"scripts":{"test":"istanbul cover -- _mocha --reporter spec","docs":"yuidoc ."},"dependencies":{"underscore":"1.7.0","mkdirp":"0.5.0"},"devDependencies":{"chai":"1.9.1","coveralls":"2.11.2","istanbul":"0.3.2","mocha":"1.21.4","yuidocjs":"0.3.50"},"gitHead":"fa64017588703df2b4cd38327291a31a866eb8bb","_id":"preceptor-core@0.9.2","_shasum":"26ebc399a2554c20564f18aa2bdc6dbc8ae248df","_from":".","_npmVersion":"1.5.0-alpha-2","_npmUser":{"name":"marcelerz","email":"marcel.erz@gmail.com"},"maintainers":[{"name":"marcelerz","email":"marcel.erz@gmail.com"},{"name":"davglass","email":"davglass@gmail.com"}],"dist":{"shasum":"26ebc399a2554c20564f18aa2bdc6dbc8ae248df","tarball":"https://registry.npmjs.org/preceptor-core/-/preceptor-core-0.9.2.tgz","integrity":"sha512-FL1EuYucm+6AzOTIE2cdtnbK9ipfOlMCHDiIzHnTbNw/N7ZiBGXmJ1TwQQENdrCfCrOMq8QmwrVtzPCzipLnIg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDanNttogIArinAuFL7Nzr5zlBM1Lx4Q6/NxnghO0PaqAiEA7SJAXeelH1yhyUGfqnpqXMqLntvSHvrn++4UFUVcP6o="}]},"directories":{}},"0.9.3":{"name":"preceptor-core","version":"0.9.3","description":"Core components for the preceptor test-runner and aggregator","license":"MIT","main":"index.js","homepage":"https://github.com/yahoo/preceptor-core","bugs":{"url":"https://github.com/yahoo/preceptor-core/issues"},"author":{"name":"Marcel Erz","email":"erz@yahoo-inc.com"},"repository":{"type":"git","url":"https://github.com/yahoo/preceptor-core.git"},"keywords":["testing"],"scripts":{"test":"istanbul cover -- _mocha --reporter spec","docs":"yuidoc ."},"dependencies":{"underscore":"1.7.0","mkdirp":"0.5.0"},"devDependencies":{"chai":"1.9.1","coveralls":"2.11.2","istanbul":"0.3.2","mocha":"1.21.4","yuidocjs":"0.3.50"},"gitHead":"da83a5497633deb32165931bc4aed4ed955a15c9","_id":"preceptor-core@0.9.3","_shasum":"1fa5779c8801ba945ac0605ab717d9509b2853b2","_from":".","_npmVersion":"1.5.0-alpha-2","_npmUser":{"name":"marcelerz","email":"marcel.erz@gmail.com"},"maintainers":[{"name":"marcelerz","email":"marcel.erz@gmail.com"},{"name":"davglass","email":"davglass@gmail.com"}],"dist":{"shasum":"1fa5779c8801ba945ac0605ab717d9509b2853b2","tarball":"https://registry.npmjs.org/preceptor-core/-/preceptor-core-0.9.3.tgz","integrity":"sha512-E9OuiuzQtBT5kVIRCk9IfLlFaAMuc5tQXzFW7RHMly9Bia8HL1FFlIe6aYblbLhAT+dBBw19/eKnSpx4gg3UGw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICm6DG11e19mEd7aIZbwA3oPPbNjOGVWkqo51AlsP1kPAiEAgI+ghLFPhz+b1hcxYMjewtgVWlwIVENrWWL3G/vuF0Q="}]},"directories":{}},"0.9.4":{"name":"preceptor-core","version":"0.9.4","description":"Core components for the preceptor test-runner and aggregator","license":"MIT","main":"index.js","homepage":"https://github.com/yahoo/preceptor-core","bugs":{"url":"https://github.com/yahoo/preceptor-core/issues"},"author":{"name":"Marcel Erz","email":"erz@yahoo-inc.com"},"repository":{"type":"git","url":"https://github.com/yahoo/preceptor-core.git"},"keywords":["testing"],"scripts":{"test":"istanbul cover -- _mocha --reporter spec","docs":"yuidoc ."},"dependencies":{"underscore":"1.7.0","mkdirp":"0.5.0"},"devDependencies":{"chai":"1.9.1","coveralls":"2.11.2","istanbul":"0.3.2","mocha":"1.21.4","yuidocjs":"0.3.50"},"gitHead":"1983f9ef148c05d0288ca927b52ae0942a585434","_id":"preceptor-core@0.9.4","_shasum":"5aa6284255346654464e8c949df7bbb993271665","_from":".","_npmVersion":"1.5.0-alpha-2","_npmUser":{"name":"marcelerz","email":"marcel.erz@gmail.com"},"maintainers":[{"name":"marcelerz","email":"marcel.erz@gmail.com"},{"name":"davglass","email":"davglass@gmail.com"}],"dist":{"shasum":"5aa6284255346654464e8c949df7bbb993271665","tarball":"https://registry.npmjs.org/preceptor-core/-/preceptor-core-0.9.4.tgz","integrity":"sha512-v03SyLStc70cXtAQpAtGR9nvDcoBkKAExqbzooQQXw7quIZ0e8l2r8OmRM5m8iuAa6oQQOm7byD9z1eDnylzmw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICAXroBQdRsyZpIlCm9csX8LLPcCdrs+6S3qv+97ePPoAiEAnFuVBvs1g88CN/NQDT3SaYyAKgFFgUgiu2gTEl4fcgg="}]},"directories":{}},"0.9.5":{"name":"preceptor-core","version":"0.9.5","description":"Core components for the preceptor test runner and aggregator","license":"MIT","main":"index.js","homepage":"https://github.com/yahoo/preceptor-core","bugs":{"url":"https://github.com/yahoo/preceptor-core/issues"},"author":{"name":"Marcel Erz","email":"erz@yahoo-inc.com"},"repository":{"type":"git","url":"https://github.com/yahoo/preceptor-core.git"},"keywords":["testing"],"scripts":{"test":"istanbul cover -- _mocha --reporter spec","docs":"yuidoc ."},"dependencies":{"underscore":"1.7.0","log4js":"0.6.20"},"devDependencies":{"chai":"1.9.1","coveralls":"2.11.2","istanbul":"0.3.2","mocha":"1.21.4","yuidocjs":"0.3.50"},"gitHead":"4e8c1e5a9b62e4c8defe9e1327d82075b252309d","_id":"preceptor-core@0.9.5","_shasum":"3d7d6d5c476a0a35fbf61368f1e1e69175208321","_from":".","_npmVersion":"1.5.0-alpha-2","_npmUser":{"name":"marcelerz","email":"marcel.erz@gmail.com"},"maintainers":[{"name":"marcelerz","email":"marcel.erz@gmail.com"},{"name":"davglass","email":"davglass@gmail.com"}],"dist":{"shasum":"3d7d6d5c476a0a35fbf61368f1e1e69175208321","tarball":"https://registry.npmjs.org/preceptor-core/-/preceptor-core-0.9.5.tgz","integrity":"sha512-6YhTGAobv33ib+5ROAv1mxlNljrknemNtf0t8beKsVGCkADHzbckfwAL6dPSQBgdrNrcqR2THQge46weM8zMDg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/5BIQM0NUWs/aZGq0ef6lRDF0XsqkxrR4AYWXc0O9vwIgXIe1drh1L9oI5Y4qNR3OofJr3vCBdp+c1NxdeOldHMM="}]},"directories":{}},"0.9.6":{"name":"preceptor-core","version":"0.9.6","description":"Core components for the preceptor test runner and aggregator","license":"MIT","main":"index.js","homepage":"https://github.com/yahoo/preceptor-core","bugs":{"url":"https://github.com/yahoo/preceptor-core/issues"},"author":{"name":"Marcel Erz","email":"erz@yahoo-inc.com"},"repository":{"type":"git","url":"https://github.com/yahoo/preceptor-core.git"},"keywords":["testing"],"scripts":{"test":"istanbul cover -- _mocha --reporter spec","docs":"yuidoc ."},"dependencies":{"underscore":"1.7.0","log4js":"0.6.20"},"devDependencies":{"chai":"1.9.1","coveralls":"2.11.2","istanbul":"0.3.2","mocha":"1.21.4","yuidocjs":"0.3.50"},"gitHead":"649879cdf222495228f4aaf14a97078169244dca","_id":"preceptor-core@0.9.6","_shasum":"99b98790108d8025f88485aeb4e58df643d55ce7","_from":".","_npmVersion":"1.5.0-alpha-2","_npmUser":{"name":"marcelerz","email":"marcel.erz@gmail.com"},"maintainers":[{"name":"marcelerz","email":"marcel.erz@gmail.com"},{"name":"davglass","email":"davglass@gmail.com"}],"dist":{"shasum":"99b98790108d8025f88485aeb4e58df643d55ce7","tarball":"https://registry.npmjs.org/preceptor-core/-/preceptor-core-0.9.6.tgz","integrity":"sha512-A2HxFc6LEXWMwEJGfc0cg2bSlbIf0h3fQDt0YfrKOJf+SGkyaeW01RYO8aPqyIKn3rkl1oxeGscQ2fYXVtGvAw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5TzRbJICDiuu9T/6QRzdwp0fouzGbdNVIemMFxDvG5gIhAM3JlYYSej4TtOHMS9HUputPkfRFEpLxHWG69Jd2p2/T"}]},"directories":{}},"0.10.0":{"name":"preceptor-core","version":"0.10.0","description":"Core components for the preceptor test runner and aggregator","license":"MIT","main":"index.js","homepage":"https://github.com/yahoo/preceptor-core","bugs":{"url":"https://github.com/yahoo/preceptor-core/issues"},"author":{"name":"Marcel Erz","email":"erz@yahoo-inc.com","url":"http://www.marcelerz.com"},"repository":{"type":"git","url":"https://github.com/yahoo/preceptor-core.git"},"keywords":["testing"],"scripts":{"test":"istanbul cover -- _mocha --reporter spec","docs":"yuidoc ."},"dependencies":{"underscore":"1.7.0","log4js":"0.6.20"},"devDependencies":{"chai":"1.9.2","coveralls":"2.11.2","istanbul":"0.3.2","mocha":"1.21.4","sinon":"1.12.2","sinon-chai":"2.7.0","yuidocjs":"0.3.50"},"gitHead":"8cf49c3bb3b26954a6f43ba7e5618a40950c4ee4","_id":"preceptor-core@0.10.0","_shasum":"d906e88760c6fb92121f942b393c91dfcf7618a4","_from":".","_npmVersion":"1.5.0-alpha-2","_npmUser":{"name":"marcelerz","email":"marcel.erz@gmail.com"},"maintainers":[{"name":"marcelerz","email":"marcel.erz@gmail.com"},{"name":"davglass","email":"davglass@gmail.com"}],"dist":{"shasum":"d906e88760c6fb92121f942b393c91dfcf7618a4","tarball":"https://registry.npmjs.org/preceptor-core/-/preceptor-core-0.10.0.tgz","integrity":"sha512-M2i4WlALJBCoPfeagEzZZ5ikONgWKWiAzM5EorRmQXlIu2bzf/kHYN7mANrHjgwDCuU5EuJrJbBY8VG4wXvvgw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDkOv9pHJGMY24CAWLBOo2hdBqrrGZi/QPPh2kRSNdtCgIhAJB5cToYGJ38Y0tT2hvp0IDhari+yFFE1umXgXFK9GHR"}]},"directories":{}},"0.10.1":{"name":"preceptor-core","version":"0.10.1","description":"Core components for the preceptor test runner and aggregator","license":"MIT","main":"index.js","homepage":"https://github.com/yahoo/preceptor-core","bugs":{"url":"https://github.com/yahoo/preceptor-core/issues"},"author":{"name":"Marcel Erz","email":"erz@yahoo-inc.com","url":"http://www.marcelerz.com"},"repository":{"type":"git","url":"git+https://github.com/yahoo/preceptor-core.git"},"keywords":["testing"],"scripts":{"test":"istanbul cover -- _mocha --reporter spec","docs":"yuidoc ."},"dependencies":{"underscore":"1.7.0","log4js":"1.1.1"},"devDependencies":{"chai":"1.9.2","codeclimate-test-reporter":"0.0.4","coveralls":"2.11.2","istanbul":"0.4.5","mocha":"5.0.0","sinon":"1.12.2","sinon-chai":"2.7.0","yuidocjs":"0.3.50"},"gitHead":"3a84eabb40d5e8961861b0ba738496c72b8cb5a9","_id":"preceptor-core@0.10.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"davglass","email":"davglass@gmail.com"},"dist":{"integrity":"sha512-WLDk+UowEESixvlhiamGOj/iqWrp8IWeCCHvBZrLh0g4/A1Fa77fDQWqQUd5S5rScT+9u49aDfa45xYRkxqmiA==","shasum":"c31eb026fad91c24b44351308ac97e625ec69511","tarball":"https://registry.npmjs.org/preceptor-core/-/preceptor-core-0.10.1.tgz","fileCount":11,"unpackedSize":32990,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJV+WKdRjQfLgcpa7O9+S/80hGDJSqNzJ3thSmWQ+TRAIgYycfRa6Zl4nvk/ToI4UyQBg+0hM2Flc+29xCdWyge3w="}]},"maintainers":[{"name":"davglass","email":"davglass@gmail.com"},{"name":"marcelerz","email":"marcel.erz@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/preceptor-core_0.10.1_1518651502054_0.18234738815430962"},"_hasShrinkwrap":false}},"readme":"Preceptor-Core\n==============\n\nShared library for the preceptor test runner and aggregator.\n\n\n[![Build Status](https://img.shields.io/travis/yahoo/preceptor-core.svg)](http://travis-ci.org/yahoo/preceptor-core)\n[![Coveralls Coverage](https://img.shields.io/coveralls/yahoo/preceptor-core.svg)](https://coveralls.io/r/yahoo/preceptor-core)\n[![Code Climate Grade](https://img.shields.io/codeclimate/github/yahoo/preceptor-core.svg)](https://codeclimate.com/github/yahoo/preceptor-core)\n\n[![NPM version](https://badge.fury.io/js/preceptor-core.svg)](https://www.npmjs.com/package/preceptor-core)\n[![NPM License](https://img.shields.io/npm/l/preceptor-core.svg)](https://www.npmjs.com/package/preceptor-core)\n\n[![NPM](https://nodei.co/npm/preceptor-core.png?downloads=true&stars=true)](https://www.npmjs.com/package/preceptor-core)\n[![NPM](https://nodei.co/npm-dl/preceptor-core.png?months=3&height=2)](https://www.npmjs.com/package/preceptor-core)\n\n[![Coverage Report](https://img.shields.io/badge/Coverage_Report-Available-blue.svg)](http://yahoo.github.io/preceptor-core/coverage/lcov-report/)\n[![API Documentation](https://img.shields.io/badge/API_Documentation-Available-blue.svg)](http://yahoo.github.io/preceptor-core/docs/)\n\n[![Gitter Support](https://img.shields.io/badge/Support-Gitter_IM-yellow.svg)](https://gitter.im/preceptorjs/support)\n\n\n\n**Table of Contents**\n* [Installation](#installation)\n* [Usage](#usage)\n    * [Base-Object](#base-object)\n        * [Static Properties](#static-properties---defined-on-the-constructor)\n        * [Dynamic Properties](#dynamic-properties---defined-on-this-or-prototype)\n    * [utils](#utils)\n        * [extendApply](#extendapply)\n        * [deepExtend](#deepextend)\n        * [combine](#combine)\n        * [superWrapper](#superwrapper)\n    * [log](#log)\n* [API-Documentation](#api-documentation)\n* [Tests](#tests)\n* [Third-party libraries](#third-party-libraries)\n* [License](#license)\n\n\n##Installation\n\nInstall this module with the following command:\n```shell\nnpm install preceptor-core\n```\n\nAdd the module to your ```package.json``` dependencies:\n```shell\nnpm install --save preceptor-core\n```\nAdd the module to your ```package.json``` dev-dependencies:\n```shell\nnpm install --save-dev preceptor-core\n```\n\nRequire the module in your source-code:\n```javascript\nvar core = require('preceptor-core');\n```\n\n##Usage\n\nThe module exposes two objects:\n\n* ```Base``` - A base object that every preceptor object should inherit from. See below for more information.\n* ```utils``` - Frequently used utility functions\n* ```log``` - Centralized log and logger management\n\n\n###Base-Object\n\nThe Base object inherits all features of the EventEmitter and exposes a couple static and dynamic properties:\n\n\n####Static Properties - Defined on the constructor\n#####```TYPE``` {string}\nDescribes the type of the object. The default value is \"Base\".\nOverwrite this value in sub-objects to help in debugging as the will appear as descriptor of an object.\n\n#####```extend``` {function}\nExtends the current object by creating a new constructor and inheriting all static and dynamic properties. Every function will be wrapped in a ```__super``` wrapper that will make the ```__super``` function available in every method call. (See below for more information!)\n\n*Parameters:*\n* ```constructFn``` {function} - The function to be used as constructor. This parameter is optional. When no function is given, then a generic function is used.\n* ```prototypeProperties``` {object} - Properties that should be assigned the the ```prototype``` property of the constructor. This parameter is required.\n* ```staticProperties``` {object} - Properties that should be assigned to the constructor. This parameter is optional.\n\n#####```toString``` {function}\nDescribes the object. By default, the format is: ```[TYPE]``` where by ```TYPE``` is the value assigned to the constructor.\n\n#####```__parent``` {object}\nThis is a reference to the parent prototype.\n\n\n\n####Dynamic Properties - Defined on ```this``` or ```prototype```\n#####```uniqueId``` {string}\nEvery instance of an object gets a unique-id assigned.\n\n#####```NAME``` {string}\nDescribes the instance. The default value is \"unnamed\".\nOverwrite this value in instances to help to help identifying instances during run-time.\n\n#####```toString``` {function}\nDescribes the instance. By default, the format is: ```[TYPE::NAME(uniqueId)]``` where by ```TYPE``` is the value assigned to the constructor, and ```NAME``` is the value assigned to the instance.\n\n#####```__super``` {function}\nAccessor function to access the parent implementation of a method. Should there be no parent method, then this method is an empty function.\n\n\n####Example\n\n```javascript\nvar Base = require('preceptor-core').Base;\n\n/**\n * @class Pet\n * @extends Base\n * @properties {string} _type Type of pet\n * @properties {string} _name Name of pet\n */\nvar Pet = Base.extend(\n\n    /**\n     * Constructor of Pet\n     *\n     * @constructor\n     * @param {string} type Type of pet\n     * @param {string} name Name of pet\n     */\n     function (type, name) {\n\n        // Call the parent constructor\n        this.__super();\n\n        // Save property on the current object\n        this._type = type;\n        this._name = name;\n\n        // Add instance descriptor\n        this.NAME = type + ':' + name;\n\n        // Define here all dynamic values, values that should not be shared between multiple instances of \"Pet\".\n    },\n\n    /** @lends Pet.prototype */\n    { // Properties assigned to the prototype of \"Pet\"\n\n        /**\n         * Make sound of pet\n         *\n         * @param {string} sound\n         * @method makeSound\n         */\n        makeSound: function (sound) {\n            this.emit('sound', this.getName(), sound);\n\n            console.log(this.getName() + \" says: \" + sound);\n        },\n\n        /**\n         * Gets the name of the pet\n         *\n         * @return {string}\n         */\n        getName: function () {\n            return this._name;\n        }\n\n        // ...\n        // Any other functions and values assigned to the prototype.\n\n        // These properties can be accessed after instantiation with ```petInstance.makeSound()```.\n\n        // You can also define here all values that should be available in instances of \"Pet\" that should be shared\n        // across all object instances.\n    },\n\n    /** @lends Pet */\n    { // Properties assigned to the constructor of \"Pet\"\n\n        /**\n         * @type {string}\n         */\n        TYPE: \"Pet\"\n\n        // ...\n        // Any other constructor functions and values.\n\n        // These properties can be accessed with ```Pet.TYPE```.\n    }\n);\n\n/**\n * @class Cat\n * @extends Pet\n */\nvar Cat = Pet.extend(\n\n    /**\n     * Constructor of Cat\n     *\n     * @constructor\n     * @param {string} name Name of pet\n     */\n    function (name) {\n        this.__super(\"cat\", name);\n    },\n\n    /** @lends Cat.prototype */\n    { // Properties assigned to the prototype of \"Cat\"\n        /**\n         * Make sound of cat\n         *\n         * @method makeSound\n         */\n        makeSound: function () {\n            this.__super(\"miau\");\n        }\n    },\n\n    /** @lends Cat */\n    { // Properties assigned to the constructor of \"Cat\"\n        /**\n         * @type {string}\n         */\n        TYPE: \"Cat\"\n    }\n);\n\n/**\n * @class Dog\n * @extends Pet\n */\nvar Dog = Pet.extend(\n\n    /**\n     * Constructor of Dog\n     *\n     * @constructor\n     * @param {string} name Name of pet\n     */\n        function (name) {\n        this.__super(\"dog\", name);\n    },\n\n    /** @lends Dog.prototype */\n    { // Properties assigned to the prototype of \"Dog\"\n        /**\n         * Make sound of cat\n         *\n         * @method makeSound\n         */\n        makeSound: function () {\n            this.__super(\"barf\");\n        }\n    },\n\n    /** @lends Dog */\n    { // Properties assigned to the constructor of \"Dog\"\n        /**\n         * @type {string}\n         */\n        TYPE: \"Dog\"\n    }\n);\n\nvar tomTheCat = new Cat(\"Tom\");\nvar zeusTheDog = new Dog(\"Zeus\");\n\n// Listen to events\ntomTheCat.on('sound', function (name, sound) {\n    console.log(\"The cat said \" + sound);\n});\nzeusTheDog.on('sound', function (name, sound) {\n    console.log(\"The dog said \" + sound);\n});\n\n// Make sounds\ntomTheCat.makeSound();\nzeusTheDog.makeSound();\n\n// Print instance identifier\nconsole.log(\"Cat object: \" + Cat.toString());\nconsole.log(\"Cat instance\", tomTheCat.toString());\n\nconsole.log(\"Dog object: \" + Dog.toString());\nconsole.log(\"Dog instance\", zeusTheDog.toString());\n```\n\n*Output:*\n```shell\nThe cat said miau\nTom says: miau\nThe dog said barf\nZeus says: barf\nCat object: [Cat]\nCat instance [Cat::cat:Tom(instance1)]\nDog object: [Dog]\nDog instance [Dog::dog:Zeus(instance2)]\n```\n\n---\n\n##utils\n\nUtils exposes the following utility functions:\n\n###extendApply\nThis extend-function works like any other extend function, except it calls a function on each value and uses the result as value of a property.\n\nParameters:\n* ```obj``` {object} - Destination object to merge values into\n* ```objects``` {object[]} - Array of objects that should be copied into the ```obj```.\n* ```fn``` {function} - Function that returns a value that should be used in place of the original value. Every property in the objects of the ```objects``` parameter will call this function. This parameter is optional. Should no function be supplied, then the values will be used as-is.\n\nApply-Function Parameters:\n* ```srcValue``` {*} - The original value of a property that should be copied to the ```obj```.\n* ```dstValue``` {*} - Current value on the ```obj``` object.\n* ```options``` {object} - Additional options\n* ```options.key``` {string} - Name of the property that should be copied.\n* ```options.currentObject``` {object} _ The object currently processed from the ```objects``` list.\n* ```options.objectIndex``` {int} - The index of ```currentObject``` in the ```objects``` list.\n* ```options.valueIndex``` {int} - The index of the current property in ```currentObject```.\n\n####Example - Simple extend\n```javascript\nvar utils = require('../../').utils;\nvar result;\n\nvar obj1 = {\n    \"name\": \"obj1\",\n    \"entry1\": 23,\n    \"entry2\": 46\n};\n\nvar obj2 = {\n    \"name\": \"obj2\",\n    \"entry2\": 78,\n    \"entry3\": 2\n};\n\nvar srcObj = {\n    \"entry0\": 0\n};\n\n\nconsole.log(\"Simple extend:\");\nutils.extendApply(srcObj, [obj1, obj2]);\nconsole.log(srcObj);\n```\n\nOutput:\n```shell\nSimple extend:\n{ entry0: 0, name: 'obj2', entry1: 23, entry2: 78, entry3: 2 }\n```\n\n####Example - Extend with apply function\n```javascript\nconsole.log(\"Extend with function:\");\nresult = utils.extendApply({}, [obj1, obj2], function (value) {\n    return value + 1;\n});\nconsole.log(result);\n```\n\nOutput:\n```shell\nExtend with function:\n{ name: 'obj21', entry1: 24, entry2: 79, entry3: 3 }\n```\n\n####Example - Logging extend apply calls\n```javascript\nconsole.log(\"Extend logging:\");\nresult = utils.extendApply({}, [obj1, obj2], function (srcValue, dstValue, options) {\n\n    console.log(\"The value '\" + srcValue + \"' with key '\" + options.key + \"' from object with name '\" +\n        options.currentObject.name +  \"' was '\" + dstValue + \"' in the original object\");\n\n    return options.objectIndex + ':' + options.valueIndex;\n});\nconsole.log(result);\n```\n\nOutput:\n```shell\nExtend logging:\nThe value 'obj1' with key 'name' from object with name 'obj1' was 'undefined' in the original object\nThe value '23' with key 'entry1' from object with name 'obj1' was 'undefined' in the original object\nThe value '46' with key 'entry2' from object with name 'obj1' was 'undefined' in the original object\nThe value 'obj2' with key 'name' from object with name 'obj2' was '0:0' in the original object\nThe value '78' with key 'entry2' from object with name 'obj2' was '0:2' in the original object\nThe value '2' with key 'entry3' from object with name 'obj2' was 'undefined' in the original object\n{ name: '1:0', entry1: '0:1', entry2: '1:1', entry3: '1:2' }\n```\n___\n###deepExtend\nExtends an object with properties that will be recursively copied.\n\nParameters:\n* ```obj``` {object} - Destination object to merge values into\n* ```objects``` {object[]} - Array of objects that should be copied into the ```obj```.\n* ```options``` {object} - Additional options.\n* ```options.replace``` {boolean} - If set, then array entries in destination will be replaced instead of values appended to the destination list.\n\n####Example: Simple usage\n```javascript\nvar utils = require('preceptor-core').utils;\n\nvar obj1 = {\n    \"entry1\": [1, 2, 3],\n    \"entry2\": [5, 6],\n    \"entry4\": 23,\n    \"entry5\": {\n        \"entry6\": 22,\n        \"entry7\": 24,\n        \"entry8\": {\n            \"entry9\": 9\n        }\n    }\n};\n\nvar obj2 = {\n    \"entry2\": [8, 9],\n    \"entry3\": 2,\n    \"entry5\": {\n        \"entry7\": 21,\n        \"entry10\": 11\n    }\n};\n\nvar srcObj = {\n    \"entry0\": 0,\n    \"entry2\": [7],\n    \"entry5\": {\n        \"entry0\": \"zero\"\n    }\n};\n\nutils.deepExtend(srcObj, [obj1, obj2]);\nconsole.log(srcObj);\n```\n\nOutput:\n```shell\n{ entry0: 0,\n  entry2: [ 7, 5, 6, 8, 9 ],\n  entry5:\n   { entry0: 'zero',\n     entry6: 22,\n     entry7: 21,\n     entry8: { entry9: 9 },\n     entry10: 11 },\n  entry1: [ 1, 2, 3 ],\n  entry4: 23,\n  entry3: 2 }\n```\n\n####Example: Use with replace\n```javascript\nvar utils = require('preceptor-core').utils;\nvar result;\n\nresult = utils.deepExtend({}, [obj1, obj2], { replace: true });\nconsole.log(result);\n```\n\nOutput:\n```shell\n{ entry1: [ 1, 2, 3 ],\n    entry2: [ 8, 9 ],\n    entry4: 23,\n    entry5: { entry6: 22, entry7: 21, entry8: { entry9: 9 }, entry10: 11 },\n    entry3: 2 }\n```\n___\n###combine\nCombines multiple strings by applying a glue-string between them if they are not already available there. This is very similar to the ```path.join``` method, but it doesn't care what the structure of the rest or the string is.\n\nThis method is used with the ```extendApply``` function to give object methods the possibility to call the parent method with ```__super()```.\n\nParameters:\n* ```glue``` {string} - Glue string\n* ```str, ...``` {string} - Strings that should be glued.\n\n####Example: Simple usage\n```javascript\nvar utils = require('preceptor-core').utils;\n\nconsole.log(utils.combine('-', '', '', ''));\n// Output: -\n\nconsole.log(utils.combine('-', 'test1', 'test2'));\n// Output: test1-test2\n\nconsole.log(utils.combine('-', '-test1-', '-test2-'));\n// Output: -test1-test2-\n\nconsole.log(utils.combine('-', 'test1-', 'test2'));\n// Output: test1-test2\n\nconsole.log(utils.combine('-', 'test1', '-test2'));\n// Output: test1-test2\n```\n___\n\n###superWrapper\nFunction that creates a new function that sets the ```__super``` property up to be called from within a function body.\n\nParameters:\n* ```currentItem``` {*} - Value that should be used\n* ```previousItem``` {*} - Previous item value\n\n####Example: Simple usage\n```javascript\nvar utils = require('preceptor-core').utils;\n\nvar newFn = utils.superWrapper(function (value) {\n    this.__super(123, value);\n    console.log(\"Method test in object 2 and value \" + value);\n}, function (value1, value2) {\n    console.log(\"Method test in object 1 and values \" + value1 + \" and \" + value2);\n});\nnewFn(88);\n```\n\nOutput:\n```shell\nMethod test in object 1 and values 123 and 88\nMethod test in object 2 and value 88\n```\n\n####Example: Usage with extendApply\n```javascript\nvar utils = require('preceptor-core').utils;\n\nvar obj1 = {\n    test: function (value1, value2) {\n        console.log(\"Method test in object 1 and values \" + value1 + \" and \" + value2);\n    }\n};\n\nvar obj2 = {\n    test: function (value) {\n        this.__super(123, value);\n        console.log(\"Method test in object 2 and value \" + value);\n    }\n};\n\nvar result = utils.extendApply(obj1, [obj2], utils.superWrapper);\nresult.test(88);\n```\n\nOutput:\n```shell\nMethod test in object 1 and values 123 and 88\nMethod test in object 2 and value 88\n```\n___\n###require\nThis function does the same thing as the original require function to load modules. However, this function will give you the option to use default values when the module cannot be found.\n\nParameters:\n* ```module``` {string} - Module name or path\n* ```defaultValue``` {*} - Default value if the module cannot be found\n\n####Example: Simple usage\n```javascript\nvar utils = require('preceptor-core').utils;\n\nvar configuration = utils.require('config', {});\n```\n\n---\n\n##log\n\nThe ```log``` object exposes a centralize logging interface including buffering for deferred logging.\n\nThis object works with two different type of objects:\n* ```log``` - The singleton managing multiple loggers\n* ```logger``` - Instance for a specific logger\n\nA new logger can be created by calling the ```getLogger``` method on the ```log``` object:\n```javascript\nvar logger = log.getLogger(__filename);\n```\nFor each logger, a filename/identifier can be supplied that will be exported with each log trigger.\n\nWhen having a logger, then log entries can be triggered, including objects:\n```javascript\nlogger.debug('Debug message: ', { message: 'something something' });\n```\n\nThere are a couple of log-types available:\n* ```logger.trace``` - Trace log entries that could give much more detail on steps through the code\n* ```logger.debug``` - Debug values that might be helpful for debugging problems without being too overwhelming like ```logger.trace```\n* ```logger.info``` - Info messages that is probably helpful for a user to understand what decisions were made\n* ```logger.warn``` - Warning message for missing configuration or other behavior that might be unexpected to the user\n* ```logger.error``` - Errors during execution\n\nThese log-types may be filtered depending on the log-level set. The log-levels can be requested and set with the following values:\n```javascript\nlog.setLevel('DEBUG');\n\nlog.getLevel() // -> DEBUG\n```\nThe default value is ```INFO```.\n\nFollowing log-levels are available:\n* ```ALL``` - All log-types are used which is an alias for ```TRACE```.\n* ```TRACE``` - Trace messages and all messages with the log-type below will be used.\n* ```DEBUG``` - Trace messages will be filtered\n* ```INFO``` - Trace and Debug messages will be filtered\n* ```WARN``` - Info and above messages will be filtered\n* ```ERROR``` - Only error messages will be used\n\nAll loggers are by default centralized buffered to defer log-messages until it is known what level of output the user wants.\nThat means that the non-buffering mode needs to be activated. This can be done by calling only once:\n```javascript\nlog.flush();\n```\n\n---\n\n##API-Documentation\n\nGenerate the documentation with following command:\n```shell\nnpm run docs\n```\nThe documentation will be generated in the ```docs``` folder of the module root.\n\n##Tests\n\nRun the tests with the following command:\n```shell\nnpm run test\n```\nThe code-coverage will be written to the ```coverage``` folder in the module root.\n\n##Third-party libraries\n\nThe following third-party libraries are used by this module:\n\n###Dependencies\n* underscore: http://underscorejs.org\n* log4js: https://github.com/stritti/log4js\n\n###Dev-Dependencies\n* chai: http://chaijs.com\n* codeclimate-test-reporter: https://github.com/codeclimate/javascript-test-reporter\n* coveralls: https://github.com/cainus/node-coveralls\n* istanbul: https://github.com/gotwarlost/istanbul\n* mocha: https://github.com/visionmedia/mocha\n* sinon: http://sinonjs.org\n* sinon-chai: https://github.com/domenic/sinon-chai\n* yuidocjs: https://github.com/yui/yuidoc\n\n##License\n\nThe MIT License\n\nCopyright 2014-2015 Yahoo Inc.\n","maintainers":[{"name":"davglass","email":"davglass@gmail.com"},{"name":"marcelerz","email":"marcel.erz@gmail.com"}],"time":{"modified":"2022-06-24T13:44:46.483Z","created":"2014-11-04T05:49:30.185Z","0.9.0":"2014-11-04T05:49:30.185Z","0.9.1":"2014-11-27T09:18:31.496Z","0.9.2":"2014-12-01T23:08:13.886Z","0.9.3":"2014-12-02T18:41:59.710Z","0.9.4":"2015-02-18T09:39:38.151Z","0.9.5":"2015-02-19T08:56:26.833Z","0.9.6":"2015-02-22T09:12:51.692Z","0.10.0":"2015-03-02T04:31:17.970Z","0.10.1":"2018-02-14T23:38:22.886Z"},"homepage":"https://github.com/yahoo/preceptor-core","keywords":["testing"],"repository":{"type":"git","url":"git+https://github.com/yahoo/preceptor-core.git"},"author":{"name":"Marcel Erz","email":"erz@yahoo-inc.com","url":"http://www.marcelerz.com"},"bugs":{"url":"https://github.com/yahoo/preceptor-core/issues"},"license":"MIT","readmeFilename":"README.md"}