class-wrapper
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -17,7 +17,7 @@ (function (root, factory) { | ||
// class-wrapper v1.1.2 | ||
// Set of wrappers for easier definition of different kinds of classes | ||
// v1.1.1 | ||
// Copyright (c) 2016-2017 Valerii Zinchenko | ||
// Copyright (c) 2016-2018 Valerii Zinchenko | ||
// Licensed under MIT (https://github.com/valerii-zinchenko/class-wrapper/blob/master/LICENSE.txt) | ||
// All source files are available at: http://github.com/[object Object] | ||
// All source files are available at: http://github.com/class-wrapper | ||
/* | ||
@@ -24,0 +24,0 @@ Copyright (c) 2016-2018 Valerii Zinchenko |
@@ -0,7 +1,7 @@ | ||
// class-wrapper v1.1.2 | ||
// Set of wrappers for easier definition of different kinds of classes | ||
// v1.1.1 | ||
// Copyright (c) 2016-2017 Valerii Zinchenko | ||
// Copyright (c) 2016-2018 Valerii Zinchenko | ||
// Licensed under MIT (https://github.com/valerii-zinchenko/class-wrapper/blob/master/LICENSE.txt) | ||
// All source files are available at: http://github.com/[object Object] | ||
// All source files are available at: http://github.com/class-wrapper | ||
!function(a,b){"function"==typeof define&&define.amd?define([],function(){return a.ClassWrapper=b()}):"object"==typeof module&&module.exports?module.exports=b():a["class-wrapper"]=b()}(this,function(){"use strict";function ClassBuilder(InstanceBuilder,Parent,Constructor,props){if(props=arguments[arguments.length-1],Constructor=arguments[arguments.length-2],3===arguments.length&&(Parent=Object),arguments.length<3||"function"!=typeof InstanceBuilder||"[object Function]"!==Object.prototype.toString.call(Parent)||null!==Constructor&&"function"!=typeof Constructor||"[object Object]"!==Object.prototype.toString.call(props))throw new Error("Incorrect input arguments. It should be: ClassBuilder(Function, [Function], Function | null, Object)");var className="";"string"==typeof props.__name&&props.__name&&(className=props.__name),delete props.__name;var encapsulations=[];if(props.Encapsulate&&("[object Array]"===Object.prototype.toString.call(props.Encapsulate)?encapsulations=encapsulations.concat(props.Encapsulate):encapsulations.push(props.Encapsulate),delete props.Encapsulate),Parent.prototype.__defaults&&encapsulations.unshift(Parent.prototype.__defaults),encapsulations.push(props),encapsulations.some(function(a){var b=Object.prototype.toString.call(a);return"[object Function]"!==b&&"[object Object]"!==b}))throw new Error("Some of the items for encapsulation is incorrect. An item can be: Object, Function, Class");var Class,declaration=className?"var "+className+"; Class = "+className+" = ":"Class = ";eval(declaration+InstanceBuilder.toString()),Class.prototype=Object.create(Parent.prototype),Class.prototype.constructor=Class,Constructor&&(Class.prototype.__constructor=Constructor),Class.prototype.__defaults={},Class.__parent=Parent.prototype;for(var n=0,N=encapsulations.length;n<N;n++)ClassBuilder.encapsulate(encapsulations[n],Class);return Class}function ParentConstructorFirst(){utils.deepExtend(this,this.constructor.prototype.__defaults),function a(b,c,d){var e=c.constructor.__parent;e&&a(b,e,d),c.hasOwnProperty("__constructor")&&c.__constructor.apply(b,d)}(this,this.constructor.__parent,arguments),this.constructor.prototype.hasOwnProperty("__constructor")&&this.constructor.prototype.__constructor.apply(this,arguments)}var utils={deepCopy:function(a,b){var c,d;for(c in b)switch(d=b[c],Object.prototype.toString.call(d)){case"[object Object]":a[c]||(a[c]={}),utils.deepCopy(a[c],d);break;default:a[c]=d}return a},deepExtend:function(a,b){var c,d;for(c in b)if(d=b[c],a.hasOwnProperty(c))"object"==typeof a[c]&&utils.deepExtend(a[c],d);else switch(Object.prototype.toString.call(d)){case"[object Object]":a[c]={},utils.deepExtend(a[c],d);break;case"[object Array]":a[c]=d.map(function(a){return a});break;default:a[c]=d}return a}};ClassBuilder.encapsulate=function(a,b){"[object Function]"===Object.prototype.toString.call(a)&&(a=a.prototype);for(var c in a)if(a.hasOwnProperty(c)&&"constructor"!==c&&"__constructor"!==c&&"__parent"!==c){var d=a[c];switch(Object.prototype.toString.call(d)){case"[object Function]":b.prototype[c]=d;break;case"[object Object]":"__defaults"===c?utils.deepCopy(b.prototype.__defaults,d):(b.prototype.__defaults[c]||(b.prototype.__defaults[c]={}),utils.deepCopy(b.prototype.__defaults[c],d));break;default:b.prototype.__defaults[c]=d}}};var Class=ClassBuilder.bind(null,function(){ParentConstructorFirst.apply(this,arguments)}),SingletonClass=ClassBuilder.bind(null,function(){if(this.constructor.instance)return this.constructor.instance;this.constructor.instance=this,ParentConstructorFirst.apply(this,arguments)}),ClassWrapper={utils:utils,ClassBuilder:ClassBuilder,Class:Class,SingletonClass:SingletonClass};return ClassWrapper}); |
module.exports = function(grunt) { | ||
require('load-grunt-tasks')(grunt); | ||
var banner = '// <%= pkg.description %>\n'+ | ||
'// v<%= pkg.version %>\n' + | ||
'// Copyright (c) 2016-2017 <%= pkg.author %>\n' + | ||
var banner = '' + | ||
'// <%= pkg.name %> v<%= pkg.version %>\n' + | ||
'// <%= pkg.description %>\n' + | ||
'// Copyright (c) 2016-<%= new Date().getUTCFullYear() %> <%= pkg.author %>\n' + | ||
'// Licensed under MIT (https://github.com/valerii-zinchenko/<%= pkg.name %>/blob/master/LICENSE.txt)\n' + | ||
'// All source files are available at: http://github.com/<%= pkg.repository %>\n'; | ||
'// All source files are available at: http://github.com/<%= pkg.name %>\n'; | ||
@@ -130,2 +131,5 @@ grunt.initConfig({ | ||
src: ['./lib/*.js'], | ||
options: { | ||
destination: 'doc/nightly' | ||
} | ||
} | ||
@@ -132,0 +136,0 @@ }, |
{ | ||
"name": "class-wrapper", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Set of wrappers for easier definition of different kinds of classes", | ||
@@ -5,0 +5,0 @@ "main": "dest/class-wrapper.js", |
@@ -49,3 +49,3 @@ # {class} | ||
}, { | ||
// abstract function for a calculating a suqare of a figure | ||
// abstract function for a calculating an area of a figure | ||
calcArea: function() {} | ||
@@ -99,4 +99,4 @@ }); | ||
* [wiki](https://github.com/valerii-zinchenko/class-wrapper/wiki) | ||
* [API](http://valerii-zinchenko.github.io/class-wrapper/doc/index.html) | ||
* [API](http://valerii-zinchenko.github.io/class-wrapper/doc/nightly/index.html) | ||
* [Code coverage](http://valerii-zinchenko.github.io/class-wrapper/coverage/index.html) | ||
* [Run unit tests](http://valerii-zinchenko.github.io/class-wrapper/test/index.html) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67699
18
1443