Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

es-class

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es-class - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+1
-1
build/es-class.js
/*! (C) Andrea Giammarchi - MIT Style License */
var Class=Class||function(e){"use strict";function x(e,t,n){for(var r,s=[],o=0;o<e.length;o++)r=O(e[o]),h.call(r,i)&&s.push(r[i]),N(r,t,n,!1,!1);return s}function T(e){A(e,!1)&&!h.call(this,e)&&v(this,e,m(this.init.prototype,e))}function N(e,t,n,r,i){for(var s,o=typeof e!="function",u=g(e),a=0;a<u.length;a++)s=u[a],(o||!w.test(s))&&A(s,i)&&(h.call(t,s)&&D("duplicated: "+s),M(n,t,s,m(e,s),r))}function C(e,t){var n=function(){};return e&&""+t!=""+n?function(){return t.apply(this,arguments)}:n}function k(e,t,n,r){var i=L(t,r);v(e,t,{enumerable:!1,configurable:i,writable:i,value:n})}function L(e,t){return t?!/^[A-Z_]+$/.test(e):!0}function A(e,f){return e!==t&&e!==n&&e!==r&&e!==s&&e!==o&&e!==u&&e!==a&&(f||e!==i)}function O(t){if(typeof t=="object")return t;t.length&&D((t.name||"Class")+" should not expect arguments");for(var n={init:t},r=t.prototype;r&&r!==e.prototype;r=b(r))g(r).forEach(T,n);return n}function M(e,t,n,r,i){var s=h.call(r,"value"),o,u;if(i){if(h.call(t,n))return}else s?(u=r.value,typeof u=="function"&&E.test(u)&&(r.value=P(e,n,u,i))):(H(e,n,r,"get"),H(e,n,r,"set"));o=L(n,i),r.enumerable=!1,r.configurable=o,s&&(r.writable=o),v(t,n,r)}function _(e,t){for(var n,r,i=0;i<e.length;i++){n=e[i];for(r in n)h.call(n,r)&&!h.call(t,r)&&D(r+" is not implemented")}}function D(e){try{console.warn(e)}catch(t){}}function P(e,t,n,r){return function(){h.call(this,u)||k(this,u,null,r);var i=this[u],s=this[u]=e[t],o=n.apply(this,arguments);return this[u]=i,o}}function H(e,t,n,r,i){h.call(n,r)&&E.test(n[r])&&(n[r]=P(m(e,t),r,n[r],i))}var t="constructor",n="extends",r="implements",i="init",s="prototype",o="static",u="super",a="with",f="__proto__",l=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],c=!{valueOf:0}[l[2]](l[5]),h=e[l[0]],p=e.create||function(e){var t=this instanceof p;return p[s]=t?d:e,t?this:new p},d=p[s],v=e.defineProperty,m=e.getOwnPropertyDescriptor||function(e,t){return{value:e[t]}},g=e.getOwnPropertyNames||function(e){var t=[],n,r;for(r in e)h.call(e,r)&&t.push(r);if(c)for(n=0;n<l.length;n++)r=l[n],h.call(e,r)&&t.push(r);return t},y=e.getPrototypeOf,b=y||function(e){return e[f]||null},w=new RegExp("^(?:"+g(function(){}).join("|")+")$"),E=/\bsuper\b/.test(function(){this["super"]()})?/\bsuper\b/:/.*/;try{v({},"{}",{})}catch(S){v=function(e,t,n){return e[t]=n.value,e}}return function(e){var i=h.call(e,t),u=h.call(e,n),l=u&&e[n],c=u&&typeof l=="function",d=c?l[s]:l,v=i?e[t]:C(c,l),m=u&&i&&E.test(v),g=u?p(d):v[s],b,w;return m&&(v=P(d,t,v,!1)),h.call(e,a)&&(b=x([].concat(e[a]),g,d),w=b.length,w&&(v=function(e){return function(){var t=0;while(t<w)b[t++].call(this);return e.apply(this,arguments)}}(v),v[s]=g)),h.call(e,o)&&N(e[o],v,d,!0,!0),u&&(l!==d&&N(l,v,d,!0,!0),v[s]=g),g[t]!==v&&k(g,t,v,!1),N(e,g,d,!1,!0),h.call(e,r)&&_([].concat(e[r]),g),u&&!y&&k(g,f,d,!1),v}}(Object);
var Class=Class||function(e){"use strict";function x(e,t,n){for(var r,s=[],o=0;o<e.length;o++)r=A(e[o]),h.call(r,i)&&s.push(r[i]),T(r,t,n,!1,!1);return s}function T(e,t,n,r,i){for(var s,o=typeof e!="function",u=g(e),a=0;a<u.length;a++)s=u[a],(o||!w.test(s))&&L(s,i)&&(h.call(t,s)&&_("duplicated: "+s),O(n,t,s,m(e,s),r))}function N(e,t){var n=function(){};return e&&""+t!=""+n?function(){return t.apply(this,arguments)}:n}function C(e,t,n,r){var i=k(t,r);v(e,t,{enumerable:!1,configurable:i,writable:i,value:n})}function k(e,t){return t?!/^[A-Z_]+$/.test(e):!0}function L(e,f){return e!==t&&e!==n&&e!==r&&e!==s&&e!==o&&e!==u&&e!==a&&(f||e!==i)}function A(t){if(typeof t=="object")return t;t.length&&_((t.name||"Class")+" should not expect arguments");for(var n,r,i,s={init:t},o=t.prototype;o&&o!==e.prototype;o=b(o))for(n=0,i=g(o);n<i.length;n++)r=i[n],L(r,!1)&&!h.call(s,r)&&v(s,r,m(o,r));return s}function O(e,t,n,r,i){var s=h.call(r,"value"),o,u;if(i){if(h.call(t,n))return}else s?(u=r.value,typeof u=="function"&&E.test(u)&&(r.value=D(e,n,u,i))):(P(e,n,r,"get"),P(e,n,r,"set"));o=k(n,i),r.enumerable=!1,r.configurable=o,s&&(r.writable=o),v(t,n,r)}function M(e,t){for(var n,r,i=0;i<e.length;i++){n=e[i];for(r in n)h.call(n,r)&&!h.call(t,r)&&_(r+" is not implemented")}}function _(e){try{console.warn(e)}catch(t){}}function D(e,t,n,r){return function(){h.call(this,u)||C(this,u,null,r);var i=this[u],s=this[u]=e[t],o=n.apply(this,arguments);return this[u]=i,o}}function P(e,t,n,r,i){h.call(n,r)&&E.test(n[r])&&(n[r]=D(m(e,t),r,n[r],i))}var t="constructor",n="extends",r="implements",i="init",s="prototype",o="static",u="super",a="with",f="__proto__",l=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],c=!{valueOf:0}[l[2]](l[5]),h=e[l[0]],p=e.create||function(e){var t=this instanceof p;return p[s]=t?d:e,t?this:new p},d=p[s],v=e.defineProperty,m=e.getOwnPropertyDescriptor,g=e.getOwnPropertyNames||function(e){var t=[],n,r;for(r in e)h.call(e,r)&&t.push(r);if(c)for(n=0;n<l.length;n++)r=l[n],h.call(e,r)&&t.push(r);return t},y=e.getPrototypeOf,b=y||function(e){return e[f]||null},w=new RegExp("^(?:"+g(function(){}).join("|")+")$"),E=/\bsuper\b/.test(function(){this["super"]()})?/\bsuper\b/:/.*/;try{v({},"{}",{})}catch(S){v=function(e,t,n){return e[t]=n.value,e},m=function(e,t){return{value:e[t]}}}return function(e){var i=h.call(e,t),u=h.call(e,n),l=u&&e[n],c=u&&typeof l=="function",d=c?l[s]:l,v=i?e[t]:N(c,l),m=u&&i&&E.test(v),g=u?p(d):v[s],b,w;return m&&(v=D(d,t,v,!1)),h.call(e,a)&&(b=x([].concat(e[a]),g,d),w=b.length,w&&(v=function(e){return function(){var t=0;while(t<w)b[t++].call(this);return e.apply(this,arguments)}}(v),v[s]=g)),h.call(e,o)&&T(e[o],v,d,!0,!0),u&&(l!==d&&T(l,v,d,!0,!0),v[s]=g),g[t]!==v&&C(g,t,v,!1),T(e,g,d,!1,!0),h.call(e,r)&&M([].concat(e[r]),g),u&&!y&&C(g,f,d,!1),v}}(Object);

@@ -74,7 +74,4 @@ /*!

// basic ad-hoc private fallback for old browsers
// use es5-shim if you want a properly patched polyfill
gOPD = Object.getOwnPropertyDescriptor || function (object, key) {
return {value: object[key]};
},
// redefined if not present
gOPD = Object.getOwnPropertyDescriptor,

@@ -136,2 +133,7 @@ // basic ad-hoc private fallback for old browsers

};
// basic ad-hoc private fallback for old browsers
// use es5-shim if you want a properly patched polyfill
gOPD = function (object, key) {
return {value: object[key]};
};
}

@@ -155,10 +157,2 @@

// used to copy properties from a class used as trait
function assignFromPrototype(key) {
/*jshint validthis: true */
if (isNotASpecialKey(key, false) && !hOP.call(this, key)) {
defineProperty(this, key, gOPD(this.init.prototype, key));
}
}
// configure source own properties in the target

@@ -237,2 +231,3 @@ function copyOwn(source, target, inherits, publicStatic, allowInit) {

for (var
i, key, keys,
object = {init: trait},

@@ -243,3 +238,8 @@ proto = trait.prototype;

) {
gOPN(proto).forEach(assignFromPrototype, object);
for (i = 0, keys = gOPN(proto); i < keys.length; i++) {
key = keys[i];
if (isNotASpecialKey(key, false) && !hOP.call(object, key)) {
defineProperty(object, key, gOPD(proto, key));
}
}
}

@@ -246,0 +246,0 @@ return object;

{
"version": "1.0.0",
"version": "1.0.1",
"license": "MIT",

@@ -4,0 +4,0 @@ "name": "es-class",