@yao-pkg/pkg 5.9.0

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.
Files changed (257) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +433 -0
  3. package/dictionary/angular-bridge.js +3 -0
  4. package/dictionary/any-promise.js +3 -0
  5. package/dictionary/async.js +3 -0
  6. package/dictionary/aws-sdk.js +7 -0
  7. package/dictionary/babel-core.js +3 -0
  8. package/dictionary/batch.js +3 -0
  9. package/dictionary/bcrypt.js +3 -0
  10. package/dictionary/better-sqlite3.js +3 -0
  11. package/dictionary/bignum.js +3 -0
  12. package/dictionary/bindings.js +3 -0
  13. package/dictionary/blessed.js +8 -0
  14. package/dictionary/body-parser.js +9 -0
  15. package/dictionary/browserify.js +7 -0
  16. package/dictionary/bson.js +3 -0
  17. package/dictionary/buffermaker.js +7 -0
  18. package/dictionary/bunyan.js +9 -0
  19. package/dictionary/busboy.js +7 -0
  20. package/dictionary/bytes.js +3 -0
  21. package/dictionary/callsites.js +3 -0
  22. package/dictionary/chokidar.js +3 -0
  23. package/dictionary/coffee-script.js +7 -0
  24. package/dictionary/colors.js +3 -0
  25. package/dictionary/compression.js +3 -0
  26. package/dictionary/compressjs.js +7 -0
  27. package/dictionary/connect-mongo.js +3 -0
  28. package/dictionary/connect-mongodb.js +3 -0
  29. package/dictionary/connect-redis.js +3 -0
  30. package/dictionary/connect.js +10 -0
  31. package/dictionary/consolidate.js +3 -0
  32. package/dictionary/cookie-parser.js +3 -0
  33. package/dictionary/cookie.js +3 -0
  34. package/dictionary/cors.js +3 -0
  35. package/dictionary/cron.js +3 -0
  36. package/dictionary/cross-env.js +11 -0
  37. package/dictionary/cross-spawn-async.js +3 -0
  38. package/dictionary/curve25519.js +3 -0
  39. package/dictionary/data-preflight.js +7 -0
  40. package/dictionary/debug.js +3 -0
  41. package/dictionary/denymount.js +3 -0
  42. package/dictionary/diff.js +3 -0
  43. package/dictionary/drivelist.js +22 -0
  44. package/dictionary/ed25519.js +3 -0
  45. package/dictionary/ejs.js +3 -0
  46. package/dictionary/elasticsearch.js +3 -0
  47. package/dictionary/electron.js +17 -0
  48. package/dictionary/emailjs.js +3 -0
  49. package/dictionary/engine.io.js +3 -0
  50. package/dictionary/epoll.js +3 -0
  51. package/dictionary/errorhandler.js +7 -0
  52. package/dictionary/errors.js +7 -0
  53. package/dictionary/eslint.js +7 -0
  54. package/dictionary/etcher-image-write.js +3 -0
  55. package/dictionary/exceljs.js +21 -0
  56. package/dictionary/exiftool.exe.js +13 -0
  57. package/dictionary/exiftool.pl.js +13 -0
  58. package/dictionary/express-load.js +12 -0
  59. package/dictionary/express-session.js +3 -0
  60. package/dictionary/express.js +14 -0
  61. package/dictionary/extender.js +11 -0
  62. package/dictionary/extsprintf.js +3 -0
  63. package/dictionary/faye-websocket.js +3 -0
  64. package/dictionary/feathers.js +3 -0
  65. package/dictionary/findup-sync.js +3 -0
  66. package/dictionary/floordate.js +3 -0
  67. package/dictionary/fmt.js +3 -0
  68. package/dictionary/formidable.js +3 -0
  69. package/dictionary/fs-extra.js +3 -0
  70. package/dictionary/fsevents.js +3 -0
  71. package/dictionary/geoip-lite.js +7 -0
  72. package/dictionary/github.js +7 -0
  73. package/dictionary/gm.js +3 -0
  74. package/dictionary/google-closure-compiler-java.js +13 -0
  75. package/dictionary/google-closure-compiler.js +13 -0
  76. package/dictionary/googleapis.js +7 -0
  77. package/dictionary/got.js +3 -0
  78. package/dictionary/graceful-fs.js +19 -0
  79. package/dictionary/grpc.js +11 -0
  80. package/dictionary/gulp.js +3 -0
  81. package/dictionary/hap-nodejs.js +3 -0
  82. package/dictionary/heapdump.js +3 -0
  83. package/dictionary/hoek.js +3 -0
  84. package/dictionary/homebridge.js +3 -0
  85. package/dictionary/http-proxy.js +3 -0
  86. package/dictionary/http-server.js +3 -0
  87. package/dictionary/image-size.js +3 -0
  88. package/dictionary/indexof.js +3 -0
  89. package/dictionary/inquirer.js +3 -0
  90. package/dictionary/j.js +16 -0
  91. package/dictionary/jade.js +3 -0
  92. package/dictionary/jsdom.js +3 -0
  93. package/dictionary/json-stringify-date.js +3 -0
  94. package/dictionary/json-stringify-safe.js +3 -0
  95. package/dictionary/jsonwebtoken.js +3 -0
  96. package/dictionary/kerberos.js +3 -0
  97. package/dictionary/knex.js +7 -0
  98. package/dictionary/later.js +7 -0
  99. package/dictionary/level.js +3 -0
  100. package/dictionary/leveldown.js +10 -0
  101. package/dictionary/levelup.js +3 -0
  102. package/dictionary/liftoff.js +12 -0
  103. package/dictionary/lodash.js +3 -0
  104. package/dictionary/log4js.js +7 -0
  105. package/dictionary/logform.js +7 -0
  106. package/dictionary/machinepack-urls.js +7 -0
  107. package/dictionary/markdown.js +3 -0
  108. package/dictionary/mdns.js +6 -0
  109. package/dictionary/method-override.js +3 -0
  110. package/dictionary/microjob.js +16 -0
  111. package/dictionary/mime-types.js +3 -0
  112. package/dictionary/mime.js +3 -0
  113. package/dictionary/minimatch.js +3 -0
  114. package/dictionary/minstache.js +3 -0
  115. package/dictionary/module-deps.js +3 -0
  116. package/dictionary/moment-timezone.js +3 -0
  117. package/dictionary/moment.js +7 -0
  118. package/dictionary/mongodb-core.js +22 -0
  119. package/dictionary/mongodb.js +7 -0
  120. package/dictionary/mongoose.js +7 -0
  121. package/dictionary/mongoskin.js +7 -0
  122. package/dictionary/ms.js +3 -0
  123. package/dictionary/msgpack.js +3 -0
  124. package/dictionary/multer.js +3 -0
  125. package/dictionary/muri.js +3 -0
  126. package/dictionary/native-or-bluebird.js +3 -0
  127. package/dictionary/natives.js +3 -0
  128. package/dictionary/nconf.js +7 -0
  129. package/dictionary/nedb.js +3 -0
  130. package/dictionary/negotiator.js +7 -0
  131. package/dictionary/newrelic.js +3 -0
  132. package/dictionary/nib.js +3 -0
  133. package/dictionary/nightmare.js +18 -0
  134. package/dictionary/node-forge.js +7 -0
  135. package/dictionary/node-libcurl.js +3 -0
  136. package/dictionary/node-notifier.js +30 -0
  137. package/dictionary/node-pre-gyp.js +7 -0
  138. package/dictionary/node-redis-pubsub.js +3 -0
  139. package/dictionary/node-sass.js +3 -0
  140. package/dictionary/node-uuid.js +3 -0
  141. package/dictionary/node-xlsx.js +3 -0
  142. package/dictionary/node-zookeeper-client.js +7 -0
  143. package/dictionary/nodegit.js +7 -0
  144. package/dictionary/nodemailer-sendmail-transport.js +3 -0
  145. package/dictionary/nodemailer.js +3 -0
  146. package/dictionary/npm-registry-client.js +7 -0
  147. package/dictionary/npm.js +7 -0
  148. package/dictionary/nssocket.js +3 -0
  149. package/dictionary/oauth2orize.js +7 -0
  150. package/dictionary/octobat.js +3 -0
  151. package/dictionary/open.js +13 -0
  152. package/dictionary/opn.js +4 -0
  153. package/dictionary/optimist.js +3 -0
  154. package/dictionary/passport-local.js +3 -0
  155. package/dictionary/passport.js +3 -0
  156. package/dictionary/pg-cursor.js +3 -0
  157. package/dictionary/pg-query-stream.js +3 -0
  158. package/dictionary/pg-types.js +7 -0
  159. package/dictionary/pg.js +7 -0
  160. package/dictionary/pg.js.js +7 -0
  161. package/dictionary/pgpass.js +7 -0
  162. package/dictionary/phantom.js +19 -0
  163. package/dictionary/phantomjs-prebuilt.js +16 -0
  164. package/dictionary/pkginfo.js +3 -0
  165. package/dictionary/pm2.js +7 -0
  166. package/dictionary/pmx.js +3 -0
  167. package/dictionary/pouchdb.js +3 -0
  168. package/dictionary/primus-emitter.js +3 -0
  169. package/dictionary/primus-spark-latency.js +3 -0
  170. package/dictionary/primus.js +3 -0
  171. package/dictionary/publicsuffixlist.js +15 -0
  172. package/dictionary/pug.js +3 -0
  173. package/dictionary/punt.js +3 -0
  174. package/dictionary/puppeteer.js +13 -0
  175. package/dictionary/pwd.js +3 -0
  176. package/dictionary/q.js +3 -0
  177. package/dictionary/raven.js +3 -0
  178. package/dictionary/rc.js +12 -0
  179. package/dictionary/readable-stream.js +3 -0
  180. package/dictionary/rechoir.js +3 -0
  181. package/dictionary/redis-parser.js +3 -0
  182. package/dictionary/redis.js +3 -0
  183. package/dictionary/regression.js +3 -0
  184. package/dictionary/reload.js +7 -0
  185. package/dictionary/request.js +3 -0
  186. package/dictionary/require-uncached.js +3 -0
  187. package/dictionary/require_optional.js +3 -0
  188. package/dictionary/s3.js +3 -0
  189. package/dictionary/safe_datejs.js +3 -0
  190. package/dictionary/sails.js +33 -0
  191. package/dictionary/sax.js +3 -0
  192. package/dictionary/scrypt.js +3 -0
  193. package/dictionary/semver.js +3 -0
  194. package/dictionary/sequelize.js +7 -0
  195. package/dictionary/serialport.js +3 -0
  196. package/dictionary/sha3.js +3 -0
  197. package/dictionary/sharp.js +11 -0
  198. package/dictionary/shelljs.js +7 -0
  199. package/dictionary/sinon.js +3 -0
  200. package/dictionary/socket.io-client.js +13 -0
  201. package/dictionary/socket.io.js +12 -0
  202. package/dictionary/sqip.js +7 -0
  203. package/dictionary/sqlite3.js +3 -0
  204. package/dictionary/steam-crypto.js +7 -0
  205. package/dictionary/steam-resources.js +19 -0
  206. package/dictionary/steam.js +3 -0
  207. package/dictionary/stripe-webhook-middleware.js +3 -0
  208. package/dictionary/stripe.js +3 -0
  209. package/dictionary/strong-globalize.js +3 -0
  210. package/dictionary/stylus.js +14 -0
  211. package/dictionary/supervisor.js +3 -0
  212. package/dictionary/svgo.js +8 -0
  213. package/dictionary/tabtab.js +3 -0
  214. package/dictionary/tesseract.js.js +7 -0
  215. package/dictionary/throng.js +3 -0
  216. package/dictionary/time.js +3 -0
  217. package/dictionary/tinify.js +7 -0
  218. package/dictionary/tiny-worker.js +7 -0
  219. package/dictionary/tmp.js +3 -0
  220. package/dictionary/transformers.js +3 -0
  221. package/dictionary/uglify-js.js +9 -0
  222. package/dictionary/umd.js +19 -0
  223. package/dictionary/underscore.js +3 -0
  224. package/dictionary/union.js +3 -0
  225. package/dictionary/update-notifier.js +3 -0
  226. package/dictionary/usage.js +7 -0
  227. package/dictionary/v8flags.js +13 -0
  228. package/dictionary/verror.js +3 -0
  229. package/dictionary/voc.js +3 -0
  230. package/dictionary/webdriverio.js +7 -0
  231. package/dictionary/winston-uber.js +7 -0
  232. package/dictionary/winston.js +7 -0
  233. package/dictionary/ws.js +3 -0
  234. package/dictionary/xlsx.js +16 -0
  235. package/dictionary/xml2js.js +3 -0
  236. package/dictionary/yargs.js +3 -0
  237. package/dictionary/zeromq.js +13 -0
  238. package/lib-es5/bin.js +19 -0
  239. package/lib-es5/chmod.js +15 -0
  240. package/lib-es5/common.js +235 -0
  241. package/lib-es5/compress_type.js +10 -0
  242. package/lib-es5/detector.js +420 -0
  243. package/lib-es5/fabricator.js +141 -0
  244. package/lib-es5/follow.js +91 -0
  245. package/lib-es5/help.js +53 -0
  246. package/lib-es5/index.d.ts +2 -0
  247. package/lib-es5/index.js +541 -0
  248. package/lib-es5/log.js +7 -0
  249. package/lib-es5/mach-o.js +61 -0
  250. package/lib-es5/packer.js +131 -0
  251. package/lib-es5/producer.js +343 -0
  252. package/lib-es5/refiner.js +87 -0
  253. package/lib-es5/types.js +9 -0
  254. package/lib-es5/walker.js +853 -0
  255. package/package.json +143 -0
  256. package/prelude/bootstrap.js +2256 -0
  257. package/prelude/diagnostic.js +136 -0
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ scripts: ['lib/*.js'],
6
+ deployFiles: [
7
+ ['build/Release', 'sharp/build/Release', 'directory'],
8
+ ['vendor/lib', 'sharp/vendor/lib', 'directory'],
9
+ ],
10
+ },
11
+ };
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ scripts: ['src/*.js'],
6
+ },
7
+ };
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ scripts: [
6
+ 'lib/**/*.js', // for 0.9.17
7
+ ],
8
+ assets: [
9
+ 'socket.io.js',
10
+ 'dist/**/*', // for 0.9.17
11
+ ],
12
+ },
13
+ };
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ patches: {
6
+ 'lib/index.js': [
7
+ "require.resolve('socket.io-client/dist/socket.io.js.map')",
8
+ "require.resolve('socket.io-client/dist/socket.io.js.map', 'must-exclude')",
9
+ ],
10
+ },
11
+ },
12
+ };
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * primitive Binaries must be installed on the system.
5
+ * e.g. go get -u github.com/fogleman/primitive
6
+ */
7
+ module.exports = {};
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ assets: ['public.pub'],
6
+ },
7
+ };
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ assets: ['steam_language/**/*'],
6
+ patches: {
7
+ 'steam_language_parser/index.js': [
8
+ 'process.chdir',
9
+ '// process.chdir',
10
+ "'steammsg.steamd'",
11
+ "require('path').join(__dirname, '../steam_language', 'steammsg.steamd')",
12
+ ],
13
+ 'steam_language_parser/parser/token_analyzer.js': [
14
+ 'text.value',
15
+ "require('path').join(__dirname, '../../steam_language', text.value)",
16
+ ],
17
+ },
18
+ },
19
+ };
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ assets: ['lib/**/*.styl'],
6
+ log: function (log, opts) {
7
+ log.warn(
8
+ 'Add { paths: [ __dirname ] } to ' +
9
+ 'stylus options to resolve imports',
10
+ [opts.packagePath]
11
+ );
12
+ },
13
+ },
14
+ };
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ scripts: ['lib/**/*.js', 'plugins/*.js'],
6
+ assets: ['.svgo.yml'],
7
+ },
8
+ };
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ scripts: ['src/worker-script/node/index.js'],
6
+ },
7
+ };
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ assets: ['lib/data/cacert.pem'],
6
+ },
7
+ };
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ assets: ['lib/noop.js'],
6
+ },
7
+ };
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ // assets, not scripts because of custom
6
+ // load_global (readFileSync + runInContext)
7
+ assets: ['lib/**/*.js', 'tools/*.js'],
8
+ },
9
+ };
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ assets: [
6
+ 'template.js', // for 2.1.0
7
+ ],
8
+ patches: {
9
+ 'index.js': [
10
+ "var rfile = require('rfile');",
11
+ 'var rfile = function(f) { ' +
12
+ "require('fs').readFileSync(" + // for 2.1.0
13
+ 'require.resolve(f)' +
14
+ '); ' +
15
+ '};',
16
+ ],
17
+ },
18
+ },
19
+ };
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ scripts: ['lib/providers/*.js'],
6
+ },
7
+ };
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ patches: {
6
+ 'index.js': [
7
+ "execFile(process.execPath, ['--v8-options'],",
8
+ "execFile(process.execPath, ['--v8-options'], " +
9
+ "{ env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' } },",
10
+ ],
11
+ },
12
+ },
13
+ };
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ scripts: ['build/**/*.js'],
6
+ },
7
+ };
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ scripts: ['lib/winston/transports/*.js'],
6
+ },
7
+ };
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ scripts: ['lib/winston/transports/*.js'],
6
+ },
7
+ };
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ patches: {
6
+ 'xlsx.js': [
7
+ "require('js'+'zip')",
8
+ "require('jszip')",
9
+ "require('./js'+'zip')",
10
+ "require('./jszip')",
11
+ "require('./od' + 's')",
12
+ "require('./ods')",
13
+ ],
14
+ },
15
+ },
16
+ };
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = {};
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ pkg: {
5
+ patches: {
6
+ 'lib/native.js': [
7
+ 'path.join(__dirname, "..")',
8
+ 'path.dirname(process.execPath)',
9
+ ],
10
+ },
11
+ deployFiles: [['prebuilds', 'prebuilds', 'directory']],
12
+ },
13
+ };
package/lib-es5/bin.js ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const index_1 = require("./index");
5
+ const log_1 = require("./log");
6
+ async function main() {
7
+ if (process.env.CHDIR && process.env.CHDIR !== process.cwd()) {
8
+ // allow to override cwd by CHDIR env var
9
+ // https://github.com/resin-io/etcher/pull/1713
10
+ process.chdir(process.env.CHDIR);
11
+ }
12
+ await (0, index_1.exec)(process.argv.slice(2));
13
+ }
14
+ main().catch((error) => {
15
+ if (!error.wasReported)
16
+ log_1.log.error(error);
17
+ process.exit(2);
18
+ });
19
+ //# sourceMappingURL=bin.js.map
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.plusx = void 0;
4
+ const fs_extra_1 = require("fs-extra");
5
+ async function plusx(file) {
6
+ const s = await (0, fs_extra_1.stat)(file);
7
+ const newMode = s.mode | 64 | 8 | 1;
8
+ if (s.mode === newMode) {
9
+ return;
10
+ }
11
+ const base8 = newMode.toString(8).slice(-3);
12
+ await (0, fs_extra_1.chmod)(file, base8);
13
+ }
14
+ exports.plusx = plusx;
15
+ //# sourceMappingURL=chmod.js.map
@@ -0,0 +1,235 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.toNormalizedRealPath = exports.removeUplevels = exports.stripSnapshot = exports.insideSnapshot = exports.snapshotify = exports.substituteDenominator = exports.retrieveDenominator = exports.isDotNODE = exports.isDotJSON = exports.isDotJS = exports.isPackageJson = exports.normalizePath = exports.isRootPath = exports.ALIAS_AS_RESOLVABLE = exports.ALIAS_AS_RELATIVE = exports.STORE_STAT = exports.STORE_LINKS = exports.STORE_CONTENT = exports.STORE_BLOB = void 0;
7
+ const assert_1 = __importDefault(require("assert"));
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const path_1 = __importDefault(require("path"));
10
+ exports.STORE_BLOB = 0;
11
+ exports.STORE_CONTENT = 1;
12
+ exports.STORE_LINKS = 2;
13
+ exports.STORE_STAT = 3;
14
+ exports.ALIAS_AS_RELATIVE = 0; // require("./file.js") // file or directory
15
+ exports.ALIAS_AS_RESOLVABLE = 1; // require("package")
16
+ const win32 = process.platform === 'win32';
17
+ const hasURL = typeof URL !== 'undefined';
18
+ function uppercaseDriveLetter(f) {
19
+ if (f.slice(1, 3) !== ':\\')
20
+ return f;
21
+ return f[0].toUpperCase() + f.slice(1);
22
+ }
23
+ function removeTrailingSlashes(f) {
24
+ if (f === '/') {
25
+ return f; // dont remove from "/"
26
+ }
27
+ if (f.slice(1) === ':\\') {
28
+ return f; // dont remove from "D:\"
29
+ }
30
+ let last = f.length - 1;
31
+ while (true) {
32
+ const char = f.charAt(last);
33
+ if (char === '\\') {
34
+ f = f.slice(0, -1);
35
+ last -= 1;
36
+ }
37
+ else if (char === '/') {
38
+ f = f.slice(0, -1);
39
+ last -= 1;
40
+ }
41
+ else {
42
+ break;
43
+ }
44
+ }
45
+ return f;
46
+ }
47
+ const isUrl = (p) => hasURL && p instanceof URL;
48
+ function pathToString(p, win) {
49
+ let result;
50
+ if (Buffer.isBuffer(p)) {
51
+ result = p.toString();
52
+ }
53
+ else if (isUrl(p)) {
54
+ result = win ? p.pathname.replace(/^\//, '') : p.pathname;
55
+ }
56
+ else {
57
+ result = p;
58
+ }
59
+ return result;
60
+ }
61
+ function isRootPath(p) {
62
+ let file = pathToString(p, false);
63
+ if (file === '.') {
64
+ file = path_1.default.resolve(file);
65
+ }
66
+ return path_1.default.dirname(file) === p;
67
+ }
68
+ exports.isRootPath = isRootPath;
69
+ function normalizePath(f) {
70
+ let file = pathToString(f, win32);
71
+ if (!/^.:$/.test(file)) {
72
+ file = path_1.default.normalize(file);
73
+ } // 'c:' -> 'c:.'
74
+ if (win32) {
75
+ file = uppercaseDriveLetter(file);
76
+ }
77
+ return removeTrailingSlashes(file);
78
+ }
79
+ exports.normalizePath = normalizePath;
80
+ function isPackageJson(file) {
81
+ return path_1.default.basename(file) === 'package.json';
82
+ }
83
+ exports.isPackageJson = isPackageJson;
84
+ function isDotJS(file) {
85
+ return path_1.default.extname(file) === '.js';
86
+ }
87
+ exports.isDotJS = isDotJS;
88
+ function isDotJSON(file) {
89
+ return path_1.default.extname(file) === '.json';
90
+ }
91
+ exports.isDotJSON = isDotJSON;
92
+ function isDotNODE(file) {
93
+ return path_1.default.extname(file) === '.node';
94
+ }
95
+ exports.isDotNODE = isDotNODE;
96
+ function replaceSlashes(file, slash) {
97
+ if (/^.:\\/.test(file)) {
98
+ if (slash === '/') {
99
+ return file.slice(2).replace(/\\/g, '/');
100
+ }
101
+ }
102
+ else if (/^\//.test(file)) {
103
+ if (slash === '\\') {
104
+ return `C:${file.replace(/\//g, '\\')}`;
105
+ }
106
+ }
107
+ return file;
108
+ }
109
+ function injectSnapshot(file) {
110
+ if (/^.:\\/.test(file)) {
111
+ // C:\path\to
112
+ if (file.length === 3) {
113
+ // C:\
114
+ file = file.slice(0, -1);
115
+ }
116
+ // by convention, on windows we use C:\\snapshot
117
+ return `C:\\snapshot${file.slice(2)}`;
118
+ }
119
+ if (/^\//.test(file)) {
120
+ // /home/user/project
121
+ if (file.length === 1) {
122
+ // /
123
+ file = file.slice(0, -1);
124
+ }
125
+ return `/snapshot${file}`;
126
+ }
127
+ return file;
128
+ }
129
+ function longestCommonLength(s1, s2) {
130
+ const length = Math.min(s1.length, s2.length);
131
+ for (let i = 0; i < length; i += 1) {
132
+ if (s1.charCodeAt(i) !== s2.charCodeAt(i)) {
133
+ return i;
134
+ }
135
+ }
136
+ return length;
137
+ }
138
+ function withoutNodeModules(file) {
139
+ return file.split(`${path_1.default.sep}node_modules${path_1.default.sep}`)[0];
140
+ }
141
+ function retrieveDenominator(files) {
142
+ (0, assert_1.default)(files.length > 0);
143
+ let s1 = withoutNodeModules(files[0]) + path_1.default.sep;
144
+ for (let i = 1; i < files.length; i += 1) {
145
+ const s2 = withoutNodeModules(files[i]) + path_1.default.sep;
146
+ s1 = s1.slice(0, longestCommonLength(s1, s2));
147
+ }
148
+ if (s1 === '') {
149
+ return win32 ? 2 : 0;
150
+ }
151
+ return s1.lastIndexOf(path_1.default.sep);
152
+ }
153
+ exports.retrieveDenominator = retrieveDenominator;
154
+ function substituteDenominator(f, denominator) {
155
+ const rootLength = win32 ? 2 : 0;
156
+ return f.slice(0, rootLength) + f.slice(denominator);
157
+ }
158
+ exports.substituteDenominator = substituteDenominator;
159
+ function snapshotify(file, slash) {
160
+ return injectSnapshot(replaceSlashes(file, slash));
161
+ }
162
+ exports.snapshotify = snapshotify;
163
+ function insideSnapshot(f) {
164
+ f = pathToString(f, win32);
165
+ if (typeof f !== 'string') {
166
+ return false;
167
+ }
168
+ if (win32) {
169
+ const slice112 = f.slice(1, 12);
170
+ return (slice112 === ':\\snapshot\\' ||
171
+ slice112 === ':/snapshot\\' ||
172
+ slice112 === ':\\snapshot/' ||
173
+ slice112 === ':/snapshot/' ||
174
+ slice112 === ':\\snapshot' ||
175
+ slice112 === ':/snapshot');
176
+ }
177
+ const slice010 = f.slice(0, 10);
178
+ return slice010 === '/snapshot/' || slice010 === '/snapshot';
179
+ }
180
+ exports.insideSnapshot = insideSnapshot;
181
+ function stripSnapshot(f) {
182
+ const file = normalizePath(f);
183
+ if (/^.:\\snapshot$/.test(file)) {
184
+ return `${file[0]}:\\**\\`;
185
+ }
186
+ if (/^.:\\snapshot\\/.test(file)) {
187
+ return `${file[0]}:\\**${file.slice(11)}`;
188
+ }
189
+ if (/^\/snapshot$/.test(file)) {
190
+ return '/**/';
191
+ }
192
+ if (/^\/snapshot\//.test(file)) {
193
+ return `/**${file.slice(9)}`;
194
+ }
195
+ return f; // not inside
196
+ }
197
+ exports.stripSnapshot = stripSnapshot;
198
+ function removeUplevels(f) {
199
+ if (win32) {
200
+ while (true) {
201
+ if (f.slice(0, 3) === '..\\') {
202
+ f = f.slice(3);
203
+ }
204
+ else if (f === '..') {
205
+ f = '.';
206
+ }
207
+ else {
208
+ break;
209
+ }
210
+ }
211
+ return f;
212
+ }
213
+ while (true) {
214
+ if (f.slice(0, 3) === '../') {
215
+ f = f.slice(3);
216
+ }
217
+ else if (f === '..') {
218
+ f = '.';
219
+ }
220
+ else {
221
+ break;
222
+ }
223
+ }
224
+ return f;
225
+ }
226
+ exports.removeUplevels = removeUplevels;
227
+ function toNormalizedRealPath(requestPath) {
228
+ const file = normalizePath(requestPath);
229
+ if (fs_1.default.existsSync(file)) {
230
+ return fs_1.default.realpathSync(file);
231
+ }
232
+ return file;
233
+ }
234
+ exports.toNormalizedRealPath = toNormalizedRealPath;
235
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CompressType = void 0;
4
+ var CompressType;
5
+ (function (CompressType) {
6
+ CompressType[CompressType["None"] = 0] = "None";
7
+ CompressType[CompressType["GZip"] = 1] = "GZip";
8
+ CompressType[CompressType["Brotli"] = 2] = "Brotli";
9
+ })(CompressType = exports.CompressType || (exports.CompressType = {}));
10
+ //# sourceMappingURL=compress_type.js.map