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.1
to
1.1.0
+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=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);
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){"__defineGetter__"in{}?(v=function(e,t,n){return h.call(n,"value")?e[t]=n.value:(h.call(n,"get")&&e.__defineGetter__(t,n.get),h.call(n,"set")&&e.__defineSetter__(t,n.set)),e},m=function(e,t){var n=e.__lookupGetter__(t),r=e.__lookupSetter__(t),i={};return n||r?(n&&(i.get=n),r&&(i.set=r)):i.value=e[t],i}):(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);

@@ -124,15 +124,47 @@ /*!

// verified broken IE8
// verified broken IE8 or older browsers
try {
defineProperty({}, '{}', {});
} catch(o_O) {
defineProperty = function (object, name, descriptor) {
object[name] = descriptor.value;
return object;
};
// basic ad-hoc private fallback for old browsers
// use es5-shim if you want a properly patched polyfill
gOPD = function (object, key) {
if ('__defineGetter__' in {}) {
defineProperty = function (object, name, descriptor) {
if (hOP.call(descriptor, 'value')) {
object[name] = descriptor.value;
} else {
if (hOP.call(descriptor, 'get')) {
object.__defineGetter__(name, descriptor.get);
}
if (hOP.call(descriptor, 'set')) {
object.__defineSetter__(name, descriptor.set);
}
}
return object;
};
gOPD = function (object, key) {
var
get = object.__lookupGetter__(key),
set = object.__lookupSetter__(key),
descriptor = {}
;
if (get || set) {
if (get) {
descriptor.get = get;
}
if (set) {
descriptor.set = set;
}
} else {
descriptor.value = object[key];
}
return descriptor;
};
} else {
defineProperty = function (object, name, descriptor) {
object[name] = descriptor.value;
return object;
};
gOPD = function (object, key) {
return {value: object[key]};
};
};
}
}

@@ -139,0 +171,0 @@

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

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

@@ -23,8 +23,9 @@ es-class

* IE 6 or greater
* Firefox 3 and greater
* Chrome
* Firefox
* IE 6 or greater
* Safari
* Opera
#### Mobile

@@ -39,2 +40,4 @@

* Opera Mini and Mobile
* Blackberry
* Ubuntu Phone

@@ -95,3 +98,3 @@

### ES6 Ready
Using [6to5](http://6to5.org/) it is possible to make your code directly compatible down to ES5 or even ES3 without loosing the ability to debug in every platform without needing source-map. What you see is basically what you get.
Using [Babel](https://babeljs.io) it is possible to make your code directly compatible down to ES5 or even ES3 without loosing the ability to debug in every platform without needing source-map. What you see is basically what you get.

@@ -126,3 +129,3 @@ ```js

A simple call to `6to5 --whitelist=es6.arrowFunctions,es6.properties.shorthand f.js` and the output will be way cleaner than any automation produced by the same transpiler.
A simple call to `babel --whitelist=es6.arrowFunctions,es6.properties.shorthand f.js` and the output will be way cleaner than any automation produced by the same transpiler.

@@ -129,0 +132,0 @@ Your output will be more **readable** and also probably faster at execution time.