Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

classy

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

classy - npm Package Compare versions

Comparing version 1.4.6 to 1.4.8

.npmignore

483

dist/classy.js
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.classy=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict'
var HAS_OWN = Object.prototype.hasOwnProperty
var STR_OBJECT = 'object'
/**
* Copies all properties from source to destination
*
* copy({name: 'jon',age:5}, this);
* // => this will have the 'name' and 'age' properties set to 'jon' and 5 respectively
*
* @param {Object} source
* @param {Object} destination
*
* @return {Object} destination
*/
module.exports = function(source, destination){
destination = destination || {}
if (source != null && typeof source === STR_OBJECT ){
for (var i in source) if ( HAS_OWN.call(source, i) ) {
destination[i] = source[i]
}
}
return destination
}
},{}],2:[function(require,module,exports){
'use strict'
var HAS_OWN = Object.prototype.hasOwnProperty
var STR_OBJECT = 'object'
var STR_UNDEFINED = 'undefined'
/**
* Copies all properties from source to destination, if the property does not exist into the destination
*
* copyIf({name: 'jon',age:5}, {age:7})
* // => { name: 'jon', age: 7}
*
* @param {Object} source
* @param {Object} destination
*
* @return {Object} destination
*/
module.exports = function(source, destination){
destination = destination || {}
if (source != null && typeof source === STR_OBJECT){
for (var i in source) if ( HAS_OWN.call(source, i) && (typeof destination[i] === STR_UNDEFINED) ) {
destination[i] = source[i]
}
}
return destination
}
},{}],3:[function(require,module,exports){
'use strict'
var STR_UNDEFINED = 'undefined'
var STR_OBJECT = 'object'
var HAS_OWN = Object.prototype.hasOwnProperty
var copyList = require('./copyList')
/**
* Copies all properties named in the namedKeys, from source to destination
*
* copyKeys({name: 'jon',age:5, year: 2006, date: '2010/05/12'}, {}, {name:1 ,age: true, year: 'theYear'})
* // => {name: 'jon', age: 5, theYear: 2006}
*
* @param {Object} source
* @param {Object} destination
* @param {Object} namedKeys an object with keys denoting the properties to be copied
*
* @return {Object} destination
*/
module.exports = function(source, destination, namedKeys){
if (arguments.length < 3 ){
namedKeys = destination
destination = null
}
destination = destination || {}
if (!namedKeys || Array.isArray(namedKeys)){
return copyList(source, destination, namedKeys)
}
if (
source != null && typeof source === STR_OBJECT &&
namedKeys != null && typeof namedKeys === STR_OBJECT
) {
var typeOfNamedProperty
var namedPropertyValue
for (var propName in namedKeys) if ( HAS_OWN.call(namedKeys, propName) ) {
namedPropertyValue = namedKeys[propName]
typeOfNamedProperty = typeof namedPropertyValue
if (typeof source[propName] !== STR_UNDEFINED){
destination[typeOfNamedProperty == 'string'? namedPropertyValue : propName] = source[propName]
}
}
}
return destination
}
},{"./copyList":5}],4:[function(require,module,exports){
'use strict'
var STR_UNDEFINED = 'undefined'
var STR_OBJECT = 'object'
var HAS_OWN = Object.prototype.hasOwnProperty
var copyListIf = require('./copyListIf')
/**
* Copies all properties named in the namedKeys, from source to destination,
* but only if the property does not already exist in the destination object
*
* copyKeysIf({name: 'jon',age:5, year: 2006}, {aname: 'test'}, {name:'aname' ,age: true})
* // => {aname: 'test', age: 5}
*
* @param {Object} source
* @param {Object} destination
* @param {Object} namedKeys an object with keys denoting the properties to be copied
*
* @return {Object} destination
*/
module.exports = function(source, destination, namedKeys){
if (arguments.length < 3 ){
namedKeys = destination
destination = null
}
destination = destination || {}
if (!namedKeys || Array.isArray(namedKeys)){
return copyListIf(source, destination, namedKeys)
}
if (
source != null && typeof source === STR_OBJECT &&
namedKeys != null && typeof namedKeys === STR_OBJECT
) {
var typeOfNamedProperty
var namedPropertyValue
var newPropertyName
for (var propName in namedKeys) if ( HAS_OWN.call(namedKeys, propName) ) {
namedPropertyValue = namedKeys[propName]
typeOfNamedProperty = typeof namedPropertyValue
newPropertyName = typeOfNamedProperty == 'string'? namedPropertyValue : propName
if (
typeof source[propName] !== STR_UNDEFINED &&
typeof destination[newPropertyName] === STR_UNDEFINED
) {
destination[newPropertyName] = source[propName]
}
}
}
return destination
}
},{"./copyListIf":6}],5:[function(require,module,exports){
'use strict'
var STR_UNDEFINED = 'undefined'
/**
* Copies all properties named in the list, from source to destination
*
* copyList({name: 'jon',age:5, year: 2006}, {}, ['name','age'])
* // => {name: 'jon', age: 5}
*
* @param {Object} source
* @param {Object} destination
* @param {Array} list the array with the names of the properties to copy
*
* @return {Object} destination
*/
module.exports = function(source, destination, list){
if (arguments.length < 3){
list = destination
destination = null
}
destination = destination || {}
list = list || Object.keys(source)
var i = 0
var len = list.length
var propName
for ( ; i < len; i++ ){
propName = list[i]
if ( typeof source[propName] !== STR_UNDEFINED ) {
destination[list[i]] = source[list[i]]
}
}
return destination
}
},{}],6:[function(require,module,exports){
'use strict'
var STR_UNDEFINED = 'undefined'
/**
* Copies all properties named in the list, from source to destination, if the property does not exist into the destination
*
* copyListIf({name: 'jon',age:5, year: 2006}, {age: 10}, ['name','age'])
* // => {name: 'jon', age: 10}
*
* @param {Object} source
* @param {Object} destination
* @param {Array} list the array with the names of the properties to copy
*
* @return {Object} destination
*/
module.exports = function(source, destination, list){
if (arguments.length < 3){
list = destination
destination = null
}
destination = destination || {}
list = list || Object.keys(source)
var i = 0
var len = list.length
var propName
for ( ; i < len ; i++ ){
propName = list[i]
if (
(typeof source[propName] !== STR_UNDEFINED) &&
(typeof destination[propName] === STR_UNDEFINED)
){
destination[propName] = source[propName]
}
}
return destination
}
},{}],7:[function(require,module,exports){
module.exports = function(){

@@ -23,17 +281,4 @@

*/
copy: function(source, destination){
copy: require('./copy'),
destination = destination || {}
if (source != null && typeof source === STR_OBJECT ){
for (var i in source) if ( HAS_OWN.call(source, i) ) {
destination[i] = source[i]
}
}
return destination
},
/**

@@ -50,17 +295,4 @@ * Copies all properties from source to destination, if the property does not exist into the destination

*/
copyIf: function(source, destination){
destination = destination || {}
copyIf: require('./copyIf'),
if (source != null && typeof source === STR_OBJECT){
for (var i in source) if ( HAS_OWN.call(source, i) && (typeof destination[i] === STR_UNDEFINED) ) {
destination[i] = source[i]
}
}
return destination
},
/**

@@ -106,26 +338,4 @@ * Copies all properties from source to a new object, with the given value. This object is returned

*/
copyList: function(source, destination, list){
if (arguments.length == 2){
list = destination
destination = null
}
copyList: require('./copyList'),
destination = destination || {}
list = list || []
var i = 0,
len = list.length,
propName
for( ; i < len; i++ ){
propName = list[i]
if ( typeof source[propName] !== STR_UNDEFINED ) {
destination[list[i]] = source[list[i]]
}
}
return destination
},
/**

@@ -143,28 +353,4 @@ * Copies all properties named in the list, from source to destination, if the property does not exist into the destination

*/
copyListIf: function(source, destination, list){
if (arguments.length == 2){
list = destination
destination = null
}
copyListIf: require('./copyListIf'),
destination = destination || {}
list = list || []
var propName,
i = 0,
len = list.length
for(; i<len ; i++){
propName = list[i]
if (
(typeof source[propName] !== STR_UNDEFINED) &&
(typeof destination[propName] === STR_UNDEFINED)
){
destination[propName] = source[propName]
}
}
return destination
},
/**

@@ -182,30 +368,4 @@ * Copies all properties named in the namedKeys, from source to destination

*/
copyKeys: function(source, destination, namedKeys){
if (arguments.length == 2){
namedKeys = destination
destination = null
}
copyKeys: require('./copyKeys'),
destination = destination || {}
if (
source != null && typeof source === STR_OBJECT &&
namedKeys != null && typeof namedKeys === STR_OBJECT
) {
var typeOfNamedProperty,
namedPropertyValue
for (var propName in namedKeys) if ( HAS_OWN.call(namedKeys, propName) ) {
namedPropertyValue = namedKeys[propName]
typeOfNamedProperty = typeof namedPropertyValue
if (typeof source[propName] !== STR_UNDEFINED){
destination[typeOfNamedProperty == 'string'? namedPropertyValue : propName] = source[propName]
}
}
}
return destination
},
/**

@@ -224,38 +384,4 @@ * Copies all properties named in the namedKeys, from source to destination,

*/
copyKeysIf: function(source, destination, namedKeys){
if (arguments.length == 2){
namedKeys = destination
destination = null
}
copyKeysIf: require('./copyKeysIf'),
destination = destination || {}
if (
source != null && typeof source === STR_OBJECT &&
namedKeys != null && typeof namedKeys === STR_OBJECT
) {
var typeOfNamedProperty,
namedPropertyValue,
newPropertyName
for (var propName in namedKeys) if ( HAS_OWN.call(namedKeys, propName) ) {
namedPropertyValue = namedKeys[propName]
typeOfNamedProperty = typeof namedPropertyValue
newPropertyName = typeOfNamedProperty == 'string'? namedPropertyValue : propName
if (
typeof source[propName] !== STR_UNDEFINED &&
typeof destination[newPropertyName] === STR_UNDEFINED
) {
destination[newPropertyName] = source[propName]
}
}
}
return destination
},
copyExceptKeys: function(source, destination, exceptKeys){

@@ -336,3 +462,3 @@ destination = destination || {}

}()
},{}],2:[function(require,module,exports){
},{"./copy":1,"./copyIf":2,"./copyKeys":3,"./copyKeysIf":4,"./copyList":5,"./copyListIf":6}],8:[function(require,module,exports){
module.exports = function(){

@@ -366,3 +492,3 @@

}()
},{}],3:[function(require,module,exports){
},{}],9:[function(require,module,exports){
var getInstantiatorFunction = require('./getInstantiatorFunction')

@@ -373,3 +499,3 @@

}
},{"./getInstantiatorFunction":2}],4:[function(require,module,exports){
},{"./getInstantiatorFunction":8}],10:[function(require,module,exports){
/*

@@ -452,5 +578,5 @@

})
},{"./core":12,"./define":15,"./utils/copy":30}],5:[function(require,module,exports){
},{"./core":18,"./define":21,"./utils/copy":36}],11:[function(require,module,exports){
module.exports = {}
},{}],6:[function(require,module,exports){
},{}],12:[function(require,module,exports){
'use strict'

@@ -471,5 +597,8 @@

var superClass = Class.$superClass
var superTarget = config.proto?
superClass.prototype:
superClass
var superTarget = superClass?
config.proto?
superClass.prototype:
superClass
:
undefined

@@ -535,3 +664,3 @@ var own = config.own

module.exports = assignClassProperty
},{"../utils/copy":30,"./canDefineProperty":8,"./canGetOwnPropertyDescriptor":9,"./modifyFn":13}],7:[function(require,module,exports){
},{"../utils/copy":36,"./canDefineProperty":14,"./canGetOwnPropertyDescriptor":15,"./modifyFn":19}],13:[function(require,module,exports){
module.exports = function(){

@@ -684,3 +813,3 @@

}()
},{}],8:[function(require,module,exports){
},{}],14:[function(require,module,exports){
'use strict'

@@ -702,3 +831,3 @@

})()
},{}],9:[function(require,module,exports){
},{}],15:[function(require,module,exports){
'use strict'

@@ -709,3 +838,3 @@

})()
},{}],10:[function(require,module,exports){
},{}],16:[function(require,module,exports){
'use strict'

@@ -729,3 +858,3 @@

module.exports = canGetOwnPropertyDescriptor? copy: function(){}
},{"./canGetOwnPropertyDescriptor":9}],11:[function(require,module,exports){
},{"./canGetOwnPropertyDescriptor":15}],17:[function(require,module,exports){
module.exports = function(){

@@ -756,3 +885,3 @@

}()
},{}],12:[function(require,module,exports){
},{}],18:[function(require,module,exports){
module.exports = function(){

@@ -944,4 +1073,4 @@

var statics = config.statics || {},
$own = statics.$own
var statics = config.statics || {}
var $own = statics.$own

@@ -955,3 +1084,3 @@ statics.$own = null

copyClassConfig( Class, config, null, Class.$initialConfig)
copyClassConfig( Class, config, null, Class.$initialConfig)

@@ -963,3 +1092,6 @@ copyClassConfig( Class, statics, { proto: false })

}
}
function overrideObject(targetObject, config){
copyClassConfig( targetObject, config, { proto: false })
}

@@ -972,2 +1104,3 @@

overrideClass : overrideClass,
overrideObject : overrideObject,

@@ -978,3 +1111,3 @@ copyClassConfig : copyClassConfig,

}()
},{"../utils/copy":30,"./assignClassProperty":6,"./canDefineProperty":8,"./canGetOwnPropertyDescriptor":9,"./copyDescriptors":10,"./extend":11,"newify":3}],13:[function(require,module,exports){
},{"../utils/copy":36,"./assignClassProperty":12,"./canDefineProperty":14,"./canGetOwnPropertyDescriptor":15,"./copyDescriptors":16,"./extend":17,"newify":9}],19:[function(require,module,exports){
var callSuperRe = /\bcallSuper|callSuperWith\b/

@@ -1007,3 +1140,3 @@ var callOverridenRe = /\bcallOverriden|callOverridenWith\b/

module.exports = modify
},{"./buildClassFunctions":7}],14:[function(require,module,exports){
},{"./buildClassFunctions":13}],20:[function(require,module,exports){
var SLICE = Array.prototype.slice

@@ -1041,3 +1174,3 @@

}
},{"./getClass":19,"newify":3}],15:[function(require,module,exports){
},{"./getClass":25,"newify":9}],21:[function(require,module,exports){
var getClass = require('./getClass')

@@ -1098,3 +1231,3 @@ var processClass = require('./processClass')

}
},{"./Registry":5,"./core":12,"./getClass":19,"./processClass":26,"./processors/ClassProcessor":27}],16:[function(require,module,exports){
},{"./Registry":11,"./core":18,"./getClass":25,"./processClass":32,"./processors/ClassProcessor":33}],22:[function(require,module,exports){
var define = require('./define')

@@ -1109,3 +1242,3 @@ var copyIf = require('./utils/copy').copyIf

}
},{"./define":15,"./utils/copy":30}],17:[function(require,module,exports){
},{"./define":21,"./utils/copy":36}],23:[function(require,module,exports){
/**

@@ -1134,3 +1267,3 @@ * @method destroyClass

}
},{"./core":12,"./getClass":19}],18:[function(require,module,exports){
},{"./core":18,"./getClass":25}],24:[function(require,module,exports){

@@ -1150,3 +1283,3 @@ module.exports = function(config){

}
},{"./define":15}],19:[function(require,module,exports){
},{"./define":21}],25:[function(require,module,exports){
/**

@@ -1179,3 +1312,3 @@ * @method getClass

}
},{"./Registry":5,"./core":12}],20:[function(require,module,exports){
},{"./Registry":11,"./core":18}],26:[function(require,module,exports){
var BaseClass = require('./core').BaseClass

@@ -1224,3 +1357,3 @@ var getClass = require('./getClass')

}
},{"./core":12,"./getClass":19}],21:[function(require,module,exports){
},{"./core":18,"./getClass":25}],27:[function(require,module,exports){
var BaseClass = require('./core').BaseClass

@@ -1251,3 +1384,3 @@ var getClass = require('./getClass')

}
},{"./core":12,"./getClass":19}],22:[function(require,module,exports){
},{"./core":18,"./getClass":25}],28:[function(require,module,exports){
/*

@@ -1310,3 +1443,3 @@

}()
},{"./Mixin":4,"./Registry":5,"./core":12,"./create":14,"./define":15,"./defineMixin":16,"./destroyClass":17,"./getClass":19,"./getInstance":20,"./getParentClass":21,"./isSubclassOf":23,"./override":24,"./processors/MixinProcessor":28,"./utils/copy":30}],23:[function(require,module,exports){
},{"./Mixin":10,"./Registry":11,"./core":18,"./create":20,"./define":21,"./defineMixin":22,"./destroyClass":23,"./getClass":25,"./getInstance":26,"./getParentClass":27,"./isSubclassOf":29,"./override":30,"./processors/MixinProcessor":34,"./utils/copy":36}],29:[function(require,module,exports){
var getClass = require('./getClass')

@@ -1335,3 +1468,3 @@

}
},{"./getClass":19}],24:[function(require,module,exports){
},{"./getClass":25}],30:[function(require,module,exports){
var getClass = require('./getClass')

@@ -1367,3 +1500,3 @@

}
},{"./getClass":19}],25:[function(require,module,exports){
},{"./getClass":25}],31:[function(require,module,exports){
module.exports = function(config){

@@ -1376,3 +1509,3 @@

}
},{"./core":12}],26:[function(require,module,exports){
},{"./core":18}],32:[function(require,module,exports){
var copyKeys = require('./utils/copy').copyKeys

@@ -1418,3 +1551,3 @@

}
},{"./extendClass":18,"./overrideClass":25,"./processors/ClassProcessor":27,"./unregisterClass":29,"./utils/copy":30}],27:[function(require,module,exports){
},{"./extendClass":24,"./overrideClass":31,"./processors/ClassProcessor":33,"./unregisterClass":35,"./utils/copy":36}],33:[function(require,module,exports){
/*

@@ -1460,3 +1593,3 @@

}()
},{"./MixinProcessor":28}],28:[function(require,module,exports){
},{"./MixinProcessor":34}],34:[function(require,module,exports){
/*

@@ -1848,3 +1981,3 @@

}()
},{"../core":12,"../getClass":19,"../utils/copy":30,"../utils/function":31}],29:[function(require,module,exports){
},{"../core":18,"../getClass":25,"../utils/copy":36,"../utils/function":37}],35:[function(require,module,exports){
var REGISTRY = require('./Registry')

@@ -1863,3 +1996,3 @@

}
},{"./Registry":5}],30:[function(require,module,exports){
},{"./Registry":11}],36:[function(require,module,exports){
/*

@@ -1876,3 +2009,3 @@

module.exports = require('copy-utils')
},{"copy-utils":1}],31:[function(require,module,exports){
},{"copy-utils":7}],37:[function(require,module,exports){
module.exports = function(){

@@ -1934,3 +2067,3 @@

}()
},{}]},{},[22])(22)
},{}]},{},[28])(28)
});
{
"name": "classy",
"version": "1.4.6",
"version": "1.4.8",
"scripts": {
"build": "browserify src/index.js -s classy -o dist/classy.js",
"build": "browserify src/index.js -s classy o-np dist/classy.js",
"watch": "watchify src/index.js -s classy -o dist/classy.js",

@@ -12,3 +12,3 @@ "dev": "npm run build | npm run watch",

"main": "src/index.js",
"description": "Classy - Classes for JavaScript\r ============================",
"description": "Classy - Classes for JavaScript",
"directories": {

@@ -47,5 +47,5 @@ "test": "test"

"dependencies": {
"newify": "~1.1.3",
"copy-utils": "~0.1.1"
"newify": "~1.1.9",
"copy-utils": "~1.0.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc