Socket
Socket
Sign inDemoInstall

@babel/helpers

Package Overview
Dependencies
32
Maintainers
4
Versions
135
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.23.4 to 7.23.5

2

lib/helpers-generated.js

@@ -23,3 +23,3 @@ "use strict";

applyDecs2301: helper("7.21.0", 'import checkInRHS from"checkInRHS";function applyDecs2301Factory(){function createAddInitializerMethod(e,t){return function(r){!function(e,t){if(e.v)throw new Error("attempted to call "+t+" after decoration was finished")}(t,"addInitializer"),assertCallable(r,"An initializer"),e.push(r)}}function assertInstanceIfPrivate(e,t){if(!e(t))throw new TypeError("Attempted to access private element on non-instance")}function memberDec(e,t,r,n,a,i,s,o,c){var u;switch(a){case 1:u="accessor";break;case 2:u="method";break;case 3:u="getter";break;case 4:u="setter";break;default:u="field"}var l,f,p={kind:u,name:s?"#"+t:t,static:i,private:s},d={v:!1};if(0!==a&&(p.addInitializer=createAddInitializerMethod(n,d)),s||0!==a&&2!==a)if(2===a)l=function(e){return assertInstanceIfPrivate(c,e),r.value};else{var h=0===a||1===a;(h||3===a)&&(l=s?function(e){return assertInstanceIfPrivate(c,e),r.get.call(e)}:function(e){return r.get.call(e)}),(h||4===a)&&(f=s?function(e,t){assertInstanceIfPrivate(c,e),r.set.call(e,t)}:function(e,t){r.set.call(e,t)})}else l=function(e){return e[t]},0===a&&(f=function(e,r){e[t]=r});var v=s?c.bind():function(e){return t in e};p.access=l&&f?{get:l,set:f,has:v}:l?{get:l,has:v}:{set:f,has:v};try{return e(o,p)}finally{d.v=!0}}function assertCallable(e,t){if("function"!=typeof e)throw new TypeError(t+" must be a function")}function assertValidReturnValue(e,t){var r=typeof t;if(1===e){if("object"!==r||null===t)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");void 0!==t.get&&assertCallable(t.get,"accessor.get"),void 0!==t.set&&assertCallable(t.set,"accessor.set"),void 0!==t.init&&assertCallable(t.init,"accessor.init")}else if("function"!==r){var n;throw n=0===e?"field":10===e?"class":"method",new TypeError(n+" decorators must return a function or void 0")}}function curryThis2(e){return function(t){e(this,t)}}function applyMemberDec(e,t,r,n,a,i,s,o,c){var u,l,f,p,d,h,v,g=r[0];if(s?u=0===a||1===a?{get:(p=r[3],function(){return p(this)}),set:curryThis2(r[4])}:3===a?{get:r[3]}:4===a?{set:r[3]}:{value:r[3]}:0!==a&&(u=Object.getOwnPropertyDescriptor(t,n)),1===a?f={get:u.get,set:u.set}:2===a?f=u.value:3===a?f=u.get:4===a&&(f=u.set),"function"==typeof g)void 0!==(d=memberDec(g,n,u,o,a,i,s,f,c))&&(assertValidReturnValue(a,d),0===a?l=d:1===a?(l=d.init,h=d.get||f.get,v=d.set||f.set,f={get:h,set:v}):f=d);else for(var y=g.length-1;y>=0;y--){var m;if(void 0!==(d=memberDec(g[y],n,u,o,a,i,s,f,c)))assertValidReturnValue(a,d),0===a?m=d:1===a?(m=d.init,h=d.get||f.get,v=d.set||f.set,f={get:h,set:v}):f=d,void 0!==m&&(void 0===l?l=m:"function"==typeof l?l=[l,m]:l.push(m))}if(0===a||1===a){if(void 0===l)l=function(e,t){return t};else if("function"!=typeof l){var b=l;l=function(e,t){for(var r=t,n=0;n<b.length;n++)r=b[n].call(e,r);return r}}else{var I=l;l=function(e,t){return I.call(e,t)}}e.push(l)}0!==a&&(1===a?(u.get=f.get,u.set=f.set):2===a?u.value=f:3===a?u.get=f:4===a&&(u.set=f),s?1===a?(e.push((function(e,t){return f.get.call(e,t)})),e.push((function(e,t){return f.set.call(e,t)}))):2===a?e.push(f):e.push((function(e,t){return f.call(e,t)})):Object.defineProperty(t,n,u))}function applyMemberDecs(e,t,r){for(var n,a,i,s=[],o=new Map,c=new Map,u=0;u<t.length;u++){var l=t[u];if(Array.isArray(l)){var f,p,d=l[1],h=l[2],v=l.length>3,g=d>=5,y=r;if(g?(f=e,0!==(d-=5)&&(p=a=a||[]),v&&!i&&(i=function(t){return checkInRHS(t)===e}),y=i):(f=e.prototype,0!==d&&(p=n=n||[])),0!==d&&!v){var m=g?c:o,b=m.get(h)||0;if(!0===b||3===b&&4!==d||4===b&&3!==d)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+h);!b&&d>2?m.set(h,d):m.set(h,!0)}applyMemberDec(s,f,l,h,d,g,v,p,y)}}return pushInitializers(s,n),pushInitializers(s,a),s}function pushInitializers(e,t){t&&e.push((function(e){for(var r=0;r<t.length;r++)t[r].call(e);return e}))}return function(e,t,r,n){return{e:applyMemberDecs(e,t,n),get c(){return function(e,t){if(t.length>0){for(var r=[],n=e,a=e.name,i=t.length-1;i>=0;i--){var s={v:!1};try{var o=t[i](n,{kind:"class",name:a,addInitializer:createAddInitializerMethod(r,s)})}finally{s.v=!0}void 0!==o&&(assertValidReturnValue(10,o),n=o)}return[n,function(){for(var e=0;e<r.length;e++)r[e].call(n)}]}}(e,r)}}}}export default function applyDecs2301(e,t,r,n){return(applyDecs2301=applyDecs2301Factory())(e,t,r,n)}'),
applyDecs2305: helper("7.21.0", 'import checkInRHS from"checkInRHS";function createAddInitializerMethod(e,t){return function(r){assertNotFinished(t,"addInitializer"),assertCallable(r,"An initializer"),e.push(r)}}function assertInstanceIfPrivate(e,t){if(!e(t))throw new TypeError("Attempted to access private element on non-instance")}function memberDec(e,t,r,a,n,i,s,o,c,l,u){var f;switch(i){case 1:f="accessor";break;case 2:f="method";break;case 3:f="getter";break;case 4:f="setter";break;default:f="field"}var d,p,h={kind:f,name:o?"#"+r:r,static:s,private:o,metadata:u},v={v:!1};if(0!==i&&(h.addInitializer=createAddInitializerMethod(n,v)),o||0!==i&&2!==i)if(2===i)d=function(e){return assertInstanceIfPrivate(l,e),a.value};else{var y=0===i||1===i;(y||3===i)&&(d=o?function(e){return assertInstanceIfPrivate(l,e),a.get.call(e)}:function(e){return a.get.call(e)}),(y||4===i)&&(p=o?function(e,t){assertInstanceIfPrivate(l,e),a.set.call(e,t)}:function(e,t){a.set.call(e,t)})}else d=function(e){return e[r]},0===i&&(p=function(e,t){e[r]=t});var m=o?l.bind():function(e){return r in e};h.access=d&&p?{get:d,set:p,has:m}:d?{get:d,has:m}:{set:p,has:m};try{return e.call(t,c,h)}finally{v.v=!0}}function assertNotFinished(e,t){if(e.v)throw new Error("attempted to call "+t+" after decoration was finished")}function assertCallable(e,t){if("function"!=typeof e)throw new TypeError(t+" must be a function")}function assertValidReturnValue(e,t){var r=typeof t;if(1===e){if("object"!==r||null===t)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");void 0!==t.get&&assertCallable(t.get,"accessor.get"),void 0!==t.set&&assertCallable(t.set,"accessor.set"),void 0!==t.init&&assertCallable(t.init,"accessor.init")}else if("function"!==r){var a;throw a=0===e?"field":5===e?"class":"method",new TypeError(a+" decorators must return a function or void 0")}}function curryThis1(e){return function(){return e(this)}}function curryThis2(e){return function(t){e(this,t)}}function applyMemberDec(e,t,r,a,n,i,s,o,c,l,u){var f,d,p,h,v,y,m=r[0];a||Array.isArray(m)||(m=[m]),o?f=0===i||1===i?{get:curryThis1(r[3]),set:curryThis2(r[4])}:3===i?{get:r[3]}:4===i?{set:r[3]}:{value:r[3]}:0!==i&&(f=Object.getOwnPropertyDescriptor(t,n)),1===i?p={get:f.get,set:f.set}:2===i?p=f.value:3===i?p=f.get:4===i&&(p=f.set);for(var g=a?2:1,b=m.length-1;b>=0;b-=g){var I;if(void 0!==(h=memberDec(m[b],a?m[b-1]:void 0,n,f,c,i,s,o,p,l,u)))assertValidReturnValue(i,h),0===i?I=h:1===i?(I=h.init,v=h.get||p.get,y=h.set||p.set,p={get:v,set:y}):p=h,void 0!==I&&(void 0===d?d=I:"function"==typeof d?d=[d,I]:d.push(I))}if(0===i||1===i){if(void 0===d)d=function(e,t){return t};else if("function"!=typeof d){var w=d;d=function(e,t){for(var r=t,a=w.length-1;a>=0;a--)r=w[a].call(e,r);return r}}else{var M=d;d=function(e,t){return M.call(e,t)}}e.push(d)}0!==i&&(1===i?(f.get=p.get,f.set=p.set):2===i?f.value=p:3===i?f.get=p:4===i&&(f.set=p),o?1===i?(e.push((function(e,t){return p.get.call(e,t)})),e.push((function(e,t){return p.set.call(e,t)}))):2===i?e.push(p):e.push((function(e,t){return p.call(e,t)})):Object.defineProperty(t,n,f))}function applyMemberDecs(e,t,r,a){for(var n,i,s,o=[],c=new Map,l=new Map,u=0;u<t.length;u++){var f=t[u];if(Array.isArray(f)){var d,p,h=f[1],v=f[2],y=f.length>3,m=16&h,g=!!(8&h),b=r;if(h&=7,g?(d=e,0!==h&&(p=i=i||[]),y&&!s&&(s=function(t){return checkInRHS(t)===e}),b=s):(d=e.prototype,0!==h&&(p=n=n||[])),0!==h&&!y){var I=g?l:c,w=I.get(v)||0;if(!0===w||3===w&&4!==h||4===w&&3!==h)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+v);I.set(v,!(!w&&h>2)||h)}applyMemberDec(o,d,f,m,v,h,g,y,p,b,a)}}return pushInitializers(o,n),pushInitializers(o,i),o}function pushInitializers(e,t){t&&e.push((function(e){for(var r=0;r<t.length;r++)t[r].call(e);return e}))}function applyClassDecs(e,t,r,a){if(t.length){for(var n=[],i=e,s=e.name,o=r?2:1,c=t.length-1;c>=0;c-=o){var l={v:!1};try{var u=t[c].call(r?t[c-1]:void 0,i,{kind:"class",name:s,addInitializer:createAddInitializerMethod(n,l),metadata:a})}finally{l.v=!0}void 0!==u&&(assertValidReturnValue(5,u),i=u)}return[defineMetadata(i,a),function(){for(var e=0;e<n.length;e++)n[e].call(i)}]}}function defineMetadata(e,t){return Object.defineProperty(e,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:t})}export default function applyDecs2305(e,t,r,a,n,i){if(arguments.length>=6)var s=i[Symbol.metadata||Symbol.for("Symbol.metadata")];var o=Object.create(void 0===s?null:s),c=applyMemberDecs(e,t,n,o);return r.length||defineMetadata(e,o),{e:c,get c(){return applyClassDecs(e,r,a,o)}}}'),
applyDecs2305: helper("7.21.0", 'import checkInRHS from"checkInRHS";function _bindPropCall(e,t){return function(r,a){return e[t].call(r,a)}}function createAddInitializerMethod(e,t){return function(r){if(t.v)throw new Error("attempted to call addInitializer after decoration was finished");assertCallable(r,"An initializer",!0),e.push(r)}}function memberDec(e,t,r,a,n,i,o,s,l,c,u){function assertInstanceIfPrivate(e){return function(t,r){if(!c(t))throw new TypeError("Attempted to access private element on non-instance");return e(t,r)}}var f,d,p={v:!1},v={kind:["field","accessor","method","getter","setter","field"][i],name:s?"#"+r:r,static:o,private:s,metadata:u,addInitializer:createAddInitializerMethod(n,p)};if(s||0!==i&&2!==i)if(2===i)f=assertInstanceIfPrivate((function(){return a.value}));else{var h=0===i||1===i;(h||3===i)&&(f=_bindPropCall(a,"get"),s&&(f=assertInstanceIfPrivate(f))),(h||4===i)&&(d=_bindPropCall(a,"set"),s&&(d=assertInstanceIfPrivate(d)))}else f=function(e){return e[r]},0===i&&(d=function(e,t){e[r]=t});var m=s?c.bind():function(e){return r in e},b=v.access={has:m};f&&(b.get=f),d&&(b.set=d);try{return e.call(t,l,v)}finally{p.v=!0}}function assertCallable(e,t,r){if("function"!=typeof e&&(r||void 0!==e))throw new TypeError(t+" must be a function")}function assertValidReturnValue(e,t){var r=typeof t;if(1===e){if("object"!==r||!t)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");assertCallable(t.get,"accessor.get"),assertCallable(t.set,"accessor.set"),assertCallable(t.init,"accessor.init")}else if("function"!==r)throw new TypeError((0===e?"field":5===e?"class":"method")+" decorators must return a function or void 0")}function applyMemberDec(e,t,r,a,n,i,o,s,l,c,u){var f,d,p,v,h=r[0],m=r[3];a||Array.isArray(h)||(h=[h]),s?f=0===i||1===i?{get:function(){return m(this)},set:function(e){r[4](this,e)}}:3===i?{get:m}:4===i?{set:m}:{value:m}:0!==i&&(f=Object.getOwnPropertyDescriptor(t,n)),1===i?p={get:f.get,set:f.set}:2===i?p=f.value:3===i?p=f.get:4===i&&(p=f.set);for(var b=a?2:1,y=h.length-1;y>=0;y-=b){var g;if(void 0!==(v=memberDec(h[y],a?h[y-1]:void 0,n,f,l,i,o,s,p,c,u)))assertValidReturnValue(i,v),0===i?g=v:1===i?(g=v.init,p={get:v.get||p.get,set:v.set||p.set}):p=v,void 0!==g&&(void 0===d?d=g:"function"==typeof d?d=[d,g]:d.push(g))}if(0===i||1===i){if(void 0===d)d=function(e,t){return t};else if("function"!=typeof d){var I=d;d=function(e,t){for(var r=t,a=I.length-1;a>=0;a--)r=I[a].call(e,r);return r}}else{var w=d;d=d.call.bind(w)}e.push(d)}0!==i&&(1===i?(f.get=p.get,f.set=p.set):2===i?f.value=p:3===i?f.get=p:4===i&&(f.set=p),s?1===i?e.push(_bindPropCall(f,"get"),_bindPropCall(f,"set")):e.push(2===i?p:Function.call.bind(p)):Object.defineProperty(t,n,f))}function applyMemberDecs(e,t,r,a){var n,i,o,s=[],l=new Map,c=new Map;function pushInitializers(e){e&&s.push((function(t){for(var r=0;r<e.length;r++)e[r].call(t);return t}))}for(var u=0;u<t.length;u++){var f=t[u];if(Array.isArray(f)){var d,p,v=f[1],h=f[2],m=f.length>3,b=16&v,y=!!(8&v),g=r;if(v&=7,y?(d=e,p=i=i||[],m&&!o&&(o=function(t){return checkInRHS(t)===e}),g=o):(d=e.prototype,p=n=n||[]),0!==v&&!m){var I=y?c:l,w=I.get(h)||0;if(!0===w||3===w&&4!==v||4===w&&3!==v)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+h);I.set(h,!(!w&&v>2)||v)}applyMemberDec(s,d,f,b,h,v,y,m,p,g,a)}}return pushInitializers(n),pushInitializers(i),s}function applyClassDecs(e,t,r,a){if(t.length){for(var n=[],i=e,o=e.name,s=r?2:1,l=t.length-1;l>=0;l-=s){var c={v:!1};try{var u=t[l].call(r?t[l-1]:void 0,i,{kind:"class",name:o,addInitializer:createAddInitializerMethod(n,c),metadata:a})}finally{c.v=!0}void 0!==u&&(assertValidReturnValue(5,u),i=u)}return[defineMetadata(i,a),function(){for(var e=0;e<n.length;e++)n[e].call(i)}]}}function defineMetadata(e,t){return Object.defineProperty(e,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:t})}export default function applyDecs2305(e,t,r,a,n,i){if(arguments.length>=6)var o=i[Symbol.metadata||Symbol.for("Symbol.metadata")];var s=Object.create(void 0===o?null:o),l=applyMemberDecs(e,t,n,s);return r.length||defineMetadata(e,s),{e:l,get c(){return applyClassDecs(e,r,a,s)}}}'),
asyncGeneratorDelegate: helper("7.0.0-beta.0", 'import OverloadYield from"OverloadYield";export default function _asyncGeneratorDelegate(t){var e={},n=!1;function pump(e,r){return n=!0,r=new Promise((function(n){n(t[e](r))})),{done:!1,value:new OverloadYield(r,1)}}return e["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},e.next=function(t){return n?(n=!1,t):pump("next",t)},"function"==typeof t.throw&&(e.throw=function(t){if(n)throw n=!1,t;return pump("throw",t)}),"function"==typeof t.return&&(e.return=function(t){return n?(n=!1,t):pump("return",t)}),e}'),

