You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
5.5 KiB
Plaintext
1 line
5.5 KiB
Plaintext
6 years ago
|
{"version":3,"sources":["src/index.js"],"names":[],"mappings":";;;;;;;;QA2FgB;;AA3FhB;;AACA;;AACA;;AAEA;;;;;;AAEA,SAAS,eAAT,CAA0B,IAA1B,EAAgC;AAC9B,MAAI;AACF,WAAO,sBAAa,IAAb,CAAP,CADE;GAAJ,CAEE,OAAO,GAAP,EAAY;AACZ,WAAO,IAAP,CADY;GAAZ;CAHJ;;AAQA,IAAM,eAAe,OAAO,IAAP,GAAc,EAAd;;AAErB,IAAM,MAAM;AACV,uBAAW,KAAK,MAAM;AACpB,QAAM,IAAI,cAAc,IAAd,CAAmB,KAAK,QAAL,CAAc,MAAd,EAAsB,IAAtB,EAAnB,CAAJ,CADc;AAEpB,QAAI,CAAC,CAAD,EAAI,OAAO,IAAP,CAAR;;AAEA,WAAO,gBAAgB,gBAAK,GAAL,EAAU,MAAV,EAAkB,EAAE,CAAF,CAAlB,CAAhB,CAAP,CAJoB;GADZ;AAQV,wBAAY,KAAK;AACf,QAAI,4BAAJ,EAAmB,OAAO,IAAP,CAAnB;;AAEA,QAAI;;;AAGF,aAAO,iCAAa,KAAb,EAAoB,CAAC,YAAD,EAAe,MAAf,EAAuB,MAAvB,EAA+B,YAA/B,EAA6C,eAA7C,CAApB,EAAmF;AACxF,aAAK,GAAL;AACA,mBAAW,YAAX;AACA,aAAK,SAAc,EAAd,EAAkB,QAAQ,GAAR,EAAa;;;AAGlC,mBAAS,gBAAK,GAAL,EAAU,MAAV,CAAT;SAHG,CAAL;;AAMA,eAAO,CAAC,QAAD,EAAW,MAAX,EAAmB,QAAnB,CAAP;OATK,CAAP,CAHE;KAAJ,CAcE,OAAO,GAAP,EAAY;AACZ,aAAO,IAAP,CADY;KAAZ;GAzBM;CAAN;;AA+BN,SAAS,cAAT,CAAyB,MAAzB,EAAiC,IAAjC,EAAuC;AACr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,EADoD;KAA/C,MAEA;AACL,YAAM,IAAI,SAAJ,CAAc,iDAAd,CAAN,CADK;KAFA;GAHT;;AAUA,OAAK,IAAI,IAAI,CAAJ,EAAO,IAAI,MAAM,MAAN,EAAc,GAAlC,EAAuC;AACrC,mBAAe,MAAf,EAAuB,MAAM,CAAN,CAAvB,EADqC;GAAvC;;AAIA,SAAO,sBAAO,MAAP,CAAP,CAlByC;CAA3C;;AAqBA,IAAI,UAAU,IAAV;AACG,SAAS,IAAT,CAAe,KAAf,EAAsB,IAAtB,EAA4B;AACjC,MAAI,CAAC,OAAD,EAAU;;AAEZ,cAAU,IAAI,MAAJ,CAAW,YAAY,CAAC,SAAD,CAAZ,CAAX,EAAqC,KAArC,CAAV,CAFY;GAAd;;AAKA,MAAI,UAAU,SAAV,IAAuB,OAAO,IAAP,KAAgB,WAAhB,EAA6B;;;AAGtD,WAAO,QAAQ,QAAR,CAAiB,KAAjB,CAAP,CAHsD;GAAxD;;AAMA,MAAI,MAAM,OAAN,CAAc,KAAd,CAAJ,EAA0B;AACxB,WAAO,YAAY,KAAZ,EAAmB,OAAnB,EAA4B,IAA5B,CAAP,CADwB;GAA1B,MAEO;AACL,WAAO,YAAY,CAAC,KAAD,CAAZ,EAAqB,OAArB,EAA8B,IAA9B,CAAP,CADK;GAFP;CAZK","file":"index.js","sourcesContent":["import { execFileSync } from 'child_process'\nimport { readFileSync, statSync } from 'fs'\nimport { dirname, join } from 'path'\n\nimport md5hex from 'md5-hex'\n\nfunction tryReadFileSync (file) {\n try {\n return readFileSync(file)\n } catch (err) {\n return null\n }\n}\n\nconst TEN_MEBIBYTE = 1024 * 1024 * 10\n\nconst git = {\n tryGetRef (dir, head) {\n const m = /^ref: (.+)$/.exec(head.toString('utf8').trim())\n if (!m) return null\n\n return tryReadFileSync(join(dir, '.git', m[1]))\n },\n\n tryGetDiff (dir) {\n if (!execFileSync) return null\n\n try {\n // Attempt to get consistent output no matter the platform. Diff both\n // staged and unstaged changes.\n return execFileSync('git', ['--no-pager', 'diff', 'HEAD', '--no-color', '--no-ext-diff'], {\n cwd: dir,\n maxBuffer: TEN_MEBIBYTE,\n env: Object.assign({}, process.env, {\n // Force the GIT_DIR to prevent git from diffing a parent repository\n // in case the directory isn't actually a repository.\n GIT_DIR: join(dir, '.git')\n }),\n // Ignore stderr.\n stdio: ['ignore', 'pipe', 'ignore']\n })\n } catch (err) {\n return null\n }\n }\n}\n\nfunction addPackageData (inputs, path) {\n const dir = statSync(path).isDirectory() ? path : dirname(path)\n inputs.push(dir)\n\n const p
|