codemod 0.11.14 → 0.11.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -773,7 +773,7 @@ ${ge.join(`
|
|
|
773
773
|
`;ne.forEach(ge=>{ce+=ge}),e.fail(ce)}};let I={};d.conflicts=function($,ne){C6("<string|object> [array|string]",[$,ne],arguments.length),typeof $=="object"?Object.keys($).forEach(ce=>{d.conflicts(ce,$[ce])}):(t.global($),I[$]||(I[$]=[]),Array.isArray(ne)?ne.forEach(ce=>d.conflicts($,ce)):I[$].push(ne))},d.getConflicting=()=>I,d.conflicting=function($){Object.keys($).forEach(ne=>{I[ne]&&I[ne].forEach(ce=>{ce&&$[ne]!==void 0&&$[ce]!==void 0&&e.fail(r("Arguments %s and %s are mutually exclusive",ne,ce))})}),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(I).forEach(ne=>{I[ne].forEach(ce=>{ce&&$[n.Parser.camelCase(ne)]!==void 0&&$[n.Parser.camelCase(ce)]!==void 0&&e.fail(r("Arguments %s and %s are mutually exclusive",ne,ce))})})},d.recommendCommands=function($,ne){ne=ne.sort((ke,Be)=>Be.length-ke.length);let ge=null,he=1/0;for(let ke=0,Be;(Be=ne[ke])!==void 0;ke++){let Ze=TFr($,Be);Ze<=3&&Ze<he&&(he=Ze,ge=Be)}ge&&e.fail(r("Did you mean %s?",ge))},d.reset=function($){return h=S6t(h,ne=>!$[ne]),I=S6t(I,ne=>!$[ne]),d};let L=[];return d.freeze=function(){L.push({implied:h,conflicting:I})},d.unfreeze=function(){let $=L.pop();aVe($,void 0,n),{implied:h,conflicting:I}=$},d}var AFr,wFr=Ra(()=>{ycn();k5t();CFr();bcn();AFr=["$0","--","_"]});function SJt(t,e,n,r){bJt=r;let u={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return u;let d=/\.json|\..*rc$/.test(t.extends),h=null;if(d)h=Rxs(e,t.extends);else try{h=require.resolve(t.extends)}catch{return t}Lxs(h),Pjn.push(h),u=d?JSON.parse(bJt.readFileSync(h,"utf8")):require(t.extends),delete t.extends,u=SJt(u,bJt.path.dirname(h),n,bJt)}return Pjn=[],n?kFr(u,t):Object.assign({},u,t)}function Lxs(t){if(Pjn.indexOf(t)>-1)throw new fre(`Circular extended configurations: '${t}'.`)}function Rxs(t,e){return bJt.path.resolve(t,e)}function kFr(t,e){let n={};function r(u){return u&&typeof u=="object"&&!Array.isArray(u)}Object.assign(n,t);for(let u of Object.keys(e))r(e[u])&&r(n[u])?n[u]=kFr(t[u],e[u]):n[u]=e[u];return n}var Pjn,bJt,Njn=Ra(()=>{A5t();Pjn=[]});function $Fr(t){return(e=[],n=t.process.cwd(),r)=>{let u=new Vjn(e,n,r,t);return Object.defineProperty(u,"argv",{get:()=>u.parse(),enumerable:!0}),u.help(),u.version(),u}}function mFr(t){return!!t&&typeof t.getInternalMethods=="function"}var L6,Ff,p1e,P8t,EJt,Kft,ait,Ecn,T6t,N8t,Tcn,$ft,Ccn,Xft,$bt,oit,Yft,Acn,N5t,k6e,f3,Dcn,wcn,cit,O8t,O5t,L8t,C6t,kcn,FO,R8t,F8t,M8t,FR,Icn,Xbt,x0e,IFr,PFr,Ojn,NFr,OFr,LFr,B8t,RFr,Ljn,FFr,MFr,Rjn,A6t,L5t,Fjn,Mjn,Bjn,jjn,Wjn,BFr,jFr,WFr,GFr,UFr,VFr,zFr,qFr,Pcn,HFr,j8t,JFr,Gjn,TJt,Ujn,KFr,W8t,Vjn,Djn=Ra(()=>{Ajn();k5t();A5t();yFr();ycn();EFr();wFr();bcn();Njn();Sjn();I5t();Ejn();wjn();L6=function(t,e,n,r,u){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!u)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!u:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?u.call(t,n):u?u.value=n:e.set(t,n),n},Ff=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)};IFr=Symbol("copyDoubleDash"),PFr=Symbol("copyDoubleDash"),Ojn=Symbol("deleteFromParserHintObject"),NFr=Symbol("emitWarning"),OFr=Symbol("freeze"),LFr=Symbol("getDollarZero"),B8t=Symbol("getParserConfiguration"),RFr=Symbol("getUsageConfiguration"),Ljn=Symbol("guessLocale"),FFr=Symbol("guessVersion"),MFr=Symbol("parsePositionalNumbers"),Rjn=Symbol("pkgUp"),A6t=Symbol("populateParserHintArray"),L5t=Symbol("populateParserHintSingleValueDictionary"),Fjn=Symbol("populateParserHintArrayDictionary"),Mjn=Symbol("populateParserHintDictionary"),Bjn=Symbol("sanitizeKey"),jjn=Symbol("setKey"),Wjn=Symbol("unfreeze"),BFr=Symbol("validateAsync"),jFr=Symbol("getCommandInstance"),WFr=Symbol("getContext"),GFr=Symbol("getHasOutput"),UFr=Symbol("getLoggerInstance"),VFr=Symbol("getParseContext"),zFr=Symbol("getUsageInstance"),qFr=Symbol("getValidationInstance"),Pcn=Symbol("hasParseCallback"),HFr=Symbol("isGlobalContext"),j8t=Symbol("postProcess"),JFr=Symbol("rebase"),Gjn=Symbol("reset"),TJt=Symbol("runYargsParserAndExecuteCommands"),Ujn=Symbol("runValidation"),KFr=Symbol("setHasOutput"),W8t=Symbol("kTrackManuallySetKeys"),Vjn=class{constructor(e=[],n,r,u){this.customScriptName=!1,this.parsed=!1,p1e.set(this,void 0),P8t.set(this,void 0),EJt.set(this,{commands:[],fullCommands:[]}),Kft.set(this,null),ait.set(this,null),Ecn.set(this,"show-hidden"),T6t.set(this,null),N8t.set(this,!0),Tcn.set(this,{}),$ft.set(this,!0),Ccn.set(this,[]),Xft.set(this,void 0),$bt.set(this,{}),oit.set(this,!1),Yft.set(this,null),Acn.set(this,!0),N5t.set(this,void 0),k6e.set(this,""),f3.set(this,void 0),Dcn.set(this,void 0),wcn.set(this,{}),cit.set(this,null),O8t.set(this,null),O5t.set(this,{}),L8t.set(this,{}),C6t.set(this,void 0),kcn.set(this,!1),FO.set(this,void 0),R8t.set(this,!1),F8t.set(this,!1),M8t.set(this,!1),FR.set(this,void 0),Icn.set(this,{}),Xbt.set(this,null),x0e.set(this,void 0),L6(this,FO,u,"f"),L6(this,C6t,e,"f"),L6(this,P8t,n,"f"),L6(this,Dcn,r,"f"),L6(this,Xft,new vcn(this),"f"),this.$0=this[LFr](),this[Gjn](),L6(this,p1e,Ff(this,p1e,"f"),"f"),L6(this,FR,Ff(this,FR,"f"),"f"),L6(this,x0e,Ff(this,x0e,"f"),"f"),L6(this,f3,Ff(this,f3,"f"),"f"),Ff(this,f3,"f").showHiddenOpt=Ff(this,Ecn,"f"),L6(this,N5t,this[PFr](),"f")}addHelpOpt(e,n){let r="help";return C6("[string|boolean] [string]",[e,n],arguments.length),Ff(this,Yft,"f")&&(this[Ojn](Ff(this,Yft,"f")),L6(this,Yft,null,"f")),e===!1&&n===void 0?this:(L6(this,Yft,typeof e=="string"?e:r,"f"),this.boolean(Ff(this,Yft,"f")),this.describe(Ff(this,Yft,"f"),n||Ff(this,FR,"f").deferY18nLookup("Show help")),this)}help(e,n){return this.addHelpOpt(e,n)}addShowHiddenOpt(e,n){if(C6("[string|boolean] [string]",[e,n],arguments.length),e===!1&&n===void 0)return this;let r=typeof e=="string"?e:Ff(this,Ecn,"f");return this.boolean(r),this.describe(r,n||Ff(this,FR,"f").deferY18nLookup("Show hidden options")),Ff(this,f3,"f").showHiddenOpt=r,this}showHidden(e,n){return this.addShowHiddenOpt(e,n)}alias(e,n){return C6("<object|string|array> [string|array]",[e,n],arguments.length),this[Fjn](this.alias.bind(this),"alias",e,n),this}array(e){return C6("<array|string>",[e],arguments.length),this[A6t]("array",e),this[W8t](e),this}boolean(e){return C6("<array|string>",[e],arguments.length),this[A6t]("boolean",e),this[W8t](e),this}check(e,n){return C6("<function> [boolean]",[e,n],arguments.length),this.middleware((r,u)=>I8t(()=>e(r,u.getOptions()),d=>(d?(typeof d=="string"||d instanceof Error)&&Ff(this,FR,"f").fail(d.toString(),d):Ff(this,FR,"f").fail(Ff(this,FO,"f").y18n.__("Argument check failed: %s",e.toString())),r),d=>(Ff(this,FR,"f").fail(d.message?d.message:d.toString(),d),r)),!1,n),this}choices(e,n){return C6("<object|string|array> [string|array]",[e,n],arguments.length),this[Fjn](this.choices.bind(this),"choices",e,n),this}coerce(e,n){if(C6("<object|string|array> [function]",[e,n],arguments.length),Array.isArray(e)){if(!n)throw new fre("coerce callback must be provided");for(let r of e)this.coerce(r,n);return this}else if(typeof e=="object"){for(let r of Object.keys(e))this.coerce(r,e[r]);return this}if(!n)throw new fre("coerce callback must be provided");return Ff(this,f3,"f").key[e]=!0,Ff(this,Xft,"f").addCoerceMiddleware((r,u)=>{let d;return Object.prototype.hasOwnProperty.call(r,e)?I8t(()=>(d=u.getAliases(),n(r[e])),D=>{r[e]=D;let I=u.getInternalMethods().getParserConfiguration()["strip-aliased"];if(d[e]&&I!==!0)for(let L of d[e])r[L]=D;return r},D=>{throw new fre(D.message)}):r},e),this}conflicts(e,n){return C6("<string|object> [string|array]",[e,n],arguments.length),Ff(this,x0e,"f").conflicts(e,n),this}config(e="config",n,r){return C6("[object|string] [string|function] [function]",[e,n,r],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=SJt(e,Ff(this,P8t,"f"),this[B8t]()["deep-merge-config"]||!1,Ff(this,FO,"f")),Ff(this,f3,"f").configObjects=(Ff(this,f3,"f").configObjects||[]).concat(e),this):(typeof n=="function"&&(r=n,n=void 0),this.describe(e,n||Ff(this,FR,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(u=>{Ff(this,f3,"f").config[u]=r||!0}),this)}completion(e,n,r){return C6("[string] [string|boolean|function] [function]",[e,n,r],arguments.length),typeof n=="function"&&(r=n,n=void 0),L6(this,ait,e||Ff(this,ait,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(Ff(this,ait,"f"),n),r&&Ff(this,Kft,"f").registerFunction(r),this}command(e,n,r,u,d,h){return C6("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,n,r,u,d,h],arguments.length),Ff(this,p1e,"f").addHandler(e,n,r,u,d,h),this}commands(e,n,r,u,d,h){return this.command(e,n,r,u,d,h)}commandDir(e,n){C6("<string> [object]",[e,n],arguments.length);let r=Ff(this,Dcn,"f")||Ff(this,FO,"f").require;return Ff(this,p1e,"f").addDirectory(e,r,Ff(this,FO,"f").getCallerFile(),n),this}count(e){return C6("<array|string>",[e],arguments.length),this[A6t]("count",e),this[W8t](e),this}default(e,n,r){return C6("<object|string|array> [*] [string]",[e,n,r],arguments.length),r&&(bjn(e,Ff(this,FO,"f")),Ff(this,f3,"f").defaultDescription[e]=r),typeof n=="function"&&(bjn(e,Ff(this,FO,"f")),Ff(this,f3,"f").defaultDescription[e]||(Ff(this,f3,"f").defaultDescription[e]=Ff(this,FR,"f").functionDescription(n)),n=n.call()),this[L5t](this.default.bind(this),"default",e,n),this}defaults(e,n,r){return this.default(e,n,r)}demandCommand(e=1,n,r,u){return C6("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,n,r,u],arguments.length),typeof n!="number"&&(r=n,n=1/0),this.global("_",!1),Ff(this,f3,"f").demandedCommands._={min:e,max:n,minMsg:r,maxMsg:u},this}demand(e,n,r){return Array.isArray(n)?(n.forEach(u=>{aVe(r,!0,Ff(this,FO,"f")),this.demandOption(u,r)}),n=1/0):typeof n!="number"&&(r=n,n=1/0),typeof e=="number"?(aVe(r,!0,Ff(this,FO,"f")),this.demandCommand(e,n,r,r)):Array.isArray(e)?e.forEach(u=>{aVe(r,!0,Ff(this,FO,"f")),this.demandOption(u,r)}):typeof r=="string"?this.demandOption(e,r):(r===!0||typeof r>"u")&&this.demandOption(e),this}demandOption(e,n){return C6("<object|string|array> [string]",[e,n],arguments.length),this[L5t](this.demandOption.bind(this),"demandedOptions",e,n),this}deprecateOption(e,n){return C6("<string> [string|boolean]",[e,n],arguments.length),Ff(this,f3,"f").deprecatedOptions[e]=n,this}describe(e,n){return C6("<object|string|array> [string]",[e,n],arguments.length),this[jjn](e,!0),Ff(this,FR,"f").describe(e,n),this}detectLocale(e){return C6("<boolean>",[e],arguments.length),L6(this,N8t,e,"f"),this}env(e){return C6("[string|boolean]",[e],arguments.length),e===!1?delete Ff(this,f3,"f").envPrefix:Ff(this,f3,"f").envPrefix=e||"",this}epilogue(e){return C6("<string>",[e],arguments.length),Ff(this,FR,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,n){return C6("<string|array> [string]",[e,n],arguments.length),Array.isArray(e)?e.forEach(r=>this.example(...r)):Ff(this,FR,"f").example(e,n),this}exit(e,n){L6(this,oit,!0,"f"),L6(this,T6t,n,"f"),Ff(this,$ft,"f")&&Ff(this,FO,"f").process.exit(e)}exitProcess(e=!0){return C6("[boolean]",[e],arguments.length),L6(this,$ft,e,"f"),this}fail(e){if(C6("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new fre("Invalid first argument. Expected function or boolean 'false'");return Ff(this,FR,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,n){return C6("<array> [function]",[e,n],arguments.length),n?Ff(this,Kft,"f").getCompletion(e,n):new Promise((r,u)=>{Ff(this,Kft,"f").getCompletion(e,(d,h)=>{d?u(d):r(h)})})}getDemandedOptions(){return C6([],0),Ff(this,f3,"f").demandedOptions}getDemandedCommands(){return C6([],0),Ff(this,f3,"f").demandedCommands}getDeprecatedOptions(){return C6([],0),Ff(this,f3,"f").deprecatedOptions}getDetectLocale(){return Ff(this,N8t,"f")}getExitProcess(){return Ff(this,$ft,"f")}getGroups(){return Object.assign({},Ff(this,$bt,"f"),Ff(this,L8t,"f"))}getHelp(){if(L6(this,oit,!0,"f"),!Ff(this,FR,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[TJt](Ff(this,C6t,"f"),void 0,void 0,0,!0);if(Xoe(n))return n.then(()=>Ff(this,FR,"f").help())}let e=Ff(this,p1e,"f").runDefaultBuilderOn(this);if(Xoe(e))return e.then(()=>Ff(this,FR,"f").help())}return Promise.resolve(Ff(this,FR,"f").help())}getOptions(){return Ff(this,f3,"f")}getStrict(){return Ff(this,R8t,"f")}getStrictCommands(){return Ff(this,F8t,"f")}getStrictOptions(){return Ff(this,M8t,"f")}global(e,n){return C6("<string|array> [boolean]",[e,n],arguments.length),e=[].concat(e),n!==!1?Ff(this,f3,"f").local=Ff(this,f3,"f").local.filter(r=>e.indexOf(r)===-1):e.forEach(r=>{Ff(this,f3,"f").local.includes(r)||Ff(this,f3,"f").local.push(r)}),this}group(e,n){C6("<string|array> <string>",[e,n],arguments.length);let r=Ff(this,L8t,"f")[n]||Ff(this,$bt,"f")[n];Ff(this,L8t,"f")[n]&&delete Ff(this,L8t,"f")[n];let u={};return Ff(this,$bt,"f")[n]=(r||[]).concat(e).filter(d=>u[d]?!1:u[d]=!0),this}hide(e){return C6("<string>",[e],arguments.length),Ff(this,f3,"f").hiddenOptions.push(e),this}implies(e,n){return C6("<string|object> [number|string|array]",[e,n],arguments.length),Ff(this,x0e,"f").implies(e,n),this}locale(e){return C6("[string]",[e],arguments.length),e===void 0?(this[Ljn](),Ff(this,FO,"f").y18n.getLocale()):(L6(this,N8t,!1,"f"),Ff(this,FO,"f").y18n.setLocale(e),this)}middleware(e,n,r){return Ff(this,Xft,"f").addMiddleware(e,!!n,r)}nargs(e,n){return C6("<string|object|array> [number]",[e,n],arguments.length),this[L5t](this.nargs.bind(this),"narg",e,n),this}normalize(e){return C6("<array|string>",[e],arguments.length),this[A6t]("normalize",e),this}number(e){return C6("<array|string>",[e],arguments.length),this[A6t]("number",e),this[W8t](e),this}option(e,n){if(C6("<string|object> [object]",[e,n],arguments.length),typeof e=="object")Object.keys(e).forEach(r=>{this.options(r,e[r])});else{typeof n!="object"&&(n={}),this[W8t](e),Ff(this,Xbt,"f")&&(e==="version"||n?.alias==="version")&&this[NFr](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
|
|
774
774
|
`),void 0,"versionWarning"),Ff(this,f3,"f").key[e]=!0,n.alias&&this.alias(e,n.alias);let r=n.deprecate||n.deprecated;r&&this.deprecateOption(e,r);let u=n.demand||n.required||n.require;u&&this.demand(e,u),n.demandOption&&this.demandOption(e,typeof n.demandOption=="string"?n.demandOption:void 0),n.conflicts&&this.conflicts(e,n.conflicts),"default"in n&&this.default(e,n.default),n.implies!==void 0&&this.implies(e,n.implies),n.nargs!==void 0&&this.nargs(e,n.nargs),n.config&&this.config(e,n.configParser),n.normalize&&this.normalize(e),n.choices&&this.choices(e,n.choices),n.coerce&&this.coerce(e,n.coerce),n.group&&this.group(e,n.group),(n.boolean||n.type==="boolean")&&(this.boolean(e),n.alias&&this.boolean(n.alias)),(n.array||n.type==="array")&&(this.array(e),n.alias&&this.array(n.alias)),(n.number||n.type==="number")&&(this.number(e),n.alias&&this.number(n.alias)),(n.string||n.type==="string")&&(this.string(e),n.alias&&this.string(n.alias)),(n.count||n.type==="count")&&this.count(e),typeof n.global=="boolean"&&this.global(e,n.global),n.defaultDescription&&(Ff(this,f3,"f").defaultDescription[e]=n.defaultDescription),n.skipValidation&&this.skipValidation(e);let d=n.describe||n.description||n.desc,h=Ff(this,FR,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(h,e)||typeof d=="string")&&this.describe(e,d),n.hidden&&this.hide(e),n.requiresArg&&this.requiresArg(e)}return this}options(e,n){return this.option(e,n)}parse(e,n,r){C6("[string|array] [function|boolean|object] [function]",[e,n,r],arguments.length),this[OFr](),typeof e>"u"&&(e=Ff(this,C6t,"f")),typeof n=="object"&&(L6(this,O8t,n,"f"),n=r),typeof n=="function"&&(L6(this,cit,n,"f"),n=!1),n||L6(this,C6t,e,"f"),Ff(this,cit,"f")&&L6(this,$ft,!1,"f");let u=this[TJt](e,!!n),d=this.parsed;return Ff(this,Kft,"f").setParsed(this.parsed),Xoe(u)?u.then(h=>(Ff(this,cit,"f")&&Ff(this,cit,"f").call(this,Ff(this,T6t,"f"),h,Ff(this,k6e,"f")),h)).catch(h=>{throw Ff(this,cit,"f")&&Ff(this,cit,"f")(h,this.parsed.argv,Ff(this,k6e,"f")),h}).finally(()=>{this[Wjn](),this.parsed=d}):(Ff(this,cit,"f")&&Ff(this,cit,"f").call(this,Ff(this,T6t,"f"),u,Ff(this,k6e,"f")),this[Wjn](),this.parsed=d,u)}parseAsync(e,n,r){let u=this.parse(e,n,r);return Xoe(u)?u:Promise.resolve(u)}parseSync(e,n,r){let u=this.parse(e,n,r);if(Xoe(u))throw new fre(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return u}parserConfiguration(e){return C6("<object>",[e],arguments.length),L6(this,wcn,e,"f"),this}pkgConf(e,n){C6("<string> [string]",[e,n],arguments.length);let r=null,u=this[Rjn](n||Ff(this,P8t,"f"));return u[e]&&typeof u[e]=="object"&&(r=SJt(u[e],n||Ff(this,P8t,"f"),this[B8t]()["deep-merge-config"]||!1,Ff(this,FO,"f")),Ff(this,f3,"f").configObjects=(Ff(this,f3,"f").configObjects||[]).concat(r)),this}positional(e,n){C6("<string> <object>",[e,n],arguments.length);let r=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];n=S6t(n,(h,D)=>h==="type"&&!["string","number","boolean"].includes(D)?!1:r.includes(h));let u=Ff(this,EJt,"f").fullCommands[Ff(this,EJt,"f").fullCommands.length-1],d=u?Ff(this,p1e,"f").cmdToParseOptions(u):{array:[],alias:{},default:{},demand:{}};return w5t(d).forEach(h=>{let D=d[h];Array.isArray(D)?D.indexOf(e)!==-1&&(n[h]=!0):D[e]&&!(h in n)&&(n[h]=D[e])}),this.group(e,Ff(this,FR,"f").getPositionalGroupName()),this.option(e,n)}recommendCommands(e=!0){return C6("[boolean]",[e],arguments.length),L6(this,kcn,e,"f"),this}required(e,n,r){return this.demand(e,n,r)}require(e,n,r){return this.demand(e,n,r)}requiresArg(e){return C6("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&Ff(this,f3,"f").narg[e]?this:(this[L5t](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,n){return C6("[string] [string]",[e,n],arguments.length),e=e||this.$0,Ff(this,N5t,"f").log(Ff(this,Kft,"f").generateCompletionScript(e,n||Ff(this,ait,"f")||"completion")),this}showHelp(e){if(C6("[string|function]",[e],arguments.length),L6(this,oit,!0,"f"),!Ff(this,FR,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[TJt](Ff(this,C6t,"f"),void 0,void 0,0,!0);if(Xoe(r))return r.then(()=>{Ff(this,FR,"f").showHelp(e)}),this}let n=Ff(this,p1e,"f").runDefaultBuilderOn(this);if(Xoe(n))return n.then(()=>{Ff(this,FR,"f").showHelp(e)}),this}return Ff(this,FR,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,n){return C6("[boolean|string] [string]",[e,n],arguments.length),Ff(this,FR,"f").showHelpOnFail(e,n),this}showVersion(e){return C6("[string|function]",[e],arguments.length),Ff(this,FR,"f").showVersion(e),this}skipValidation(e){return C6("<array|string>",[e],arguments.length),this[A6t]("skipValidation",e),this}strict(e){return C6("[boolean]",[e],arguments.length),L6(this,R8t,e!==!1,"f"),this}strictCommands(e){return C6("[boolean]",[e],arguments.length),L6(this,F8t,e!==!1,"f"),this}strictOptions(e){return C6("[boolean]",[e],arguments.length),L6(this,M8t,e!==!1,"f"),this}string(e){return C6("<array|string>",[e],arguments.length),this[A6t]("string",e),this[W8t](e),this}terminalWidth(){return C6([],0),Ff(this,FO,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return C6("<object>",[e],arguments.length),L6(this,N8t,!1,"f"),Ff(this,FO,"f").y18n.updateLocale(e),this}usage(e,n,r,u){if(C6("<string|null|undefined> [string|boolean] [function|object] [function]",[e,n,r,u],arguments.length),n!==void 0){if(aVe(e,null,Ff(this,FO,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,n,r,u);throw new fre(".usage() description must start with $0 if being used as alias for .command()")}else return Ff(this,FR,"f").usage(e),this}usageConfiguration(e){return C6("<object>",[e],arguments.length),L6(this,Icn,e,"f"),this}version(e,n,r){let u="version";if(C6("[boolean|string] [string] [string]",[e,n,r],arguments.length),Ff(this,Xbt,"f")&&(this[Ojn](Ff(this,Xbt,"f")),Ff(this,FR,"f").version(void 0),L6(this,Xbt,null,"f")),arguments.length===0)r=this[FFr](),e=u;else if(arguments.length===1){if(e===!1)return this;r=e,e=u}else arguments.length===2&&(r=n,n=void 0);return L6(this,Xbt,typeof e=="string"?e:u,"f"),n=n||Ff(this,FR,"f").deferY18nLookup("Show version number"),Ff(this,FR,"f").version(r||void 0),this.boolean(Ff(this,Xbt,"f")),this.describe(Ff(this,Xbt,"f"),n),this}wrap(e){return C6("<number|null|undefined>",[e],arguments.length),Ff(this,FR,"f").wrap(e),this}[(p1e=new WeakMap,P8t=new WeakMap,EJt=new WeakMap,Kft=new WeakMap,ait=new WeakMap,Ecn=new WeakMap,T6t=new WeakMap,N8t=new WeakMap,Tcn=new WeakMap,$ft=new WeakMap,Ccn=new WeakMap,Xft=new WeakMap,$bt=new WeakMap,oit=new WeakMap,Yft=new WeakMap,Acn=new WeakMap,N5t=new WeakMap,k6e=new WeakMap,f3=new WeakMap,Dcn=new WeakMap,wcn=new WeakMap,cit=new WeakMap,O8t=new WeakMap,O5t=new WeakMap,L8t=new WeakMap,C6t=new WeakMap,kcn=new WeakMap,FO=new WeakMap,R8t=new WeakMap,F8t=new WeakMap,M8t=new WeakMap,FR=new WeakMap,Icn=new WeakMap,Xbt=new WeakMap,x0e=new WeakMap,IFr)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[PFr](){return{log:(...e)=>{this[Pcn]()||console.log(...e),L6(this,oit,!0,"f"),Ff(this,k6e,"f").length&&L6(this,k6e,Ff(this,k6e,"f")+`
|
|
775
775
|
`,"f"),L6(this,k6e,Ff(this,k6e,"f")+e.join(" "),"f")},error:(...e)=>{this[Pcn]()||console.error(...e),L6(this,oit,!0,"f"),Ff(this,k6e,"f").length&&L6(this,k6e,Ff(this,k6e,"f")+`
|
|
776
|
-
`,"f"),L6(this,k6e,Ff(this,k6e,"f")+e.join(" "),"f")}}}[Ojn](e){w5t(Ff(this,f3,"f")).forEach(n=>{if((u=>u==="configObjects")(n))return;let r=Ff(this,f3,"f")[n];Array.isArray(r)?r.includes(e)&&r.splice(r.indexOf(e),1):typeof r=="object"&&delete r[e]}),delete Ff(this,FR,"f").getDescriptions()[e]}[NFr](e,n,r){Ff(this,Tcn,"f")[r]||(Ff(this,FO,"f").process.emitWarning(e,n),Ff(this,Tcn,"f")[r]=!0)}[OFr](){Ff(this,Ccn,"f").push({options:Ff(this,f3,"f"),configObjects:Ff(this,f3,"f").configObjects.slice(0),exitProcess:Ff(this,$ft,"f"),groups:Ff(this,$bt,"f"),strict:Ff(this,R8t,"f"),strictCommands:Ff(this,F8t,"f"),strictOptions:Ff(this,M8t,"f"),completionCommand:Ff(this,ait,"f"),output:Ff(this,k6e,"f"),exitError:Ff(this,T6t,"f"),hasOutput:Ff(this,oit,"f"),parsed:this.parsed,parseFn:Ff(this,cit,"f"),parseContext:Ff(this,O8t,"f")}),Ff(this,FR,"f").freeze(),Ff(this,x0e,"f").freeze(),Ff(this,p1e,"f").freeze(),Ff(this,Xft,"f").freeze()}[LFr](){let e="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(Ff(this,FO,"f").process.argv()[0])?n=Ff(this,FO,"f").process.argv().slice(1,2):n=Ff(this,FO,"f").process.argv().slice(0,1),e=n.map(r=>{let u=this[JFr](Ff(this,P8t,"f"),r);return r.match(/^(\/|([a-zA-Z]:)?\\)/)&&u.length<r.length?u:r}).join(" ").trim(),Ff(this,FO,"f").getEnv("_")&&Ff(this,FO,"f").getProcessArgvBin()===Ff(this,FO,"f").getEnv("_")&&(e=Ff(this,FO,"f").getEnv("_").replace(`${Ff(this,FO,"f").path.dirname(Ff(this,FO,"f").process.execPath())}/`,"")),e}[B8t](){return Ff(this,wcn,"f")}[RFr](){return Ff(this,Icn,"f")}[Ljn](){if(!Ff(this,N8t,"f"))return;let e=Ff(this,FO,"f").getEnv("LC_ALL")||Ff(this,FO,"f").getEnv("LC_MESSAGES")||Ff(this,FO,"f").getEnv("LANG")||Ff(this,FO,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[FFr](){return this[Rjn]().version||"unknown"}[MFr](e){let n=e["--"]?e["--"]:e._;for(let r=0,u;(u=n[r])!==void 0;r++)Ff(this,FO,"f").Parser.looksLikeNumber(u)&&Number.isSafeInteger(Math.floor(parseFloat(`${u}`)))&&(n[r]=Number(u));return e}[Rjn](e){let n=e||"*";if(Ff(this,O5t,"f")[n])return Ff(this,O5t,"f")[n];let r={};try{let u=e||Ff(this,FO,"f").mainFilename;!e&&Ff(this,FO,"f").path.extname(u)&&(u=Ff(this,FO,"f").path.dirname(u));let d=Ff(this,FO,"f").findUp(u,(h,D)=>{if(D.includes("package.json"))return"package.json"});aVe(d,void 0,Ff(this,FO,"f")),r=JSON.parse(Ff(this,FO,"f").readFileSync(d,"utf8"))}catch{}return Ff(this,O5t,"f")[n]=r||{},Ff(this,O5t,"f")[n]}[A6t](e,n){n=[].concat(n),n.forEach(r=>{r=this[Bjn](r),Ff(this,f3,"f")[e].push(r)})}[L5t](e,n,r,u){this[Mjn](e,n,r,u,(d,h,D)=>{Ff(this,f3,"f")[d][h]=D})}[Fjn](e,n,r,u){this[Mjn](e,n,r,u,(d,h,D)=>{Ff(this,f3,"f")[d][h]=(Ff(this,f3,"f")[d][h]||[]).concat(D)})}[Mjn](e,n,r,u,d){if(Array.isArray(r))r.forEach(h=>{e(h,u)});else if((h=>typeof h=="object")(r))for(let h of w5t(r))e(h,r[h]);else d(n,this[Bjn](r),u)}[Bjn](e){return e==="__proto__"?"___proto___":e}[jjn](e,n){return this[L5t](this[jjn].bind(this),"key",e,n),this}[Wjn](){var e,n,r,u,d,h,D,I,L,R,$,ne;let ce=Ff(this,Ccn,"f").pop();aVe(ce,void 0,Ff(this,FO,"f"));let ge;e=this,n=this,r=this,u=this,d=this,h=this,D=this,I=this,L=this,R=this,$=this,ne=this,{options:{set value(he){L6(e,f3,he,"f")}}.value,configObjects:ge,exitProcess:{set value(he){L6(n,$ft,he,"f")}}.value,groups:{set value(he){L6(r,$bt,he,"f")}}.value,output:{set value(he){L6(u,k6e,he,"f")}}.value,exitError:{set value(he){L6(d,T6t,he,"f")}}.value,hasOutput:{set value(he){L6(h,oit,he,"f")}}.value,parsed:this.parsed,strict:{set value(he){L6(D,R8t,he,"f")}}.value,strictCommands:{set value(he){L6(I,F8t,he,"f")}}.value,strictOptions:{set value(he){L6(L,M8t,he,"f")}}.value,completionCommand:{set value(he){L6(R,ait,he,"f")}}.value,parseFn:{set value(he){L6($,cit,he,"f")}}.value,parseContext:{set value(he){L6(ne,O8t,he,"f")}}.value}=ce,Ff(this,f3,"f").configObjects=ge,Ff(this,FR,"f").unfreeze(),Ff(this,x0e,"f").unfreeze(),Ff(this,p1e,"f").unfreeze(),Ff(this,Xft,"f").unfreeze()}[BFr](e,n){return I8t(n,r=>(e(r),r))}getInternalMethods(){return{getCommandInstance:this[jFr].bind(this),getContext:this[WFr].bind(this),getHasOutput:this[GFr].bind(this),getLoggerInstance:this[UFr].bind(this),getParseContext:this[VFr].bind(this),getParserConfiguration:this[B8t].bind(this),getUsageConfiguration:this[RFr].bind(this),getUsageInstance:this[zFr].bind(this),getValidationInstance:this[qFr].bind(this),hasParseCallback:this[Pcn].bind(this),isGlobalContext:this[HFr].bind(this),postProcess:this[j8t].bind(this),reset:this[Gjn].bind(this),runValidation:this[Ujn].bind(this),runYargsParserAndExecuteCommands:this[TJt].bind(this),setHasOutput:this[KFr].bind(this)}}[jFr](){return Ff(this,p1e,"f")}[WFr](){return Ff(this,EJt,"f")}[GFr](){return Ff(this,oit,"f")}[UFr](){return Ff(this,N5t,"f")}[VFr](){return Ff(this,O8t,"f")||{}}[zFr](){return Ff(this,FR,"f")}[qFr](){return Ff(this,x0e,"f")}[Pcn](){return!!Ff(this,cit,"f")}[HFr](){return Ff(this,Acn,"f")}[j8t](e,n,r,u){return r||Xoe(e)||(n||(e=this[IFr](e)),(this[B8t]()["parse-positional-numbers"]||this[B8t]()["parse-positional-numbers"]===void 0)&&(e=this[MFr](e)),u&&(e=k8t(e,this,Ff(this,Xft,"f").getMiddleware(),!1))),e}[Gjn](e={}){L6(this,f3,Ff(this,f3,"f")||{},"f");let n={};n.local=Ff(this,f3,"f").local||[],n.configObjects=Ff(this,f3,"f").configObjects||[];let r={};n.local.forEach(h=>{r[h]=!0,(e[h]||[]).forEach(D=>{r[D]=!0})}),Object.assign(Ff(this,L8t,"f"),Object.keys(Ff(this,$bt,"f")).reduce((h,D)=>{let I=Ff(this,$bt,"f")[D].filter(L=>!(L in r));return I.length>0&&(h[D]=I),h},{})),L6(this,$bt,{},"f");let u=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],d=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return u.forEach(h=>{n[h]=(Ff(this,f3,"f")[h]||[]).filter(D=>!r[D])}),d.forEach(h=>{n[h]=S6t(Ff(this,f3,"f")[h],D=>!r[D])}),n.envPrefix=Ff(this,f3,"f").envPrefix,L6(this,f3,n,"f"),L6(this,FR,Ff(this,FR,"f")?Ff(this,FR,"f").reset(r):gFr(this,Ff(this,FO,"f")),"f"),L6(this,x0e,Ff(this,x0e,"f")?Ff(this,x0e,"f").reset(r):DFr(this,Ff(this,FR,"f"),Ff(this,FO,"f")),"f"),L6(this,p1e,Ff(this,p1e,"f")?Ff(this,p1e,"f").reset():_Fr(Ff(this,FR,"f"),Ff(this,x0e,"f"),Ff(this,Xft,"f"),Ff(this,FO,"f")),"f"),Ff(this,Kft,"f")||L6(this,Kft,SFr(this,Ff(this,FR,"f"),Ff(this,p1e,"f"),Ff(this,FO,"f")),"f"),Ff(this,Xft,"f").reset(),L6(this,ait,null,"f"),L6(this,k6e,"","f"),L6(this,T6t,null,"f"),L6(this,oit,!1,"f"),this.parsed=!1,this}[JFr](e,n){return Ff(this,FO,"f").path.relative(e,n)}[TJt](e,n,r,u=0,d=!1){let h=!!r||d;e=e||Ff(this,C6t,"f"),Ff(this,f3,"f").__=Ff(this,FO,"f").y18n.__,Ff(this,f3,"f").configuration=this[B8t]();let D=!!Ff(this,f3,"f").configuration["populate--"],I=Object.assign({},Ff(this,f3,"f").configuration,{"populate--":!0}),L=Ff(this,FO,"f").Parser.detailed(e,Object.assign({},Ff(this,f3,"f"),{configuration:{"parse-positional-numbers":!1,...I}})),R=Object.assign(L.argv,Ff(this,O8t,"f")),$,ne=L.aliases,ce=!1,ge=!1;Object.keys(R).forEach(he=>{he===Ff(this,Yft,"f")&&R[he]?ce=!0:he===Ff(this,Xbt,"f")&&R[he]&&(ge=!0)}),R.$0=this.$0,this.parsed=L,u===0&&Ff(this,FR,"f").clearCachedHelpMessage();try{if(this[Ljn](),n)return this[j8t](R,D,!!r,!1);Ff(this,Yft,"f")&&[Ff(this,Yft,"f")].concat(ne[Ff(this,Yft,"f")]||[]).filter(Jt=>Jt.length>1).includes(""+R._[R._.length-1])&&(R._.pop(),ce=!0),L6(this,Acn,!1,"f");let he=Ff(this,p1e,"f").getCommands(),ke=Ff(this,Kft,"f").completionKey in R,Be=ce||ke||d;if(R._.length){if(he.length){let Ze;for(let Jt=u||0,bt;R._[Jt]!==void 0;Jt++)if(bt=String(R._[Jt]),he.includes(bt)&&bt!==Ff(this,ait,"f")){let An=Ff(this,p1e,"f").runCommand(bt,this,L,Jt+1,d,ce||ge||d);return this[j8t](An,D,!!r,!1)}else if(!Ze&&bt!==Ff(this,ait,"f")){Ze=bt;break}!Ff(this,p1e,"f").hasDefaultCommand()&&Ff(this,kcn,"f")&&Ze&&!Be&&Ff(this,x0e,"f").recommendCommands(Ze,he)}Ff(this,ait,"f")&&R._.includes(Ff(this,ait,"f"))&&!ke&&(Ff(this,$ft,"f")&&E6t(!0),this.showCompletionScript(),this.exit(0))}if(Ff(this,p1e,"f").hasDefaultCommand()&&!Be){let Ze=Ff(this,p1e,"f").runCommand(null,this,L,0,d,ce||ge||d);return this[j8t](Ze,D,!!r,!1)}if(ke){Ff(this,$ft,"f")&&E6t(!0),e=[].concat(e);let Ze=e.slice(e.indexOf(`--${Ff(this,Kft,"f").completionKey}`)+1);return Ff(this,Kft,"f").getCompletion(Ze,(Jt,bt)=>{if(Jt)throw new fre(Jt.message);(bt||[]).forEach(An=>{Ff(this,N5t,"f").log(An)}),this.exit(0)}),this[j8t](R,!D,!!r,!1)}if(Ff(this,oit,"f")||(ce?(Ff(this,$ft,"f")&&E6t(!0),h=!0,this.showHelp("log"),this.exit(0)):ge&&(Ff(this,$ft,"f")&&E6t(!0),h=!0,Ff(this,FR,"f").showVersion("log"),this.exit(0))),!h&&Ff(this,f3,"f").skipValidation.length>0&&(h=Object.keys(R).some(Ze=>Ff(this,f3,"f").skipValidation.indexOf(Ze)>=0&&R[Ze]===!0)),!h){if(L.error)throw new fre(L.error.message);if(!ke){let Ze=this[Ujn](ne,{},L.error);r||($=k8t(R,this,Ff(this,Xft,"f").getMiddleware(),!0)),$=this[BFr](Ze,$??R),Xoe($)&&!r&&($=$.then(()=>k8t(R,this,Ff(this,Xft,"f").getMiddleware(),!1)))}}}catch(he){if(he instanceof fre)Ff(this,FR,"f").fail(he.message,he);else throw he}return this[j8t]($??R,D,!!r,!0)}[Ujn](e,n,r,u){let d={...this.getDemandedOptions()};return h=>{if(r)throw new fre(r.message);Ff(this,x0e,"f").nonOptionCount(h),Ff(this,x0e,"f").requiredArguments(h,d);let D=!1;Ff(this,F8t,"f")&&(D=Ff(this,x0e,"f").unknownCommands(h)),Ff(this,R8t,"f")&&!D?Ff(this,x0e,"f").unknownArguments(h,e,n,!!u):Ff(this,M8t,"f")&&Ff(this,x0e,"f").unknownArguments(h,e,{},!1,!1),Ff(this,x0e,"f").limitedChoices(h),Ff(this,x0e,"f").implications(h),Ff(this,x0e,"f").conflicting(h)}}[KFr](){L6(this,oit,!0,"f")}[W8t](e){if(typeof e=="string")Ff(this,f3,"f").key[e]=!0;else for(let n of e)Ff(this,f3,"f").key[n]=!0}}});var Fxs,XFr,YFr=Ra(()=>{"use strict";xjn();Djn();Fxs=$Fr(vjn),XFr=Fxs});var QFr=Ra(()=>{Njn();gjn();mjn();xjn()});var Ncn,ZFr=Ra(()=>{Ncn="0.11.14"});var R5t,eMr,tMr,nMr,rMr,iMr,sMr,aMr,oMr,cMr,GCt=Ra(()=>{"use strict";x6t();R5t="X-Codemod-Access-Token".toLocaleLowerCase(),eMr=async t=>(await A8e.post("https://backend.codemod.com/validateAccessToken",{},{headers:{[R5t]:t},timeout:5e3})).data,tMr=async(t,e)=>{await A8e.post("https://backend.codemod.com/publish",e,{headers:{[R5t]:t,"Content-Type":"multipart/form-data"},timeout:1e4})},nMr=async(t,e)=>{await A8e.post("https://backend.codemod.com/unpublish",{name:e},{headers:{[R5t]:t},timeout:1e4})},rMr=async t=>{await A8e.delete("https://backend.codemod.com/revokeToken",{headers:{[R5t]:t},timeout:1e4})},iMr=async(t,e)=>{let n=new URL("https://backend.codemod.com/codemods/downloadLink");t&&n.searchParams.set("name",t);let r={};return e&&(r[R5t]=e),(await A8e.get(n.toString(),{headers:r,timeout:1e4})).data},sMr=async t=>{let{accessToken:e,search:n}=t??{},r={};e&&(r[R5t]=e);let u=new URL("https://backend.codemod.com/codemods/list");return n&&u.searchParams.set("search",n),(await A8e.get(u.toString(),{headers:r,timeout:1e4})).data},aMr=async()=>(await A8e.post("https://backend.codemod.com/intents",{})).data,oMr=async(t,e)=>(await A8e.get(`https://backend.codemod.com/intents/${t}?iv=${e}`)).data.token,cMr=async t=>(await A8e.post("https://backend.codemod.com/diffs",{before:t.beforeSnippet,after:t.afterSnippet,source:"cli"})).data});var lMr,uMr,fMr,zjn,F5t,KMe,pMr,Ocn,Lcn,dMr,gWo,lit=Ra(()=>{"use strict";lMr=require("node:child_process"),uMr=require("node:os"),fMr=require("node:path");u1e();$oe();w4t();zjn=ox(require("keytar"),1);GCt();F5t=t=>{let e=process.platform==="win32"?"start":"open",n=[t];try{return(0,lMr.spawnSync)(e,n,{stdio:"ignore",shell:!1}),!0}catch(r){return console.error("Error while opening URL:",r),!1}},KMe=async()=>{let[t]=await zjn.default.findCredentials("codemod.com");if(!g6e(t))return null;let{account:e,password:n}=t,r;try{r=await eMr(n)}catch{return await zjn.default.deletePassword("codemod.com",e),null}return{user:r,token:n}},pMr=(t,e="slug")=>{let n;switch(e){case"slug":n=r=>r.slug;break;case"name":n=r=>r.name;break;case"slug-and-name":n=r=>r.name===r.slug?r.name:`${r.name} (${r.slug})`;break;default:throw new Error("Invalid type")}return t.user.organizations.map(n).filter(g6e)},Ocn=t=>(0,fMr.join)(String(t)==="runOnPreCommit"?process.cwd():(0,uMr.homedir)(),".codemod"),Lcn=async t=>{let{globPattern:e,source:n,errorText:r,onSuccess:u,onFail:d}=t,h=async()=>(await bXe(e,{absolute:!0,ignore:["**/node_modules/**"],cwd:n,nodir:!0})).at(0),D=await h();try{if(await Cse("codemod build",{cwd:n}),D=await h(),D===void 0)throw new Error;u?.()}catch{throw d?.(),new Error(r)}return D},dMr=F_.green("\u2714"),gWo=F_.red("\u2716")});var _Mr,M5t,qjn,Bxs,jxs,mMr,hMr=Ra(()=>{"use strict";_Mr=require("node:crypto"),M5t=require("node:fs/promises"),qjn=require("node:path");lit();Bxs=async t=>{try{let e=await(0,M5t.readFile)((0,qjn.join)(t,"session.json"),"utf-8");return JSON.parse(e).id}catch{return null}},jxs=async t=>{await(0,M5t.mkdir)(t,{recursive:!0});let e=(0,_Mr.randomBytes)(16).toString("hex");return await(0,M5t.writeFile)((0,qjn.join)(t,"session.json"),JSON.stringify({id:e})),e},mMr=async()=>{let t=Ocn(),e=await KMe();if(e!==null)return e.user.userId;let n=await Bxs(t);return n!==null?n:await jxs(t)}});var Hjn,UCt,Rcn,gMr,B5t,yMr,j5t,W5t,vMr,G5t,CJt=Ra(()=>{"use strict";Hjn=require("node:crypto"),UCt=require("node:path");$oe();Rcn=function(t,e,n,r){function u(d){return d instanceof n?d:new n(function(h){h(d)})}return new(n||(n=Promise))(function(d,h){function D(R){try{L(r.next(R))}catch($){h($)}}function I(R){try{L(r.throw(R))}catch($){h($)}}function L(R){R.done?d(R.value):u(R.value).then(D,I)}L((r=r.apply(t,e||[])).next())})},gMr=t=>Rcn(void 0,void 0,void 0,function*(){if(t.kind==="createFile"){let e=yield bzt(t.newPath,t.newData,t.formatWithPrettier);return Object.assign(Object.assign({},t),{newData:e,formatted:!0})}if(t.kind==="updateFile"){let e=yield bzt(t.oldPath,t.newData,t.formatWithPrettier);return t.oldData===e?null:Object.assign(Object.assign({},t),{newData:e,formatted:!0})}return Object.assign(Object.assign({},t),{formatted:!0})}),B5t=t=>Rcn(void 0,void 0,void 0,function*(){return(yield Promise.all(t.map(n=>gMr(n)))).filter(g6e)}),yMr=(t,e)=>Rcn(void 0,void 0,void 0,function*(){if(e.kind==="createFile"){let n=(0,UCt.dirname)(e.newPath);return yield t.promises.mkdir(n,{recursive:!0}),t.promises.writeFile(e.newPath,e.newData)}if(e.kind==="deleteFile")return t.promises.unlink(e.oldPath);if(e.kind==="moveFile")return yield t.promises.copyFile(e.oldPath,e.newPath),t.promises.unlink(e.oldPath);if(e.kind==="updateFile")return t.promises.writeFile(e.oldPath,e.newData);if(e.kind==="copyFile"){let n=(0,UCt.dirname)(e.newPath);return yield t.promises.mkdir(n,{recursive:!0}),t.promises.copyFile(e.oldPath,e.newPath)}}),j5t=(t,e)=>{let n=(0,Hjn.createHash)("md5").update(e.kind).update(e.newPath).update(e.newData).digest("base64url"),r=(0,UCt.extname)(e.newPath);return(0,UCt.join)(t,`${n}${r}`)},W5t=(t,e)=>{let n=(0,Hjn.createHash)("md5").update(e.kind).update(e.oldPath).update(e.newData).digest("base64url"),r=(0,UCt.extname)(e.oldPath);return(0,UCt.join)(t,`${n}${r}`)},vMr=(t,e,n)=>Rcn(void 0,void 0,void 0,function*(){if(n.kind==="createFile"){let r=j5t(e,n);yield t.promises.writeFile(r,n.newData)}if(n.kind==="updateFile"){let r=W5t(e,n);yield t.promises.writeFile(r,n.newData)}}),G5t=(t,e,n)=>e.dryRun===!0?vMr(t,e.outputDirectoryPath,n):yMr(t,n)});var xMr=Ra(()=>{"use strict"});var bMr,Wxs,Gxs,SMr,EMr=Ra(()=>{"use strict";bMr=require("node:fs");LMe();Wxs=Y$([sw("jscodeshift"),sw("filemod"),sw("ts-morph"),sw("ast-grep"),sw("workflow")]),Gxs=nL({_:h0e(yA()),source:f8(yA()),engine:f8(Wxs)}),SMr=t=>{var e,n;let r=Tse(Gxs,t);if(r._.includes("runOnPreCommit"))return{kind:"runOnPreCommit"};let u=r._.at(0);if(r.source)return{kind:"runSourced",source:r.source,engine:(e=r.engine)!==null&&e!==void 0?e:null};if(u&&(0,bMr.existsSync)(u))return{kind:"runSourced",source:u,engine:(n=r.engine)!==null&&n!==void 0?n:null};if(u)return{kind:"runNamed",name:u};throw new Error("Codemod to run was not specified!")}});var TMr,CMr,AMr,Uxs,Jjn,Kjn,$jn,Xjn,Yjn,DMr,wMr,Vxs,kMr,Qjn=Ra(()=>{"use strict";TMr=require("node:path");u1e();LMe();CMr=["*.d.ts","node_modules/",".next/","dist/","build/"],AMr=[".git/",".svn/",".hg/",".bzr/","_darcs/","_MTN/","_FOSSIL_",".fslckout",".view/"],Uxs=process.cwd(),Jjn=!0,Kjn=!0,$jn=!0,Xjn=!1,Yjn=4,DMr=!1,wMr=!0,Vxs=nL({_:h0e(yA()),include:f8(h0e(yA())),exclude:f8(h0e(yA()),[]),target:f8(yA()),files:f8(h0e(yA())),format:f8(v8e(),Jjn),cache:f8(v8e(),Kjn),install:f8(v8e(),$jn),json:f8(v8e(),Xjn),threads:f8(yFt([xbr(0)]),Yjn)}),kMr=(t,e)=>{var n;let r=Tse(Vxs,t),u=r._.at(1),d=r.target,h;return u&&d?(e.printConsoleMessage("info",F_.yellow("Both positional and argument target options are passed. Defaulting to the argument target option...")),h=d):h=(n=u??d)!==null&&n!==void 0?n:Uxs,Object.assign(Object.assign({},r),{target:(0,TMr.resolve)(h)})}});var IMr,PMr,zxs,NMr,OMr=Ra(()=>{"use strict";IMr=require("node:crypto"),PMr=require("node:path");LMe();zxs=Y$([nL({dry:f8(sw(!1),!1)}),nL({dry:sw(!0),output:f8(yA())})]),NMr=(t,e)=>{let n=(0,IMr.randomBytes)(20);return Tse(zxs,e).dry===!1?{dryRun:!1,caseHashDigest:n}:{dryRun:!0,streamingEnabled:!0,outputDirectoryPath:(0,PMr.join)(t,".codemod","cases",n.toString("base64url")),caseHashDigest:n}}});var RMr=Bt((IWo,LMr)=>{var qxs=Object.prototype.toString,Zjn=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function Hxs(t){return qxs.call(t).slice(8,-1)==="ArrayBuffer"}function Jxs(t,e,n){e>>>=0;var r=t.byteLength-e;if(r<0)throw new RangeError("'offset' is out of bounds");if(n===void 0)n=r;else if(n>>>=0,n>r)throw new RangeError("'length' is out of bounds");return Zjn?Buffer.from(t.slice(e,e+n)):new Buffer(new Uint8Array(t.slice(e,e+n)))}function Kxs(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return Zjn?Buffer.from(t,e):new Buffer(t,e)}function $xs(t,e,n){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return Hxs(t)?Jxs(t,e,n):typeof t=="string"?Kxs(t,e):Zjn?Buffer.from(t):new Buffer(t)}LMr.exports=$xs});var wJt=Bt((U8t,rWn)=>{var Xxs=Min().SourceMapConsumer,eWn=require("path"),Ybt;try{Ybt=require("fs"),(!Ybt.existsSync||!Ybt.readFileSync)&&(Ybt=null)}catch{}var Yxs=RMr();function FMr(t,e){return t.require(e)}var MMr=!1,BMr=!1,tWn=!1,AJt="auto",G8t={},DJt={},Qxs=/^data:application\/json[^,]+base64,/,D6t=[],w6t=[];function iWn(){return AJt==="browser"?!0:AJt==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function Zxs(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}function ebs(){return typeof process=="object"&&process!==null?process.version:""}function tbs(){if(typeof process=="object"&&process!==null)return process.stderr}function nbs(t){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(t)}function Fcn(t){return function(e){for(var n=0;n<t.length;n++){var r=t[n](e);if(r)return r}return null}}var sWn=Fcn(D6t);D6t.push(function(t){if(t=t.trim(),/^file:/.test(t)&&(t=t.replace(/file:\/\/\/(\w:)?/,function(r,u){return u?"":"/"})),t in G8t)return G8t[t];var e="";try{if(Ybt)Ybt.existsSync(t)&&(e=Ybt.readFileSync(t,"utf8"));else{var n=new XMLHttpRequest;n.open("GET",t,!1),n.send(null),n.readyState===4&&n.status===200&&(e=n.responseText)}}catch{}return G8t[t]=e});function nWn(t,e){if(!t)return e;var n=eWn.dirname(t),r=/^\w+:\/\/[^\/]*/.exec(n),u=r?r[0]:"",d=n.slice(u.length);return u&&/^\/\w\:/.test(d)?(u+="/",u+eWn.resolve(n.slice(u.length),e).replace(/\\/g,"/")):u+eWn.resolve(n.slice(u.length),e)}function rbs(t){var e;if(iWn())try{var n=new XMLHttpRequest;n.open("GET",t,!1),n.send(null),e=n.readyState===4?n.responseText:null;var r=n.getResponseHeader("SourceMap")||n.getResponseHeader("X-SourceMap");if(r)return r}catch{}e=sWn(t);for(var u=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg,d,h;h=u.exec(e);)d=h;return d?d[1]:null}var aWn=Fcn(w6t);w6t.push(function(t){var e=rbs(t);if(!e)return null;var n;if(Qxs.test(e)){var r=e.slice(e.indexOf(",")+1);n=Yxs(r,"base64").toString(),e=t}else e=nWn(t,e),n=sWn(e);return n?{url:e,map:n}:null});function oWn(t){var e=DJt[t.source];if(!e){var n=aWn(t.source);n?(e=DJt[t.source]={url:n.url,map:new Xxs(n.map)},e.map.sourcesContent&&e.map.sources.forEach(function(u,d){var h=e.map.sourcesContent[d];if(h){var D=nWn(e.url,u);G8t[D]=h}})):e=DJt[t.source]={url:null,map:null}}if(e&&e.map&&typeof e.map.originalPositionFor=="function"){var r=e.map.originalPositionFor(t);if(r.source!==null)return r.source=nWn(e.url,r.source),r}return t}function WMr(t){var e=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(t);if(e){var n=oWn({source:e[2],line:+e[3],column:e[4]-1});return"eval at "+e[1]+" ("+n.source+":"+n.line+":"+(n.column+1)+")"}return e=/^eval at ([^(]+) \((.+)\)$/.exec(t),e?"eval at "+e[1]+" ("+WMr(e[2])+")":t}function ibs(){var t,e="";if(this.isNative())e="native";else{t=this.getScriptNameOrSourceURL(),!t&&this.isEval()&&(e=this.getEvalOrigin(),e+=", "),t?e+=t:e+="<anonymous>";var n=this.getLineNumber();if(n!=null){e+=":"+n;var r=this.getColumnNumber();r&&(e+=":"+r)}}var u="",d=this.getFunctionName(),h=!0,D=this.isConstructor(),I=!(this.isToplevel()||D);if(I){var L=this.getTypeName();L==="[object Object]"&&(L="null");var R=this.getMethodName();d?(L&&d.indexOf(L)!=0&&(u+=L+"."),u+=d,R&&d.indexOf("."+R)!=d.length-R.length-1&&(u+=" [as "+R+"]")):u+=L+"."+(R||"<anonymous>")}else D?u+="new "+(d||"<anonymous>"):d?u+=d:(u+=e,h=!1);return h&&(u+=" ("+e+")"),u}function jMr(t){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(function(n){e[n]=/^(?:is|get)/.test(n)?function(){return t[n].call(t)}:t[n]}),e.toString=ibs,e}function GMr(t,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),t.isNative())return e.curPosition=null,t;var n=t.getFileName()||t.getScriptNameOrSourceURL();if(n){var r=t.getLineNumber(),u=t.getColumnNumber()-1,d=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,h=d.test(ebs())?0:62;r===1&&u>h&&!iWn()&&!t.isEval()&&(u-=h);var D=oWn({source:n,line:r,column:u});e.curPosition=D,t=jMr(t);var I=t.getFunctionName;return t.getFunctionName=function(){return e.nextPosition==null?I():e.nextPosition.name||I()},t.getFileName=function(){return D.source},t.getLineNumber=function(){return D.line},t.getColumnNumber=function(){return D.column+1},t.getScriptNameOrSourceURL=function(){return D.source},t}var L=t.isEval()&&t.getEvalOrigin();return L&&(L=WMr(L),t=jMr(t),t.getEvalOrigin=function(){return L}),t}function sbs(t,e){tWn&&(G8t={},DJt={});for(var n=t.name||"Error",r=t.message||"",u=n+": "+r,d={nextPosition:null,curPosition:null},h=[],D=e.length-1;D>=0;D--)h.push(`
|
|
776
|
+
`,"f"),L6(this,k6e,Ff(this,k6e,"f")+e.join(" "),"f")}}}[Ojn](e){w5t(Ff(this,f3,"f")).forEach(n=>{if((u=>u==="configObjects")(n))return;let r=Ff(this,f3,"f")[n];Array.isArray(r)?r.includes(e)&&r.splice(r.indexOf(e),1):typeof r=="object"&&delete r[e]}),delete Ff(this,FR,"f").getDescriptions()[e]}[NFr](e,n,r){Ff(this,Tcn,"f")[r]||(Ff(this,FO,"f").process.emitWarning(e,n),Ff(this,Tcn,"f")[r]=!0)}[OFr](){Ff(this,Ccn,"f").push({options:Ff(this,f3,"f"),configObjects:Ff(this,f3,"f").configObjects.slice(0),exitProcess:Ff(this,$ft,"f"),groups:Ff(this,$bt,"f"),strict:Ff(this,R8t,"f"),strictCommands:Ff(this,F8t,"f"),strictOptions:Ff(this,M8t,"f"),completionCommand:Ff(this,ait,"f"),output:Ff(this,k6e,"f"),exitError:Ff(this,T6t,"f"),hasOutput:Ff(this,oit,"f"),parsed:this.parsed,parseFn:Ff(this,cit,"f"),parseContext:Ff(this,O8t,"f")}),Ff(this,FR,"f").freeze(),Ff(this,x0e,"f").freeze(),Ff(this,p1e,"f").freeze(),Ff(this,Xft,"f").freeze()}[LFr](){let e="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(Ff(this,FO,"f").process.argv()[0])?n=Ff(this,FO,"f").process.argv().slice(1,2):n=Ff(this,FO,"f").process.argv().slice(0,1),e=n.map(r=>{let u=this[JFr](Ff(this,P8t,"f"),r);return r.match(/^(\/|([a-zA-Z]:)?\\)/)&&u.length<r.length?u:r}).join(" ").trim(),Ff(this,FO,"f").getEnv("_")&&Ff(this,FO,"f").getProcessArgvBin()===Ff(this,FO,"f").getEnv("_")&&(e=Ff(this,FO,"f").getEnv("_").replace(`${Ff(this,FO,"f").path.dirname(Ff(this,FO,"f").process.execPath())}/`,"")),e}[B8t](){return Ff(this,wcn,"f")}[RFr](){return Ff(this,Icn,"f")}[Ljn](){if(!Ff(this,N8t,"f"))return;let e=Ff(this,FO,"f").getEnv("LC_ALL")||Ff(this,FO,"f").getEnv("LC_MESSAGES")||Ff(this,FO,"f").getEnv("LANG")||Ff(this,FO,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[FFr](){return this[Rjn]().version||"unknown"}[MFr](e){let n=e["--"]?e["--"]:e._;for(let r=0,u;(u=n[r])!==void 0;r++)Ff(this,FO,"f").Parser.looksLikeNumber(u)&&Number.isSafeInteger(Math.floor(parseFloat(`${u}`)))&&(n[r]=Number(u));return e}[Rjn](e){let n=e||"*";if(Ff(this,O5t,"f")[n])return Ff(this,O5t,"f")[n];let r={};try{let u=e||Ff(this,FO,"f").mainFilename;!e&&Ff(this,FO,"f").path.extname(u)&&(u=Ff(this,FO,"f").path.dirname(u));let d=Ff(this,FO,"f").findUp(u,(h,D)=>{if(D.includes("package.json"))return"package.json"});aVe(d,void 0,Ff(this,FO,"f")),r=JSON.parse(Ff(this,FO,"f").readFileSync(d,"utf8"))}catch{}return Ff(this,O5t,"f")[n]=r||{},Ff(this,O5t,"f")[n]}[A6t](e,n){n=[].concat(n),n.forEach(r=>{r=this[Bjn](r),Ff(this,f3,"f")[e].push(r)})}[L5t](e,n,r,u){this[Mjn](e,n,r,u,(d,h,D)=>{Ff(this,f3,"f")[d][h]=D})}[Fjn](e,n,r,u){this[Mjn](e,n,r,u,(d,h,D)=>{Ff(this,f3,"f")[d][h]=(Ff(this,f3,"f")[d][h]||[]).concat(D)})}[Mjn](e,n,r,u,d){if(Array.isArray(r))r.forEach(h=>{e(h,u)});else if((h=>typeof h=="object")(r))for(let h of w5t(r))e(h,r[h]);else d(n,this[Bjn](r),u)}[Bjn](e){return e==="__proto__"?"___proto___":e}[jjn](e,n){return this[L5t](this[jjn].bind(this),"key",e,n),this}[Wjn](){var e,n,r,u,d,h,D,I,L,R,$,ne;let ce=Ff(this,Ccn,"f").pop();aVe(ce,void 0,Ff(this,FO,"f"));let ge;e=this,n=this,r=this,u=this,d=this,h=this,D=this,I=this,L=this,R=this,$=this,ne=this,{options:{set value(he){L6(e,f3,he,"f")}}.value,configObjects:ge,exitProcess:{set value(he){L6(n,$ft,he,"f")}}.value,groups:{set value(he){L6(r,$bt,he,"f")}}.value,output:{set value(he){L6(u,k6e,he,"f")}}.value,exitError:{set value(he){L6(d,T6t,he,"f")}}.value,hasOutput:{set value(he){L6(h,oit,he,"f")}}.value,parsed:this.parsed,strict:{set value(he){L6(D,R8t,he,"f")}}.value,strictCommands:{set value(he){L6(I,F8t,he,"f")}}.value,strictOptions:{set value(he){L6(L,M8t,he,"f")}}.value,completionCommand:{set value(he){L6(R,ait,he,"f")}}.value,parseFn:{set value(he){L6($,cit,he,"f")}}.value,parseContext:{set value(he){L6(ne,O8t,he,"f")}}.value}=ce,Ff(this,f3,"f").configObjects=ge,Ff(this,FR,"f").unfreeze(),Ff(this,x0e,"f").unfreeze(),Ff(this,p1e,"f").unfreeze(),Ff(this,Xft,"f").unfreeze()}[BFr](e,n){return I8t(n,r=>(e(r),r))}getInternalMethods(){return{getCommandInstance:this[jFr].bind(this),getContext:this[WFr].bind(this),getHasOutput:this[GFr].bind(this),getLoggerInstance:this[UFr].bind(this),getParseContext:this[VFr].bind(this),getParserConfiguration:this[B8t].bind(this),getUsageConfiguration:this[RFr].bind(this),getUsageInstance:this[zFr].bind(this),getValidationInstance:this[qFr].bind(this),hasParseCallback:this[Pcn].bind(this),isGlobalContext:this[HFr].bind(this),postProcess:this[j8t].bind(this),reset:this[Gjn].bind(this),runValidation:this[Ujn].bind(this),runYargsParserAndExecuteCommands:this[TJt].bind(this),setHasOutput:this[KFr].bind(this)}}[jFr](){return Ff(this,p1e,"f")}[WFr](){return Ff(this,EJt,"f")}[GFr](){return Ff(this,oit,"f")}[UFr](){return Ff(this,N5t,"f")}[VFr](){return Ff(this,O8t,"f")||{}}[zFr](){return Ff(this,FR,"f")}[qFr](){return Ff(this,x0e,"f")}[Pcn](){return!!Ff(this,cit,"f")}[HFr](){return Ff(this,Acn,"f")}[j8t](e,n,r,u){return r||Xoe(e)||(n||(e=this[IFr](e)),(this[B8t]()["parse-positional-numbers"]||this[B8t]()["parse-positional-numbers"]===void 0)&&(e=this[MFr](e)),u&&(e=k8t(e,this,Ff(this,Xft,"f").getMiddleware(),!1))),e}[Gjn](e={}){L6(this,f3,Ff(this,f3,"f")||{},"f");let n={};n.local=Ff(this,f3,"f").local||[],n.configObjects=Ff(this,f3,"f").configObjects||[];let r={};n.local.forEach(h=>{r[h]=!0,(e[h]||[]).forEach(D=>{r[D]=!0})}),Object.assign(Ff(this,L8t,"f"),Object.keys(Ff(this,$bt,"f")).reduce((h,D)=>{let I=Ff(this,$bt,"f")[D].filter(L=>!(L in r));return I.length>0&&(h[D]=I),h},{})),L6(this,$bt,{},"f");let u=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],d=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return u.forEach(h=>{n[h]=(Ff(this,f3,"f")[h]||[]).filter(D=>!r[D])}),d.forEach(h=>{n[h]=S6t(Ff(this,f3,"f")[h],D=>!r[D])}),n.envPrefix=Ff(this,f3,"f").envPrefix,L6(this,f3,n,"f"),L6(this,FR,Ff(this,FR,"f")?Ff(this,FR,"f").reset(r):gFr(this,Ff(this,FO,"f")),"f"),L6(this,x0e,Ff(this,x0e,"f")?Ff(this,x0e,"f").reset(r):DFr(this,Ff(this,FR,"f"),Ff(this,FO,"f")),"f"),L6(this,p1e,Ff(this,p1e,"f")?Ff(this,p1e,"f").reset():_Fr(Ff(this,FR,"f"),Ff(this,x0e,"f"),Ff(this,Xft,"f"),Ff(this,FO,"f")),"f"),Ff(this,Kft,"f")||L6(this,Kft,SFr(this,Ff(this,FR,"f"),Ff(this,p1e,"f"),Ff(this,FO,"f")),"f"),Ff(this,Xft,"f").reset(),L6(this,ait,null,"f"),L6(this,k6e,"","f"),L6(this,T6t,null,"f"),L6(this,oit,!1,"f"),this.parsed=!1,this}[JFr](e,n){return Ff(this,FO,"f").path.relative(e,n)}[TJt](e,n,r,u=0,d=!1){let h=!!r||d;e=e||Ff(this,C6t,"f"),Ff(this,f3,"f").__=Ff(this,FO,"f").y18n.__,Ff(this,f3,"f").configuration=this[B8t]();let D=!!Ff(this,f3,"f").configuration["populate--"],I=Object.assign({},Ff(this,f3,"f").configuration,{"populate--":!0}),L=Ff(this,FO,"f").Parser.detailed(e,Object.assign({},Ff(this,f3,"f"),{configuration:{"parse-positional-numbers":!1,...I}})),R=Object.assign(L.argv,Ff(this,O8t,"f")),$,ne=L.aliases,ce=!1,ge=!1;Object.keys(R).forEach(he=>{he===Ff(this,Yft,"f")&&R[he]?ce=!0:he===Ff(this,Xbt,"f")&&R[he]&&(ge=!0)}),R.$0=this.$0,this.parsed=L,u===0&&Ff(this,FR,"f").clearCachedHelpMessage();try{if(this[Ljn](),n)return this[j8t](R,D,!!r,!1);Ff(this,Yft,"f")&&[Ff(this,Yft,"f")].concat(ne[Ff(this,Yft,"f")]||[]).filter(Jt=>Jt.length>1).includes(""+R._[R._.length-1])&&(R._.pop(),ce=!0),L6(this,Acn,!1,"f");let he=Ff(this,p1e,"f").getCommands(),ke=Ff(this,Kft,"f").completionKey in R,Be=ce||ke||d;if(R._.length){if(he.length){let Ze;for(let Jt=u||0,bt;R._[Jt]!==void 0;Jt++)if(bt=String(R._[Jt]),he.includes(bt)&&bt!==Ff(this,ait,"f")){let An=Ff(this,p1e,"f").runCommand(bt,this,L,Jt+1,d,ce||ge||d);return this[j8t](An,D,!!r,!1)}else if(!Ze&&bt!==Ff(this,ait,"f")){Ze=bt;break}!Ff(this,p1e,"f").hasDefaultCommand()&&Ff(this,kcn,"f")&&Ze&&!Be&&Ff(this,x0e,"f").recommendCommands(Ze,he)}Ff(this,ait,"f")&&R._.includes(Ff(this,ait,"f"))&&!ke&&(Ff(this,$ft,"f")&&E6t(!0),this.showCompletionScript(),this.exit(0))}if(Ff(this,p1e,"f").hasDefaultCommand()&&!Be){let Ze=Ff(this,p1e,"f").runCommand(null,this,L,0,d,ce||ge||d);return this[j8t](Ze,D,!!r,!1)}if(ke){Ff(this,$ft,"f")&&E6t(!0),e=[].concat(e);let Ze=e.slice(e.indexOf(`--${Ff(this,Kft,"f").completionKey}`)+1);return Ff(this,Kft,"f").getCompletion(Ze,(Jt,bt)=>{if(Jt)throw new fre(Jt.message);(bt||[]).forEach(An=>{Ff(this,N5t,"f").log(An)}),this.exit(0)}),this[j8t](R,!D,!!r,!1)}if(Ff(this,oit,"f")||(ce?(Ff(this,$ft,"f")&&E6t(!0),h=!0,this.showHelp("log"),this.exit(0)):ge&&(Ff(this,$ft,"f")&&E6t(!0),h=!0,Ff(this,FR,"f").showVersion("log"),this.exit(0))),!h&&Ff(this,f3,"f").skipValidation.length>0&&(h=Object.keys(R).some(Ze=>Ff(this,f3,"f").skipValidation.indexOf(Ze)>=0&&R[Ze]===!0)),!h){if(L.error)throw new fre(L.error.message);if(!ke){let Ze=this[Ujn](ne,{},L.error);r||($=k8t(R,this,Ff(this,Xft,"f").getMiddleware(),!0)),$=this[BFr](Ze,$??R),Xoe($)&&!r&&($=$.then(()=>k8t(R,this,Ff(this,Xft,"f").getMiddleware(),!1)))}}}catch(he){if(he instanceof fre)Ff(this,FR,"f").fail(he.message,he);else throw he}return this[j8t]($??R,D,!!r,!0)}[Ujn](e,n,r,u){let d={...this.getDemandedOptions()};return h=>{if(r)throw new fre(r.message);Ff(this,x0e,"f").nonOptionCount(h),Ff(this,x0e,"f").requiredArguments(h,d);let D=!1;Ff(this,F8t,"f")&&(D=Ff(this,x0e,"f").unknownCommands(h)),Ff(this,R8t,"f")&&!D?Ff(this,x0e,"f").unknownArguments(h,e,n,!!u):Ff(this,M8t,"f")&&Ff(this,x0e,"f").unknownArguments(h,e,{},!1,!1),Ff(this,x0e,"f").limitedChoices(h),Ff(this,x0e,"f").implications(h),Ff(this,x0e,"f").conflicting(h)}}[KFr](){L6(this,oit,!0,"f")}[W8t](e){if(typeof e=="string")Ff(this,f3,"f").key[e]=!0;else for(let n of e)Ff(this,f3,"f").key[n]=!0}}});var Fxs,XFr,YFr=Ra(()=>{"use strict";xjn();Djn();Fxs=$Fr(vjn),XFr=Fxs});var QFr=Ra(()=>{Njn();gjn();mjn();xjn()});var Ncn,ZFr=Ra(()=>{Ncn="0.11.15"});var R5t,eMr,tMr,nMr,rMr,iMr,sMr,aMr,oMr,cMr,GCt=Ra(()=>{"use strict";x6t();R5t="X-Codemod-Access-Token".toLocaleLowerCase(),eMr=async t=>(await A8e.post("https://backend.codemod.com/validateAccessToken",{},{headers:{[R5t]:t},timeout:5e3})).data,tMr=async(t,e)=>{await A8e.post("https://backend.codemod.com/publish",e,{headers:{[R5t]:t,"Content-Type":"multipart/form-data"},timeout:1e4})},nMr=async(t,e)=>{await A8e.post("https://backend.codemod.com/unpublish",{name:e},{headers:{[R5t]:t},timeout:1e4})},rMr=async t=>{await A8e.delete("https://backend.codemod.com/revokeToken",{headers:{[R5t]:t},timeout:1e4})},iMr=async(t,e)=>{let n=new URL("https://backend.codemod.com/codemods/downloadLink");t&&n.searchParams.set("name",t);let r={};return e&&(r[R5t]=e),(await A8e.get(n.toString(),{headers:r,timeout:1e4})).data},sMr=async t=>{let{accessToken:e,search:n}=t??{},r={};e&&(r[R5t]=e);let u=new URL("https://backend.codemod.com/codemods/list");return n&&u.searchParams.set("search",n),(await A8e.get(u.toString(),{headers:r,timeout:1e4})).data},aMr=async()=>(await A8e.post("https://backend.codemod.com/intents",{})).data,oMr=async(t,e)=>(await A8e.get(`https://backend.codemod.com/intents/${t}?iv=${e}`)).data.token,cMr=async t=>(await A8e.post("https://backend.codemod.com/diffs",{before:t.beforeSnippet,after:t.afterSnippet,source:"cli"})).data});var lMr,uMr,fMr,zjn,F5t,KMe,pMr,Ocn,Lcn,dMr,gWo,lit=Ra(()=>{"use strict";lMr=require("node:child_process"),uMr=require("node:os"),fMr=require("node:path");u1e();$oe();w4t();zjn=ox(require("keytar"),1);GCt();F5t=t=>{let e=process.platform==="win32"?"start":"open",n=[t];try{return(0,lMr.spawnSync)(e,n,{stdio:"ignore",shell:!1}),!0}catch(r){return console.error("Error while opening URL:",r),!1}},KMe=async()=>{let[t]=await zjn.default.findCredentials("codemod.com");if(!g6e(t))return null;let{account:e,password:n}=t,r;try{r=await eMr(n)}catch{return await zjn.default.deletePassword("codemod.com",e),null}return{user:r,token:n}},pMr=(t,e="slug")=>{let n;switch(e){case"slug":n=r=>r.slug;break;case"name":n=r=>r.name;break;case"slug-and-name":n=r=>r.name===r.slug?r.name:`${r.name} (${r.slug})`;break;default:throw new Error("Invalid type")}return t.user.organizations.map(n).filter(g6e)},Ocn=t=>(0,fMr.join)(String(t)==="runOnPreCommit"?process.cwd():(0,uMr.homedir)(),".codemod"),Lcn=async t=>{let{globPattern:e,source:n,errorText:r,onSuccess:u,onFail:d}=t,h=async()=>(await bXe(e,{absolute:!0,ignore:["**/node_modules/**"],cwd:n,nodir:!0})).at(0),D=await h();try{if(await Cse("codemod build",{cwd:n}),D=await h(),D===void 0)throw new Error;u?.()}catch{throw d?.(),new Error(r)}return D},dMr=F_.green("\u2714"),gWo=F_.red("\u2716")});var _Mr,M5t,qjn,Bxs,jxs,mMr,hMr=Ra(()=>{"use strict";_Mr=require("node:crypto"),M5t=require("node:fs/promises"),qjn=require("node:path");lit();Bxs=async t=>{try{let e=await(0,M5t.readFile)((0,qjn.join)(t,"session.json"),"utf-8");return JSON.parse(e).id}catch{return null}},jxs=async t=>{await(0,M5t.mkdir)(t,{recursive:!0});let e=(0,_Mr.randomBytes)(16).toString("hex");return await(0,M5t.writeFile)((0,qjn.join)(t,"session.json"),JSON.stringify({id:e})),e},mMr=async()=>{let t=Ocn(),e=await KMe();if(e!==null)return e.user.userId;let n=await Bxs(t);return n!==null?n:await jxs(t)}});var Hjn,UCt,Rcn,gMr,B5t,yMr,j5t,W5t,vMr,G5t,CJt=Ra(()=>{"use strict";Hjn=require("node:crypto"),UCt=require("node:path");$oe();Rcn=function(t,e,n,r){function u(d){return d instanceof n?d:new n(function(h){h(d)})}return new(n||(n=Promise))(function(d,h){function D(R){try{L(r.next(R))}catch($){h($)}}function I(R){try{L(r.throw(R))}catch($){h($)}}function L(R){R.done?d(R.value):u(R.value).then(D,I)}L((r=r.apply(t,e||[])).next())})},gMr=t=>Rcn(void 0,void 0,void 0,function*(){if(t.kind==="createFile"){let e=yield bzt(t.newPath,t.newData,t.formatWithPrettier);return Object.assign(Object.assign({},t),{newData:e,formatted:!0})}if(t.kind==="updateFile"){let e=yield bzt(t.oldPath,t.newData,t.formatWithPrettier);return t.oldData===e?null:Object.assign(Object.assign({},t),{newData:e,formatted:!0})}return Object.assign(Object.assign({},t),{formatted:!0})}),B5t=t=>Rcn(void 0,void 0,void 0,function*(){return(yield Promise.all(t.map(n=>gMr(n)))).filter(g6e)}),yMr=(t,e)=>Rcn(void 0,void 0,void 0,function*(){if(e.kind==="createFile"){let n=(0,UCt.dirname)(e.newPath);return yield t.promises.mkdir(n,{recursive:!0}),t.promises.writeFile(e.newPath,e.newData)}if(e.kind==="deleteFile")return t.promises.unlink(e.oldPath);if(e.kind==="moveFile")return yield t.promises.copyFile(e.oldPath,e.newPath),t.promises.unlink(e.oldPath);if(e.kind==="updateFile")return t.promises.writeFile(e.oldPath,e.newData);if(e.kind==="copyFile"){let n=(0,UCt.dirname)(e.newPath);return yield t.promises.mkdir(n,{recursive:!0}),t.promises.copyFile(e.oldPath,e.newPath)}}),j5t=(t,e)=>{let n=(0,Hjn.createHash)("md5").update(e.kind).update(e.newPath).update(e.newData).digest("base64url"),r=(0,UCt.extname)(e.newPath);return(0,UCt.join)(t,`${n}${r}`)},W5t=(t,e)=>{let n=(0,Hjn.createHash)("md5").update(e.kind).update(e.oldPath).update(e.newData).digest("base64url"),r=(0,UCt.extname)(e.oldPath);return(0,UCt.join)(t,`${n}${r}`)},vMr=(t,e,n)=>Rcn(void 0,void 0,void 0,function*(){if(n.kind==="createFile"){let r=j5t(e,n);yield t.promises.writeFile(r,n.newData)}if(n.kind==="updateFile"){let r=W5t(e,n);yield t.promises.writeFile(r,n.newData)}}),G5t=(t,e,n)=>e.dryRun===!0?vMr(t,e.outputDirectoryPath,n):yMr(t,n)});var xMr=Ra(()=>{"use strict"});var bMr,Wxs,Gxs,SMr,EMr=Ra(()=>{"use strict";bMr=require("node:fs");LMe();Wxs=Y$([sw("jscodeshift"),sw("filemod"),sw("ts-morph"),sw("ast-grep"),sw("workflow")]),Gxs=nL({_:h0e(yA()),source:f8(yA()),engine:f8(Wxs)}),SMr=t=>{var e,n;let r=Tse(Gxs,t);if(r._.includes("runOnPreCommit"))return{kind:"runOnPreCommit"};let u=r._.at(0);if(r.source)return{kind:"runSourced",source:r.source,engine:(e=r.engine)!==null&&e!==void 0?e:null};if(u&&(0,bMr.existsSync)(u))return{kind:"runSourced",source:u,engine:(n=r.engine)!==null&&n!==void 0?n:null};if(u)return{kind:"runNamed",name:u};throw new Error("Codemod to run was not specified!")}});var TMr,CMr,AMr,Uxs,Jjn,Kjn,$jn,Xjn,Yjn,DMr,wMr,Vxs,kMr,Qjn=Ra(()=>{"use strict";TMr=require("node:path");u1e();LMe();CMr=["*.d.ts","node_modules/",".next/","dist/","build/"],AMr=[".git/",".svn/",".hg/",".bzr/","_darcs/","_MTN/","_FOSSIL_",".fslckout",".view/"],Uxs=process.cwd(),Jjn=!0,Kjn=!0,$jn=!0,Xjn=!1,Yjn=4,DMr=!1,wMr=!0,Vxs=nL({_:h0e(yA()),include:f8(h0e(yA())),exclude:f8(h0e(yA()),[]),target:f8(yA()),files:f8(h0e(yA())),format:f8(v8e(),Jjn),cache:f8(v8e(),Kjn),install:f8(v8e(),$jn),json:f8(v8e(),Xjn),threads:f8(yFt([xbr(0)]),Yjn)}),kMr=(t,e)=>{var n;let r=Tse(Vxs,t),u=r._.at(1),d=r.target,h;return u&&d?(e.printConsoleMessage("info",F_.yellow("Both positional and argument target options are passed. Defaulting to the argument target option...")),h=d):h=(n=u??d)!==null&&n!==void 0?n:Uxs,Object.assign(Object.assign({},r),{target:(0,TMr.resolve)(h)})}});var IMr,PMr,zxs,NMr,OMr=Ra(()=>{"use strict";IMr=require("node:crypto"),PMr=require("node:path");LMe();zxs=Y$([nL({dry:f8(sw(!1),!1)}),nL({dry:sw(!0),output:f8(yA())})]),NMr=(t,e)=>{let n=(0,IMr.randomBytes)(20);return Tse(zxs,e).dry===!1?{dryRun:!1,caseHashDigest:n}:{dryRun:!0,streamingEnabled:!0,outputDirectoryPath:(0,PMr.join)(t,".codemod","cases",n.toString("base64url")),caseHashDigest:n}}});var RMr=Bt((IWo,LMr)=>{var qxs=Object.prototype.toString,Zjn=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function Hxs(t){return qxs.call(t).slice(8,-1)==="ArrayBuffer"}function Jxs(t,e,n){e>>>=0;var r=t.byteLength-e;if(r<0)throw new RangeError("'offset' is out of bounds");if(n===void 0)n=r;else if(n>>>=0,n>r)throw new RangeError("'length' is out of bounds");return Zjn?Buffer.from(t.slice(e,e+n)):new Buffer(new Uint8Array(t.slice(e,e+n)))}function Kxs(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return Zjn?Buffer.from(t,e):new Buffer(t,e)}function $xs(t,e,n){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return Hxs(t)?Jxs(t,e,n):typeof t=="string"?Kxs(t,e):Zjn?Buffer.from(t):new Buffer(t)}LMr.exports=$xs});var wJt=Bt((U8t,rWn)=>{var Xxs=Min().SourceMapConsumer,eWn=require("path"),Ybt;try{Ybt=require("fs"),(!Ybt.existsSync||!Ybt.readFileSync)&&(Ybt=null)}catch{}var Yxs=RMr();function FMr(t,e){return t.require(e)}var MMr=!1,BMr=!1,tWn=!1,AJt="auto",G8t={},DJt={},Qxs=/^data:application\/json[^,]+base64,/,D6t=[],w6t=[];function iWn(){return AJt==="browser"?!0:AJt==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function Zxs(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}function ebs(){return typeof process=="object"&&process!==null?process.version:""}function tbs(){if(typeof process=="object"&&process!==null)return process.stderr}function nbs(t){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(t)}function Fcn(t){return function(e){for(var n=0;n<t.length;n++){var r=t[n](e);if(r)return r}return null}}var sWn=Fcn(D6t);D6t.push(function(t){if(t=t.trim(),/^file:/.test(t)&&(t=t.replace(/file:\/\/\/(\w:)?/,function(r,u){return u?"":"/"})),t in G8t)return G8t[t];var e="";try{if(Ybt)Ybt.existsSync(t)&&(e=Ybt.readFileSync(t,"utf8"));else{var n=new XMLHttpRequest;n.open("GET",t,!1),n.send(null),n.readyState===4&&n.status===200&&(e=n.responseText)}}catch{}return G8t[t]=e});function nWn(t,e){if(!t)return e;var n=eWn.dirname(t),r=/^\w+:\/\/[^\/]*/.exec(n),u=r?r[0]:"",d=n.slice(u.length);return u&&/^\/\w\:/.test(d)?(u+="/",u+eWn.resolve(n.slice(u.length),e).replace(/\\/g,"/")):u+eWn.resolve(n.slice(u.length),e)}function rbs(t){var e;if(iWn())try{var n=new XMLHttpRequest;n.open("GET",t,!1),n.send(null),e=n.readyState===4?n.responseText:null;var r=n.getResponseHeader("SourceMap")||n.getResponseHeader("X-SourceMap");if(r)return r}catch{}e=sWn(t);for(var u=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg,d,h;h=u.exec(e);)d=h;return d?d[1]:null}var aWn=Fcn(w6t);w6t.push(function(t){var e=rbs(t);if(!e)return null;var n;if(Qxs.test(e)){var r=e.slice(e.indexOf(",")+1);n=Yxs(r,"base64").toString(),e=t}else e=nWn(t,e),n=sWn(e);return n?{url:e,map:n}:null});function oWn(t){var e=DJt[t.source];if(!e){var n=aWn(t.source);n?(e=DJt[t.source]={url:n.url,map:new Xxs(n.map)},e.map.sourcesContent&&e.map.sources.forEach(function(u,d){var h=e.map.sourcesContent[d];if(h){var D=nWn(e.url,u);G8t[D]=h}})):e=DJt[t.source]={url:null,map:null}}if(e&&e.map&&typeof e.map.originalPositionFor=="function"){var r=e.map.originalPositionFor(t);if(r.source!==null)return r.source=nWn(e.url,r.source),r}return t}function WMr(t){var e=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(t);if(e){var n=oWn({source:e[2],line:+e[3],column:e[4]-1});return"eval at "+e[1]+" ("+n.source+":"+n.line+":"+(n.column+1)+")"}return e=/^eval at ([^(]+) \((.+)\)$/.exec(t),e?"eval at "+e[1]+" ("+WMr(e[2])+")":t}function ibs(){var t,e="";if(this.isNative())e="native";else{t=this.getScriptNameOrSourceURL(),!t&&this.isEval()&&(e=this.getEvalOrigin(),e+=", "),t?e+=t:e+="<anonymous>";var n=this.getLineNumber();if(n!=null){e+=":"+n;var r=this.getColumnNumber();r&&(e+=":"+r)}}var u="",d=this.getFunctionName(),h=!0,D=this.isConstructor(),I=!(this.isToplevel()||D);if(I){var L=this.getTypeName();L==="[object Object]"&&(L="null");var R=this.getMethodName();d?(L&&d.indexOf(L)!=0&&(u+=L+"."),u+=d,R&&d.indexOf("."+R)!=d.length-R.length-1&&(u+=" [as "+R+"]")):u+=L+"."+(R||"<anonymous>")}else D?u+="new "+(d||"<anonymous>"):d?u+=d:(u+=e,h=!1);return h&&(u+=" ("+e+")"),u}function jMr(t){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(function(n){e[n]=/^(?:is|get)/.test(n)?function(){return t[n].call(t)}:t[n]}),e.toString=ibs,e}function GMr(t,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),t.isNative())return e.curPosition=null,t;var n=t.getFileName()||t.getScriptNameOrSourceURL();if(n){var r=t.getLineNumber(),u=t.getColumnNumber()-1,d=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,h=d.test(ebs())?0:62;r===1&&u>h&&!iWn()&&!t.isEval()&&(u-=h);var D=oWn({source:n,line:r,column:u});e.curPosition=D,t=jMr(t);var I=t.getFunctionName;return t.getFunctionName=function(){return e.nextPosition==null?I():e.nextPosition.name||I()},t.getFileName=function(){return D.source},t.getLineNumber=function(){return D.line},t.getColumnNumber=function(){return D.column+1},t.getScriptNameOrSourceURL=function(){return D.source},t}var L=t.isEval()&&t.getEvalOrigin();return L&&(L=WMr(L),t=jMr(t),t.getEvalOrigin=function(){return L}),t}function sbs(t,e){tWn&&(G8t={},DJt={});for(var n=t.name||"Error",r=t.message||"",u=n+": "+r,d={nextPosition:null,curPosition:null},h=[],D=e.length-1;D>=0;D--)h.push(`
|
|
777
777
|
at `+GMr(e[D],d)),d.nextPosition=d.curPosition;return d.curPosition=d.nextPosition=null,u+h.reverse().join("")}function UMr(t){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(t.stack);if(e){var n=e[1],r=+e[2],u=+e[3],d=G8t[n];if(!d&&Ybt&&Ybt.existsSync(n))try{d=Ybt.readFileSync(n,"utf8")}catch{d=""}if(d){var h=d.split(/(?:\r\n|\r|\n)/)[r-1];if(h)return n+":"+r+`
|
|
778
778
|
`+h+`
|
|
779
779
|
`+new Array(u).join(" ")+"^"}}return null}function abs(t){var e=UMr(t),n=tbs();n&&n._handle&&n._handle.setBlocking&&n._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(t.stack),nbs(1)}function obs(){var t=process.emit;process.emit=function(e){if(e==="uncaughtException"){var n=arguments[1]&&arguments[1].stack,r=this.listeners(e).length>0;if(n&&!r)return abs(arguments[1])}return t.apply(this,arguments)}}var cbs=D6t.slice(0),lbs=w6t.slice(0);U8t.wrapCallSite=GMr;U8t.getErrorSource=UMr;U8t.mapSourcePosition=oWn;U8t.retrieveSourceMap=aWn;U8t.install=function(t){if(t=t||{},t.environment&&(AJt=t.environment,["node","browser","auto"].indexOf(AJt)===-1))throw new Error("environment "+AJt+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(D6t.length=0),D6t.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(w6t.length=0),w6t.unshift(t.retrieveSourceMap)),t.hookRequire&&!iWn()){var e=FMr(rWn,"module"),n=e.prototype._compile;n.__sourceMapSupport||(e.prototype._compile=function(d,h){return G8t[h]=d,DJt[h]=void 0,n.call(this,d,h)},e.prototype._compile.__sourceMapSupport=!0)}if(tWn||(tWn="emptyCacheBetweenOperations"in t?t.emptyCacheBetweenOperations:!1),MMr||(MMr=!0,Error.prepareStackTrace=sbs),!BMr){var r="handleUncaughtExceptions"in t?t.handleUncaughtExceptions:!0;try{var u=FMr(rWn,"worker_threads");u.isMainThread===!1&&(r=!1)}catch{}r&&Zxs()&&(BMr=!0,obs())}};U8t.resetRetrieveHandlers=function(){D6t.length=0,w6t.length=0,D6t=cbs.slice(0),w6t=lbs.slice(0),aWn=Fcn(w6t),sWn=Fcn(D6t)}});var XMr=Bt((PWo,kJt)=>{"use strict";/*! *****************************************************************************
|
|
@@ -54837,7 +54837,7 @@ Soon, we will support other engines and hence other extensions including .md, .m
|
|
|
54837
54837
|
`))}e.printConsoleMessage("info",(0,Iji.default)(d,{headingTransform:h=>F_.bold(h.toLocaleUpperCase())})),e.printConsoleMessage("info",F_.cyan(wyt.isSupported?`
|
|
54838
54838
|
Click on the name of the codemod to visit its documentation page.`:F_(`
|
|
54839
54839
|
Visit`,F_.bold("https://codemod.com/registry"),"to see the full list of codemods and their documentation.")))}});var Oji=Bt(Jtn=>{"use strict";var X3n=Jtn&&Jtn.__assign||function(){return X3n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var u in e)Object.prototype.hasOwnProperty.call(e,u)&&(t[u]=e[u])}return t},X3n.apply(this,arguments)};Object.defineProperty(Jtn,"__esModule",{value:!0});var qTo={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function HTo(t){var e=X3n(X3n({},qTo),t);return e.numOfAttempts<1&&(e.numOfAttempts=1),e}Jtn.getSanitizedOptions=HTo});var Lji=Bt(ogr=>{"use strict";Object.defineProperty(ogr,"__esModule",{value:!0});function JTo(t){var e=Math.random()*t;return Math.round(e)}ogr.fullJitter=JTo});var Rji=Bt(cgr=>{"use strict";Object.defineProperty(cgr,"__esModule",{value:!0});function KTo(t){return t}cgr.noJitter=KTo});var Fji=Bt(lgr=>{"use strict";Object.defineProperty(lgr,"__esModule",{value:!0});var $To=Lji(),XTo=Rji();function YTo(t){switch(t.jitter){case"full":return $To.fullJitter;case"none":default:return XTo.noJitter}}lgr.JitterFactory=YTo});var fgr=Bt(ugr=>{"use strict";Object.defineProperty(ugr,"__esModule",{value:!0});var QTo=Fji(),ZTo=function(){function t(e){this.options=e,this.attempt=0}return t.prototype.apply=function(){var e=this;return new Promise(function(n){return setTimeout(n,e.jitteredDelay)})},t.prototype.setAttemptNumber=function(e){this.attempt=e},Object.defineProperty(t.prototype,"jitteredDelay",{get:function(){var e=QTo.JitterFactory(this.options);return e(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"delay",{get:function(){var e=this.options.startingDelay,n=this.options.timeMultiple,r=this.numOfDelayedAttempts,u=e*Math.pow(n,r);return Math.min(u,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),t}();ugr.Delay=ZTo});var Mji=Bt(BDt=>{"use strict";var eCo=BDt&&BDt.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,u){r.__proto__=u}||function(r,u){for(var d in u)u.hasOwnProperty(d)&&(r[d]=u[d])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),tCo=BDt&&BDt.__awaiter||function(t,e,n,r){function u(d){return d instanceof n?d:new n(function(h){h(d)})}return new(n||(n=Promise))(function(d,h){function D(R){try{L(r.next(R))}catch($){h($)}}function I(R){try{L(r.throw(R))}catch($){h($)}}function L(R){R.done?d(R.value):u(R.value).then(D,I)}L((r=r.apply(t,e||[])).next())})},nCo=BDt&&BDt.__generator||function(t,e){var n={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},r,u,d,h;return h={next:D(0),throw:D(1),return:D(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function D(L){return function(R){return I([L,R])}}function I(L){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,u&&(d=L[0]&2?u.return:L[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,L[1])).done)return d;switch(u=0,d&&(L=[L[0]&2,d.value]),L[0]){case 0:case 1:d=L;break;case 4:return n.label++,{value:L[1],done:!1};case 5:n.label++,u=L[1],L=[0];continue;case 7:L=n.ops.pop(),n.trys.pop();continue;default:if(d=n.trys,!(d=d.length>0&&d[d.length-1])&&(L[0]===6||L[0]===2)){n=0;continue}if(L[0]===3&&(!d||L[1]>d[0]&&L[1]<d[3])){n.label=L[1];break}if(L[0]===6&&n.label<d[1]){n.label=d[1],d=L;break}if(d&&n.label<d[2]){n.label=d[2],n.ops.push(L);break}d[2]&&n.ops.pop(),n.trys.pop();continue}L=e.call(t,n)}catch(R){L=[6,R],u=0}finally{r=d=0}if(L[0]&5)throw L[1];return{value:L[0]?L[1]:void 0,done:!0}}};Object.defineProperty(BDt,"__esModule",{value:!0});var rCo=fgr(),iCo=function(t){eCo(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.apply=function(){return tCo(this,void 0,void 0,function(){return nCo(this,function(n){return[2,this.isFirstAttempt?!0:t.prototype.apply.call(this)]})})},Object.defineProperty(e.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),e}(rCo.Delay);BDt.SkipFirstDelay=iCo});var Bji=Bt(Ktn=>{"use strict";var sCo=Ktn&&Ktn.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,u){r.__proto__=u}||function(r,u){for(var d in u)u.hasOwnProperty(d)&&(r[d]=u[d])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Ktn,"__esModule",{value:!0});var aCo=fgr(),oCo=function(t){sCo(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(aCo.Delay);Ktn.AlwaysDelay=oCo});var jji=Bt(pgr=>{"use strict";Object.defineProperty(pgr,"__esModule",{value:!0});var cCo=Mji(),lCo=Bji();function uCo(t,e){var n=fCo(t);return n.setAttemptNumber(e),n}pgr.DelayFactory=uCo;function fCo(t){return t.delayFirstAttempt?new lCo.AlwaysDelay(t):new cCo.SkipFirstDelay(t)}});var Wji=Bt(SRt=>{"use strict";var dgr=SRt&&SRt.__awaiter||function(t,e,n,r){function u(d){return d instanceof n?d:new n(function(h){h(d)})}return new(n||(n=Promise))(function(d,h){function D(R){try{L(r.next(R))}catch($){h($)}}function I(R){try{L(r.throw(R))}catch($){h($)}}function L(R){R.done?d(R.value):u(R.value).then(D,I)}L((r=r.apply(t,e||[])).next())})},_gr=SRt&&SRt.__generator||function(t,e){var n={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},r,u,d,h;return h={next:D(0),throw:D(1),return:D(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function D(L){return function(R){return I([L,R])}}function I(L){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,u&&(d=L[0]&2?u.return:L[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,L[1])).done)return d;switch(u=0,d&&(L=[L[0]&2,d.value]),L[0]){case 0:case 1:d=L;break;case 4:return n.label++,{value:L[1],done:!1};case 5:n.label++,u=L[1],L=[0];continue;case 7:L=n.ops.pop(),n.trys.pop();continue;default:if(d=n.trys,!(d=d.length>0&&d[d.length-1])&&(L[0]===6||L[0]===2)){n=0;continue}if(L[0]===3&&(!d||L[1]>d[0]&&L[1]<d[3])){n.label=L[1];break}if(L[0]===6&&n.label<d[1]){n.label=d[1],d=L;break}if(d&&n.label<d[2]){n.label=d[2],n.ops.push(L);break}d[2]&&n.ops.pop(),n.trys.pop();continue}L=e.call(t,n)}catch(R){L=[6,R],u=0}finally{r=d=0}if(L[0]&5)throw L[1];return{value:L[0]?L[1]:void 0,done:!0}}};Object.defineProperty(SRt,"__esModule",{value:!0});var pCo=Oji(),dCo=jji();function _Co(t,e){return e===void 0&&(e={}),dgr(this,void 0,void 0,function(){var n,r;return _gr(this,function(u){switch(u.label){case 0:return n=pCo.getSanitizedOptions(e),r=new mCo(t,n),[4,r.execute()];case 1:return[2,u.sent()]}})})}SRt.backOff=_Co;var mCo=function(){function t(e,n){this.request=e,this.options=n,this.attemptNumber=0}return t.prototype.execute=function(){return dgr(this,void 0,void 0,function(){var e,n;return _gr(this,function(r){switch(r.label){case 0:if(this.attemptLimitReached)return[3,7];r.label=1;case 1:return r.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return r.sent(),[4,this.request()];case 3:return[2,r.sent()];case 4:return e=r.sent(),this.attemptNumber++,[4,this.options.retry(e,this.attemptNumber)];case 5:if(n=r.sent(),!n||this.attemptLimitReached)throw e;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(t.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),t.prototype.applyDelay=function(){return dgr(this,void 0,void 0,function(){var e;return _gr(this,function(n){switch(n.label){case 0:return e=dCo.DelayFactory(this.options,this.attemptNumber),[4,e.apply()];case 1:return n.sent(),[2]}})})},t}()});var Gji,Uji,hCo,gCo,Vji,zji=Ra(()=>{"use strict";u1e();Gji=ox(Wji(),1),Uji=ox(require("keytar"),1);GCt();lit();hCo="accessTokenRequestedByCLI",gCo=(t,e,n)=>{F5t(`https://codemod.com?command=${hCo}&sessionId=${e}&iv=${n}`)||t.printOperationMessage({kind:"error",message:"An unexpected error occurred while redirecting to the sign-in page. Please submit a GitHub issue (github.com/codemod-com/codemod/issues/new) or report it to us (codemod.com/community)."})},Vji=async t=>{let{printer:e}=t;if(await KMe()!==null){e.printConsoleMessage("info",F_.bold.cyan("You're already logged in."));return}let{id:r,iv:u}=await aMr();gCo(e,r,u);let d=e.withLoaderMessage(F_.cyan("Redirecting to Codemod sign-in page"));try{let h=await(0,Gji.backOff)(()=>oMr(r,u),{numOfAttempts:60,startingDelay:1e3,timeMultiple:1});await Uji.default.setPassword("codemod.com","user-account",h),d.succeed(),e.printConsoleMessage("info",F_.bold.cyan("You are successfully logged in."))}catch{throw d.fail(),new Error("Could not validate access token. Please try again.")}}});var qji,Hji=Ra(()=>{"use strict";GCt();lit();qji=async t=>{let{printer:e}=t,n=await KMe();if(n===null){e.printConsoleMessage("info","You are already logged out.");return}try{await rMr(n.token)}catch{}e.printConsoleMessage("info","You have been successfully logged out.")}});var gVt,jDt,Jji,Kji,$ji=Ra(()=>{"use strict";gVt=ox(require("node:fs"),1),jDt=require("node:path");u1e();$oe();x6t();Jji=ox(Ton(),1);w4t();tRt();GCt();lit();dmr();Kji=async t=>{let{printer:e}=t,{source:n}=t,r=await KMe();if(r===null)throw new Error("To be able to publish to Codemod Registry, please log in first.");let{token:u}=r,d=new Jji.default,h=!1,D;try{D=await gVt.promises.readFile((0,jDt.join)(n,".codemodrc.json"))}catch{let{init:ne}=await Q6e.prompt({type:"confirm",name:"init",message:"Could not find the .codemodrc.json file in the codemod directory. Would you like to initialize the codemod configuration now?"});if(!ne)throw new Error("To publish your codemod, please configure it first by running `codemod init` in the codemod directory.");let ce;if(await gVt.promises.lstat(n).then(Be=>Be.isFile()))h=!0,ce=(0,jDt.basename)(n),n=(0,jDt.dirname)(n);else{let{mainPath:Be}=await Q6e.prompt({type:"input",name:"mainPath",message:"If there is a main codemod file, please provide the relative path leading to it, e.g. `src/index.ts`.",default:"empty"});Be!=="empty"&&(ce=Be)}let he=await bwn({printer:e,target:n,mainFilePath:ce??"index.ts"}),{choice:ke}=await Q6e.prompt({name:"choice",type:"list",message:"Would you like to adjust the README description file before publishing?",choices:["Yes, I want to refine the README.md file and configuration before publishing","No, I want to publish without a description and configuration adjustments"],default:0});if(ke.startsWith("Yes")){e.printConsoleMessage("info",F_.cyan(`
|
|
54840
|
-
Selected to adjust the README.md file and configuration before publishing. Aborting...`));return}if(!ce){e.printConsoleMessage("info","Codemod initialization has been completed, however no main file was provided. Consider adjusting the main file for the codemod to become meaningful first.");return}if(!he)throw new Error("Unexpected error, codemod package initialization has been canceled.");n=he;try{D=await gVt.promises.readFile((0,jDt.join)(he,".codemodrc.json"))}catch{throw new Error("Unexpected error, codemodrc file could not be found after codemod package initialization has been completed.")}}if(!h)try{let $=await gVt.promises.readFile((0,jDt.join)(n,"README.md"));d.append("
|
|
54840
|
+
Selected to adjust the README.md file and configuration before publishing. Aborting...`));return}if(!ce){e.printConsoleMessage("info","Codemod initialization has been completed, however no main file was provided. Consider adjusting the main file for the codemod to become meaningful first.");return}if(!he)throw new Error("Unexpected error, codemod package initialization has been canceled.");n=he;try{D=await gVt.promises.readFile((0,jDt.join)(he,".codemodrc.json"))}catch{throw new Error("Unexpected error, codemodrc file could not be found after codemod package initialization has been completed.")}}if(!h)try{let $=await gVt.promises.readFile((0,jDt.join)(n,"README.md"));d.append("description.md",$)}catch{e.printConsoleMessage("info",F_.cyan("Could not locate README file at",`${F_.bold((0,jDt.join)(n,"README.md"))}.`,"Skipping README upload..."))}d.append(".codemodrc.json",D);let I=D.toString("utf-8"),L=vXe(JSON.parse(I));if(L.engine==="recipe"){if(L.names.length<2)throw new Error('The "names" field in .codemodrc.json must contain at least two names for a recipe codemod.');for(let $ of L.names)if(!Gzt.test($))throw new Error('Each entry in the "names" field in .codemodrc.json must only contain allowed characters (a-z, A-Z, 0-9, _, /, @ or -)')}if(!Gzt.test(L.name))throw new Error('The "name" field in .codemodrc.json must only contain allowed characters (a-z, A-Z, 0-9, _, /, @ or -)');if(L.engine!=="recipe"){let $,ne,ce;switch(L.engine){case"ast-grep":$="**/rule.yaml",ne="rule.yaml",ce='Please create the main "rule.yaml" file first.';break;case"piranha":$="**/rules.toml",ne="rules.toml",ce='Please create the main "rules.toml" file first.';break;default:if($="dist/index.cjs",ne="index.cjs",L.build?.input&&(await bXe(L.build.input,{absolute:!0,cwd:n,nodir:!0})).at(0)===void 0){ce=`Please create the main file under ${F_.bold(L.build.input)} first.`;break}if(L.build?.output){ce=`Please make sure the output path in your .codemodrc.json under ${F_.bold(L.build.output)} flag is correct.`;break}ce="Please make sure your codemod can be built correctly."}let ge=e.withLoaderMessage(F_.cyan("Rebuilding the codemod before publishing...")),he=await Lcn({globPattern:L.build?.output??$,source:n,errorText:`Could not find the main file of the codemod. ${ce}`,onSuccess:()=>ge.succeed(),onFail:()=>ge.fail()}),ke=await gVt.promises.readFile(he);d.append(ne,ke)}let R=e.withLoaderMessage(F_.cyan("Publishing the codemod using name from",F_.bold(".codemodrc.json"),"file:",F_.bold(KU(L.name))));try{await tMr(u,d),R.succeed()}catch($){R.fail();let ne=$ instanceof v6t?$.response?.data.error:String($),ce=`${F_.bold(`Could not publish the "${L.name}" codemod`)}:
|
|
54841
54841
|
${ne}`;e.printOperationMessage({kind:"error",message:ce});return}return e.printConsoleMessage("info",F_.bold(F_.cyan(`Codemod was successfully published to the registry under the name "${L.name}".`))),e.printConsoleMessage("info",`
|
|
54842
54842
|
Now, you can run the codemod anywhere:
|
|
54843
54843
|
${F_.bold(`$ codemod ${L.name}`)}`),L}});var ERt=Bt((gNc,ggr)=>{var mgr=function(){"use strict";return this===void 0}();mgr?ggr.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:mgr,propertyIsWritable:function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!!(!n||n.writable||n.set)}}:(Xji={}.hasOwnProperty,Yji={}.toString,Qji={}.constructor.prototype,hgr=function(t){var e=[];for(var n in t)Xji.call(t,n)&&e.push(n);return e},Zji=function(t,e){return{value:t[e]}},eWi=function(t,e,n){return t[e]=n.value,t},tWi=function(t){return t},nWi=function(t){try{return Object(t).constructor.prototype}catch{return Qji}},rWi=function(t){try{return Yji.call(t)==="[object Array]"}catch{return!1}},ggr.exports={isArray:rWi,keys:hgr,names:hgr,defineProperty:eWi,getDescriptor:Zji,freeze:tWi,getPrototypeOf:nWi,isES5:mgr,propertyIsWritable:function(){return!0}});var Xji,Yji,Qji,hgr,Zji,eWi,tWi,nWi,rWi});var Ere=Bt((exports,module)=>{"use strict";var es5=ERt(),canEvaluate=typeof navigator>"u",errorObj={e:{}},tryCatchTarget,globalObject=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:exports!==void 0?exports:null;function tryCatcher(){try{var t=tryCatchTarget;return tryCatchTarget=null,t.apply(this,arguments)}catch(e){return errorObj.e=e,errorObj}}function tryCatch(t){return tryCatchTarget=t,tryCatcher}var inherits=function(t,e){var n={}.hasOwnProperty;function r(){this.constructor=t,this.constructor$=e;for(var u in e.prototype)n.call(e.prototype,u)&&u.charAt(u.length-1)!=="$"&&(this[u+"$"]=e.prototype[u])}return r.prototype=e.prototype,t.prototype=new r,t.prototype};function isPrimitive(t){return t==null||t===!0||t===!1||typeof t=="string"||typeof t=="number"}function isObject(t){return typeof t=="function"||typeof t=="object"&&t!==null}function maybeWrapAsError(t){return isPrimitive(t)?new Error(safeToString(t)):t}function withAppended(t,e){var n=t.length,r=new Array(n+1),u;for(u=0;u<n;++u)r[u]=t[u];return r[u]=e,r}function getDataPropertyOrDefault(t,e,n){if(es5.isES5){var r=Object.getOwnPropertyDescriptor(t,e);if(r!=null)return r.get==null&&r.set==null?r.value:n}else return{}.hasOwnProperty.call(t,e)?t[e]:void 0}function notEnumerableProp(t,e,n){if(isPrimitive(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return es5.defineProperty(t,e,r),t}function thrower(t){throw t}var inheritedDataKeys=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(u){for(var d=0;d<t.length;++d)if(t[d]===u)return!0;return!1};if(es5.isES5){var n=Object.getOwnPropertyNames;return function(u){for(var d=[],h=Object.create(null);u!=null&&!e(u);){var D;try{D=n(u)}catch{return d}for(var I=0;I<D.length;++I){var L=D[I];if(!h[L]){h[L]=!0;var R=Object.getOwnPropertyDescriptor(u,L);R!=null&&R.get==null&&R.set==null&&d.push(L)}}u=es5.getPrototypeOf(u)}return d}}else{var r={}.hasOwnProperty;return function(u){if(e(u))return[];var d=[];e:for(var h in u)if(r.call(u,h))d.push(h);else{for(var D=0;D<t.length;++D)if(r.call(t[D],h))continue e;d.push(h)}return d}}}(),thisAssignmentPattern=/this\s*\.\s*\S+\s*=/;function isClass(t){try{if(typeof t=="function"){var e=es5.names(t.prototype),n=es5.isES5&&e.length>1,r=e.length>0&&!(e.length===1&&e[0]==="constructor"),u=thisAssignmentPattern.test(t+"")&&es5.names(t).length>0;if(n||r||u)return!0}return!1}catch{return!1}}function toFastProperties(obj){function FakeConstructor(){}FakeConstructor.prototype=obj;for(var l=8;l--;)new FakeConstructor;return obj}var rident=/^[a-z$_][a-z$_0-9]*$/i;function isIdentifier(t){return rident.test(t)}function filledRange(t,e,n){for(var r=new Array(t),u=0;u<t;++u)r[u]=e+u+n;return r}function safeToString(t){try{return t+""}catch{return"[no string representation]"}}function isError(t){return t!==null&&typeof t=="object"&&typeof t.message=="string"&&typeof t.name=="string"}function markAsOriginatingFromRejection(t){try{notEnumerableProp(t,"isOperational",!0)}catch{}}function originatesFromRejection(t){return t==null?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function canAttachTrace(t){return isError(t)&&es5.propertyIsWritable(t,"stack")}var ensureErrorObject=function(){return"stack"in new Error?function(t){return canAttachTrace(t)?t:new Error(safeToString(t))}:function(t){if(canAttachTrace(t))return t;try{throw new Error(safeToString(t))}catch(e){return e}}}();function classString(t){return{}.toString.call(t)}function copyDescriptors(t,e,n){for(var r=es5.names(t),u=0;u<r.length;++u){var d=r[u];if(n(d))try{es5.defineProperty(e,d,es5.getDescriptor(t,d))}catch{}}}var asArray=function(t){return es5.isArray(t)?t:null};typeof Symbol<"u"&&Symbol.iterator&&(ArrayFrom=typeof Array.from=="function"?function(t){return Array.from(t)}:function(t){for(var e=[],n=t[Symbol.iterator](),r;!(r=n.next()).done;)e.push(r.value);return e},asArray=function(t){return es5.isArray(t)?t:t!=null&&typeof t[Symbol.iterator]=="function"?ArrayFrom(t):null});var ArrayFrom,isNode=typeof process<"u"&&classString(process).toLowerCase()==="[object process]",hasEnvVariables=typeof process<"u"&&typeof process.env<"u";function env(t){return hasEnvVariables?process.env[t]:void 0}function getNativePromise(){if(typeof Promise=="function")try{var t=new Promise(function(){});if({}.toString.call(t)==="[object Promise]")return Promise}catch{}}function domainBind(t,e){return t.bind(e)}var ret={isClass,isIdentifier,inheritedDataKeys,getDataPropertyOrDefault,thrower,isArray:es5.isArray,asArray,notEnumerableProp,isPrimitive,isObject,isError,canEvaluate,errorObj,tryCatch,inherits,withAppended,maybeWrapAsError,toFastProperties,filledRange,toString:safeToString,canAttachTrace,ensureErrorObject,originatesFromRejection,markAsOriginatingFromRejection,classString,copyDescriptors,hasDevTools:typeof chrome<"u"&&chrome&&typeof chrome.loadTimes=="function",isNode,hasEnvVariables,env,global:globalObject,getNativePromise,domainBind};ret.isRecentNode=ret.isNode&&function(){var t=process.versions.node.split(".").map(Number);return t[0]===0&&t[1]>10||t[0]>0}();ret.isNode&&ret.toFastProperties(process);try{throw new Error}catch(t){ret.lastLineError=t}module.exports=ret});var cWi=Bt((yNc,oWi)=>{"use strict";var vgr=Ere(),TRt,yCo=function(){throw new Error(`No async scheduler available
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codemod",
|
|
3
3
|
"author": "Codemod, Inc.",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.15",
|
|
5
5
|
"description": "A codemod engine for Node.js libraries (jscodeshift, ts-morph, etc.)",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": null,
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"valibot": "^0.24.1",
|
|
57
57
|
"vitest": "^1.0.1",
|
|
58
58
|
"yargs": "^17.6.2",
|
|
59
|
-
"@codemod-com/
|
|
60
|
-
"@codemod-com/printer": "1.0.1",
|
|
59
|
+
"@codemod-com/filemod": "2.0.3",
|
|
61
60
|
"@codemod-com/telemetry": "1.1.0",
|
|
62
|
-
"@codemod-com/
|
|
63
|
-
"@codemod-com/
|
|
61
|
+
"@codemod-com/printer": "1.0.1",
|
|
62
|
+
"@codemod-com/runner": "1.0.5",
|
|
63
|
+
"@codemod-com/utilities": "1.1.5"
|
|
64
64
|
},
|
|
65
65
|
"engines": {
|
|
66
66
|
"node": ">=18.5.0"
|