@@ -26,0 +26,0 @@ asyncIterator: helper("7.15.9", 'export default function _asyncIterator(r){var n,t,o,e=2;for("undefined"!=typeof Symbol&&(t=Symbol.asyncIterator,o=Symbol.iterator);e--;){if(t&&null!=(n=r[t]))return n.call(r);if(o&&null!=(n=r[o]))return new AsyncFromSyncIterator(n.call(r));t="@@asyncIterator",o="@@iterator"}throw new TypeError("Object is not async iterable")}function AsyncFromSyncIterator(r){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var n=r.done;return Promise.resolve(r.value).then((function(r){return{value:r,done:n}}))}return AsyncFromSyncIterator=function(r){this.s=r,this.n=r.next},AsyncFromSyncIterator.prototype={s:null,n:null,next:function(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments))},return:function(r){var n=this.s.return;return void 0===n?Promise.resolve({value:r,done:!0}):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments))},throw:function(r){var n=this.s.return;return void 0===n?Promise.reject(r):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments))}},new AsyncFromSyncIterator(r)}'),

@@ -8,45 +8,36 @@ "use strict";

var _checkInRHS = require("checkInRHS");
function _bindPropCall(obj, name) {
return function (_this, value) {
return obj[name].call(_this, value);
};
}
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
return function addInitializer(initializer) {
assertNotFinished(decoratorFinishedRef, "addInitializer");
assertCallable(initializer, "An initializer");
if (decoratorFinishedRef.v) {
throw new Error("attempted to call addInitializer after decoration was finished");
}
assertCallable(initializer, "An initializer", true);
initializers.push(initializer);
};
}
function assertInstanceIfPrivate(has, target) {
if (!has(target)) {
throw new TypeError("Attempted to access private element on non-instance");
}
}
function memberDec(dec, thisArg, name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand, metadata) {
var kindStr;
switch (kind) {
case 1:
kindStr = "accessor";
break;
case 2:
kindStr = "method";
break;
case 3:
kindStr = "getter";
break;
case 4:
kindStr = "setter";
break;
default:
kindStr = "field";
function assertInstanceIfPrivate(callback) {
return function (target, value) {
if (!hasPrivateBrand(target)) {
throw new TypeError("Attempted to access private element on non-instance");
}
return callback(target, value);
};
}
var decoratorFinishedRef = {
v: false
};
var ctx = {
kind: kindStr,
kind: ["field", "accessor", "method", "getter", "setter", "field"][kind],
name: isPrivate ? "#" + name : name,
static: isStatic,
private: isPrivate,
metadata: metadata
metadata: metadata,
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef)
};
var decoratorFinishedRef = {
v: false
};
if (kind !== 0) {
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
}
var get, set;

@@ -63,30 +54,17 @@ if (!isPrivate && (kind === 0 || kind === 2)) {

} else if (kind === 2) {
get = function (target) {
assertInstanceIfPrivate(hasPrivateBrand, target);
get = assertInstanceIfPrivate(function () {
return desc.value;
};
});
} else {
var t = kind === 0 || kind === 1;
if (t || kind === 3) {
get = _bindPropCall(desc, "get");
if (isPrivate) {
get = function (target) {
assertInstanceIfPrivate(hasPrivateBrand, target);
return desc.get.call(target);
};
} else {
get = function (target) {
return desc.get.call(target);
};
get = assertInstanceIfPrivate(get);
}
}
if (t || kind === 4) {
set = _bindPropCall(desc, "set");
if (isPrivate) {
set = function (target, value) {
assertInstanceIfPrivate(hasPrivateBrand, target);
desc.set.call(target, value);
};
} else {
set = function (target, value) {
desc.set.call(target, value);
};
set = assertInstanceIfPrivate(set);
}

@@ -98,13 +76,7 @@ }

};
ctx.access = get && set ? {
get: get,
set: set,
var access = ctx.access = {
has: has
} : get ? {
get: get,
has: has
} : {
set: set,
has: has
};
if (get) access.get = get;
if (set) access.set = set;
try {

@@ -116,10 +88,7 @@ return dec.call(thisArg, value, ctx);

}
function assertNotFinished(decoratorFinishedRef, fnName) {
if (decoratorFinishedRef.v) {
throw new Error("attempted to call " + fnName + " after decoration was finished");
}
}
function assertCallable(fn, hint) {
function assertCallable(fn, hint, throwUndefined) {
if (typeof fn !== "function") {
throw new TypeError(hint + " must be a function");
if (throwUndefined || fn !== void 0) {
throw new TypeError(hint + " must be a function");
}
}

@@ -130,38 +99,15 @@ }

if (kind === 1) {
if (type !== "object" || value === null) {
if (type !== "object" || !value) {
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
}
if (value.get !== undefined) {
assertCallable(value.get, "accessor.get");
}
if (value.set !== undefined) {
assertCallable(value.set, "accessor.set");
}
if (value.init !== undefined) {
assertCallable(value.init, "accessor.init");
}
assertCallable(value.get, "accessor.get");
assertCallable(value.set, "accessor.set");
assertCallable(value.init, "accessor.init");
} else if (type !== "function") {
var hint;
if (kind === 0) {
hint = "field";
} else if (kind === 5) {
hint = "class";
} else {
hint = "method";
}
throw new TypeError(hint + " decorators must return a function or void 0");
throw new TypeError((kind === 0 ? "field" : kind === 5 ? "class" : "method") + " decorators must return a function or void 0");
}
}
function curryThis1(fn) {
return function () {
return fn(this);
};
}
function curryThis2(fn) {
return function (value) {
fn(this, value);
};
}
function applyMemberDec(ret, base, decInfo, decoratorsHaveThis, name, kind, isStatic, isPrivate, initializers, hasPrivateBrand, metadata) {
var decs = decInfo[0];
var decs = decInfo[0],
decVal = decInfo[3];
if (!decoratorsHaveThis && !Array.isArray(decs)) {

@@ -174,4 +120,8 @@ decs = [decs];

desc = {
get: curryThis1(decInfo[3]),
set: curryThis2(decInfo[4])
get: function () {
return decVal(this);
},
set: function (value) {
decInfo[4](this, value);
}
};

@@ -181,11 +131,11 @@ } else {

desc = {
get: decInfo[3]
get: decVal
};
} else if (kind === 4) {
desc = {
set: decInfo[3]
set: decVal
};
} else {
desc = {
value: decInfo[3]
value: decVal
};

@@ -257,5 +207,3 @@ }

var originalInitializer = init;
init = function (instance, init) {
return originalInitializer.call(instance, init);
};
init = init.call.bind(originalInitializer);
}

@@ -277,14 +225,5 @@ ret.push(init);

if (kind === 1) {
ret.push(function (instance, args) {
return value.get.call(instance, args);
});
ret.push(function (instance, args) {
return value.set.call(instance, args);
});
} else if (kind === 2) {
ret.push(value);
ret.push(_bindPropCall(desc, "get"), _bindPropCall(desc, "set"));
} else {
ret.push(function (instance, args) {
return value.call(instance, args);
});
ret.push(kind === 2 ? value : Function.call.bind(value));
}

@@ -303,2 +242,12 @@ } else {

var existingStaticNonFields = new Map();
function pushInitializers(initializers) {
if (initializers) {
ret.push(function (instance) {
for (var i = 0; i < initializers.length; i++) {
initializers[i].call(instance);
}
return instance;
});
}
}
for (var i = 0; i < decInfos.length; i++) {

@@ -318,6 +267,4 @@ var decInfo = decInfos[i];

base = Class;
if (kind !== 0) {
staticInitializers = staticInitializers || [];
initializers = staticInitializers;
}
staticInitializers = staticInitializers || [];
initializers = staticInitializers;
if (isPrivate && !staticBrand) {

@@ -331,6 +278,4 @@ staticBrand = function (_) {

base = Class.prototype;
if (kind !== 0) {
protoInitializers = protoInitializers || [];
initializers = protoInitializers;
}
protoInitializers = protoInitializers || [];
initializers = protoInitializers;
}

@@ -347,16 +292,6 @@ if (kind !== 0 && !isPrivate) {

}
pushInitializers(ret, protoInitializers);
pushInitializers(ret, staticInitializers);
pushInitializers(protoInitializers);
pushInitializers(staticInitializers);
return ret;
}
function pushInitializers(ret, initializers) {
if (initializers) {
ret.push(function (instance) {
for (var i = 0; i < initializers.length; i++) {
initializers[i].call(instance);
}
return instance;
});
}
}
function applyClassDecs(targetClass, classDecs, decoratorsHaveThis, metadata) {

@@ -363,0 +298,0 @@ if (classDecs.length) {

@@ -137,2 +137,3 @@ "use strict";

const bindings = new Set(localBindings || []);
if (id.type === "Identifier") bindings.add(id.name);
localBindingNames.forEach(name => {

@@ -139,0 +140,0 @@ let newName = name;

{
"name": "@babel/helpers",
"version": "7.23.4",
"version": "7.23.5",
"description": "Collection of helper functions used by Babel transforms.",

@@ -19,11 +19,10 @@ "author": "The Babel Team (https://babel.dev/team)",

"@babel/template": "^7.22.15",
"@babel/traverse": "^7.23.4",
"@babel/types": "^7.23.4"
"@babel/traverse": "^7.23.5",
"@babel/types": "^7.23.5"
},
"devDependencies": {
"@babel/generator": "^7.23.4",
"@babel/generator": "^7.23.5",
"@babel/helper-plugin-test-runner": "^7.22.5",
"@babel/parser": "^7.23.4",
"regenerator-runtime": "^0.14.0",
"terser": "^5.19.2"
"@babel/parser": "^7.23.5",
"regenerator-runtime": "^0.14.0"
},

@@ -30,0 +29,0 @@ "engines": {

@@ -0,5 +1,8 @@

/* eslint-disable import/no-extraneous-dependencies */
import fs from "fs";
import { join } from "path";
import { URL, fileURLToPath } from "url";
import { minify } from "terser"; // eslint-disable-line import/no-extraneous-dependencies
import { minify } from "terser";
import { transformSync } from "@babel/core";
import presetTypescript from "@babel/preset-typescript";

@@ -33,4 +36,6 @@ const HELPERS_FOLDER = new URL("../src/helpers", import.meta.url);

const isTs = file.endsWith(".ts");
const filePath = join(fileURLToPath(HELPERS_FOLDER), file);
if (!file.endsWith(".js")) {
if (!file.endsWith(".js") && !isTs) {
console.error("ignoring", filePath);

@@ -40,4 +45,4 @@ continue;

const fileContents = await fs.promises.readFile(filePath, "utf8");
const minVersionMatch = fileContents.match(
let code = await fs.promises.readFile(filePath, "utf8");
const minVersionMatch = code.match(
/^\s*\/\*\s*@minVersion\s+(?<minVersion>\S+)\s*\*\/\s*$/m

@@ -50,12 +55,31 @@ );

const source = await minify(fileContents, {
mangle: { keep_fnames: true },
// The _typeof helper has a custom directive that we must keep
compress: { directives: false },
});
if (isTs) {
code = transformSync(code, {
configFile: false,
babelrc: false,
filename: filePath,
presets: [
[
presetTypescript,
{
onlyRemoveTypeImports: true,
optimizeConstEnums: true,
},
],
],
}).code;
}
code = (
await minify(code, {
mangle: { keep_fnames: true },
// The _typeof helper has a custom directive that we must keep
compress: { directives: false },
})
).code;
output += `\
${JSON.stringify(helperName)}: helper(
${JSON.stringify(minVersion)},
${JSON.stringify(source.code)},
${JSON.stringify(code)},
),

@@ -62,0 +86,0 @@ `;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc