UNPKG

@calljmp/cli

Version:
3 lines (2 loc) 933 B
#!/usr/bin/env node "use strict";const a=require("module"),c=require("path"),p=require("fs"),o=a._resolveFilename,l=__dirname,d=[{module:"@calljmp/react-native",exactMatch:"libs/sdk-react-native/src/index.js",pattern:"libs/sdk-react-native/src/index.ts"},{module:"@calljmp/service",exactMatch:"libs/service/src/index.js",pattern:"libs/service/src/index.ts"}];a._resolveFilename=function(e,m){let n;for(const t of d)if(e===t.module&&t.exactMatch){const i=d.find(s=>e===s.module||e.startsWith(s.module+"/")),r=c.join(l,i.exactMatch);if(u(r)){n=r;break}}else{const i=new RegExp(t.module.replace(/\*$/,"(?<rest>.*)")),r=e.match(i);if(r?.groups){const s=c.join(l,t.pattern.replace("*",""),r.groups.rest);u(s)&&(n=s)}}if(n){const t=[n,...[].slice.call(arguments,1)];return o.apply(this,t)}else return o.apply(this,arguments)};function u(e){try{return require.resolve(e),!0}catch{return!1}}module.exports=require("./apps/cli/src/main.js");