{"version":3,"sources":["../../src/bin/create-index.js"],"names":["argv","demand","options","recursive","alias","default","description","type","ignoreUnsafe","update","banner","extensions","example","_","updateIndex"],"mappings":";;AAEA;;;;AACA;;;;AAIA,MAAMA,OAAO,gBACVC,MADU,CACH,CADG,EAEVC,OAFU,CAEF;AACPC,aAAW;AACTC,WAAO,GADE;AAETC,aAAS,KAFA;AAGTC,iBAAa,8EAHJ;AAITC,UAAM;AAJG;AADJ,CAFE,EAUVL,OAVU,CAUF;AACPM,gBAAc;AACZJ,WAAO,GADK;AAEZC,aAAS,KAFG;AAGZC,iBAAa,qDAHD;AAIZC,UAAM;AAJM;AADP,CAVE,EAkBVL,OAlBU,CAkBF;AACPO,UAAQ;AACNL,WAAO,GADD;AAENC,aAAS,KAFH;AAGNC,iBAAa,4DAHP;AAINC,UAAM;AAJA;AADD,CAlBE,EA0BVL,OA1BU,CA0BF;AACPQ,UAAQ;AACNJ,iBAAa,kDADP;AAENC,UAAM;AAFA;AADD,CA1BE,EAgCVL,OAhCU,CAgCF;AACPS,cAAY;AACVP,WAAO,GADG;AAEVC,aAAS,CAAC,IAAD,CAFC;AAGVC,iBAAa,2IAHH;AAIVC,UAAM;AAJI;AADL,CAhCE,EAwCVK,OAxCU,CAwCF,oCAxCE,EAwCoC,4GAxCpC,EAyCVA,OAzCU,CAyCF,qCAzCE,EAyCqC,qHAzCrC,EA0CVA,OA1CU,CA0CF,wCA1CE,EA0CwC,0HA1CxC,EA2CVZ,IA3CH;;AA6CA,8BAAcA,KAAKa,CAAnB,EAAsB;AACpBH,UAAQV,KAAKU,MADO;AAEpBC,cAAYX,KAAKW,UAFG;AAGpBH,gBAAcR,KAAKQ,YAHC;AAIpBL,aAAWH,KAAKG,SAJI;AAKpBW,eAAad,KAAKS;AALE,CAAtB","file":"create-index.js","sourcesContent":["\n\nimport yargs from 'yargs';\nimport {\n writeIndexCli\n} from '../utilities';\n\nconst argv = yargs\n .demand(1)\n .options({\n recursive: {\n alias: 'r',\n default: false,\n description: 'Create/update index files recursively. Halts on any unsafe \"index.js\" files.',\n type: 'boolean'\n }\n })\n .options({\n ignoreUnsafe: {\n alias: 'i',\n default: false,\n description: 'Ignores unsafe \"index.js\" files instead of halting.',\n type: 'boolean'\n }\n })\n .options({\n update: {\n alias: 'u',\n default: false,\n description: 'Updates only previously created index files (recursively).',\n type: 'boolean'\n }\n })\n .options({\n banner: {\n description: 'Add a custom banner at the top of the index file',\n type: 'string'\n }\n })\n .options({\n extensions: {\n alias: 'x',\n default: ['js'],\n description: 'Allows some extensions to be parsed as valid source. First extension will always be preferred to homonyms with another allowed extension.',\n type: 'array'\n }\n })\n .example('create-index ./src ./src/utilities', 'Creates or updates an existing create-index index file in the target (./src, ./src/utilities) directories.')\n .example('create-index --update ./src ./tests', 'Finds all create-index index files in the target directories and descending directories. Updates found index files.')\n .example('create-index ./src --extensions js jsx', 'Creates or updates an existing create-index index file in the target (./src) directory for both .js and .jsx extensions.')\n .argv;\n\nwriteIndexCli(argv._, {\n banner: argv.banner,\n extensions: argv.extensions,\n ignoreUnsafe: argv.ignoreUnsafe,\n recursive: argv.recursive,\n updateIndex: argv.update\n});\n"]}