@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.
- package/LICENSE +21 -0
- package/README.md +433 -0
- package/dictionary/angular-bridge.js +3 -0
- package/dictionary/any-promise.js +3 -0
- package/dictionary/async.js +3 -0
- package/dictionary/aws-sdk.js +7 -0
- package/dictionary/babel-core.js +3 -0
- package/dictionary/batch.js +3 -0
- package/dictionary/bcrypt.js +3 -0
- package/dictionary/better-sqlite3.js +3 -0
- package/dictionary/bignum.js +3 -0
- package/dictionary/bindings.js +3 -0
- package/dictionary/blessed.js +8 -0
- package/dictionary/body-parser.js +9 -0
- package/dictionary/browserify.js +7 -0
- package/dictionary/bson.js +3 -0
- package/dictionary/buffermaker.js +7 -0
- package/dictionary/bunyan.js +9 -0
- package/dictionary/busboy.js +7 -0
- package/dictionary/bytes.js +3 -0
- package/dictionary/callsites.js +3 -0
- package/dictionary/chokidar.js +3 -0
- package/dictionary/coffee-script.js +7 -0
- package/dictionary/colors.js +3 -0
- package/dictionary/compression.js +3 -0
- package/dictionary/compressjs.js +7 -0
- package/dictionary/connect-mongo.js +3 -0
- package/dictionary/connect-mongodb.js +3 -0
- package/dictionary/connect-redis.js +3 -0
- package/dictionary/connect.js +10 -0
- package/dictionary/consolidate.js +3 -0
- package/dictionary/cookie-parser.js +3 -0
- package/dictionary/cookie.js +3 -0
- package/dictionary/cors.js +3 -0
- package/dictionary/cron.js +3 -0
- package/dictionary/cross-env.js +11 -0
- package/dictionary/cross-spawn-async.js +3 -0
- package/dictionary/curve25519.js +3 -0
- package/dictionary/data-preflight.js +7 -0
- package/dictionary/debug.js +3 -0
- package/dictionary/denymount.js +3 -0
- package/dictionary/diff.js +3 -0
- package/dictionary/drivelist.js +22 -0
- package/dictionary/ed25519.js +3 -0
- package/dictionary/ejs.js +3 -0
- package/dictionary/elasticsearch.js +3 -0
- package/dictionary/electron.js +17 -0
- package/dictionary/emailjs.js +3 -0
- package/dictionary/engine.io.js +3 -0
- package/dictionary/epoll.js +3 -0
- package/dictionary/errorhandler.js +7 -0
- package/dictionary/errors.js +7 -0
- package/dictionary/eslint.js +7 -0
- package/dictionary/etcher-image-write.js +3 -0
- package/dictionary/exceljs.js +21 -0
- package/dictionary/exiftool.exe.js +13 -0
- package/dictionary/exiftool.pl.js +13 -0
- package/dictionary/express-load.js +12 -0
- package/dictionary/express-session.js +3 -0
- package/dictionary/express.js +14 -0
- package/dictionary/extender.js +11 -0
- package/dictionary/extsprintf.js +3 -0
- package/dictionary/faye-websocket.js +3 -0
- package/dictionary/feathers.js +3 -0
- package/dictionary/findup-sync.js +3 -0
- package/dictionary/floordate.js +3 -0
- package/dictionary/fmt.js +3 -0
- package/dictionary/formidable.js +3 -0
- package/dictionary/fs-extra.js +3 -0
- package/dictionary/fsevents.js +3 -0
- package/dictionary/geoip-lite.js +7 -0
- package/dictionary/github.js +7 -0
- package/dictionary/gm.js +3 -0
- package/dictionary/google-closure-compiler-java.js +13 -0
- package/dictionary/google-closure-compiler.js +13 -0
- package/dictionary/googleapis.js +7 -0
- package/dictionary/got.js +3 -0
- package/dictionary/graceful-fs.js +19 -0
- package/dictionary/grpc.js +11 -0
- package/dictionary/gulp.js +3 -0
- package/dictionary/hap-nodejs.js +3 -0
- package/dictionary/heapdump.js +3 -0
- package/dictionary/hoek.js +3 -0
- package/dictionary/homebridge.js +3 -0
- package/dictionary/http-proxy.js +3 -0
- package/dictionary/http-server.js +3 -0
- package/dictionary/image-size.js +3 -0
- package/dictionary/indexof.js +3 -0
- package/dictionary/inquirer.js +3 -0
- package/dictionary/j.js +16 -0
- package/dictionary/jade.js +3 -0
- package/dictionary/jsdom.js +3 -0
- package/dictionary/json-stringify-date.js +3 -0
- package/dictionary/json-stringify-safe.js +3 -0
- package/dictionary/jsonwebtoken.js +3 -0
- package/dictionary/kerberos.js +3 -0
- package/dictionary/knex.js +7 -0
- package/dictionary/later.js +7 -0
- package/dictionary/level.js +3 -0
- package/dictionary/leveldown.js +10 -0
- package/dictionary/levelup.js +3 -0
- package/dictionary/liftoff.js +12 -0
- package/dictionary/lodash.js +3 -0
- package/dictionary/log4js.js +7 -0
- package/dictionary/logform.js +7 -0
- package/dictionary/machinepack-urls.js +7 -0
- package/dictionary/markdown.js +3 -0
- package/dictionary/mdns.js +6 -0
- package/dictionary/method-override.js +3 -0
- package/dictionary/microjob.js +16 -0
- package/dictionary/mime-types.js +3 -0
- package/dictionary/mime.js +3 -0
- package/dictionary/minimatch.js +3 -0
- package/dictionary/minstache.js +3 -0
- package/dictionary/module-deps.js +3 -0
- package/dictionary/moment-timezone.js +3 -0
- package/dictionary/moment.js +7 -0
- package/dictionary/mongodb-core.js +22 -0
- package/dictionary/mongodb.js +7 -0
- package/dictionary/mongoose.js +7 -0
- package/dictionary/mongoskin.js +7 -0
- package/dictionary/ms.js +3 -0
- package/dictionary/msgpack.js +3 -0
- package/dictionary/multer.js +3 -0
- package/dictionary/muri.js +3 -0
- package/dictionary/native-or-bluebird.js +3 -0
- package/dictionary/natives.js +3 -0
- package/dictionary/nconf.js +7 -0
- package/dictionary/nedb.js +3 -0
- package/dictionary/negotiator.js +7 -0
- package/dictionary/newrelic.js +3 -0
- package/dictionary/nib.js +3 -0
- package/dictionary/nightmare.js +18 -0
- package/dictionary/node-forge.js +7 -0
- package/dictionary/node-libcurl.js +3 -0
- package/dictionary/node-notifier.js +30 -0
- package/dictionary/node-pre-gyp.js +7 -0
- package/dictionary/node-redis-pubsub.js +3 -0
- package/dictionary/node-sass.js +3 -0
- package/dictionary/node-uuid.js +3 -0
- package/dictionary/node-xlsx.js +3 -0
- package/dictionary/node-zookeeper-client.js +7 -0
- package/dictionary/nodegit.js +7 -0
- package/dictionary/nodemailer-sendmail-transport.js +3 -0
- package/dictionary/nodemailer.js +3 -0
- package/dictionary/npm-registry-client.js +7 -0
- package/dictionary/npm.js +7 -0
- package/dictionary/nssocket.js +3 -0
- package/dictionary/oauth2orize.js +7 -0
- package/dictionary/octobat.js +3 -0
- package/dictionary/open.js +13 -0
- package/dictionary/opn.js +4 -0
- package/dictionary/optimist.js +3 -0
- package/dictionary/passport-local.js +3 -0
- package/dictionary/passport.js +3 -0
- package/dictionary/pg-cursor.js +3 -0
- package/dictionary/pg-query-stream.js +3 -0
- package/dictionary/pg-types.js +7 -0
- package/dictionary/pg.js +7 -0
- package/dictionary/pg.js.js +7 -0
- package/dictionary/pgpass.js +7 -0
- package/dictionary/phantom.js +19 -0
- package/dictionary/phantomjs-prebuilt.js +16 -0
- package/dictionary/pkginfo.js +3 -0
- package/dictionary/pm2.js +7 -0
- package/dictionary/pmx.js +3 -0
- package/dictionary/pouchdb.js +3 -0
- package/dictionary/primus-emitter.js +3 -0
- package/dictionary/primus-spark-latency.js +3 -0
- package/dictionary/primus.js +3 -0
- package/dictionary/publicsuffixlist.js +15 -0
- package/dictionary/pug.js +3 -0
- package/dictionary/punt.js +3 -0
- package/dictionary/puppeteer.js +13 -0
- package/dictionary/pwd.js +3 -0
- package/dictionary/q.js +3 -0
- package/dictionary/raven.js +3 -0
- package/dictionary/rc.js +12 -0
- package/dictionary/readable-stream.js +3 -0
- package/dictionary/rechoir.js +3 -0
- package/dictionary/redis-parser.js +3 -0
- package/dictionary/redis.js +3 -0
- package/dictionary/regression.js +3 -0
- package/dictionary/reload.js +7 -0
- package/dictionary/request.js +3 -0
- package/dictionary/require-uncached.js +3 -0
- package/dictionary/require_optional.js +3 -0
- package/dictionary/s3.js +3 -0
- package/dictionary/safe_datejs.js +3 -0
- package/dictionary/sails.js +33 -0
- package/dictionary/sax.js +3 -0
- package/dictionary/scrypt.js +3 -0
- package/dictionary/semver.js +3 -0
- package/dictionary/sequelize.js +7 -0
- package/dictionary/serialport.js +3 -0
- package/dictionary/sha3.js +3 -0
- package/dictionary/sharp.js +11 -0
- package/dictionary/shelljs.js +7 -0
- package/dictionary/sinon.js +3 -0
- package/dictionary/socket.io-client.js +13 -0
- package/dictionary/socket.io.js +12 -0
- package/dictionary/sqip.js +7 -0
- package/dictionary/sqlite3.js +3 -0
- package/dictionary/steam-crypto.js +7 -0
- package/dictionary/steam-resources.js +19 -0
- package/dictionary/steam.js +3 -0
- package/dictionary/stripe-webhook-middleware.js +3 -0
- package/dictionary/stripe.js +3 -0
- package/dictionary/strong-globalize.js +3 -0
- package/dictionary/stylus.js +14 -0
- package/dictionary/supervisor.js +3 -0
- package/dictionary/svgo.js +8 -0
- package/dictionary/tabtab.js +3 -0
- package/dictionary/tesseract.js.js +7 -0
- package/dictionary/throng.js +3 -0
- package/dictionary/time.js +3 -0
- package/dictionary/tinify.js +7 -0
- package/dictionary/tiny-worker.js +7 -0
- package/dictionary/tmp.js +3 -0
- package/dictionary/transformers.js +3 -0
- package/dictionary/uglify-js.js +9 -0
- package/dictionary/umd.js +19 -0
- package/dictionary/underscore.js +3 -0
- package/dictionary/union.js +3 -0
- package/dictionary/update-notifier.js +3 -0
- package/dictionary/usage.js +7 -0
- package/dictionary/v8flags.js +13 -0
- package/dictionary/verror.js +3 -0
- package/dictionary/voc.js +3 -0
- package/dictionary/webdriverio.js +7 -0
- package/dictionary/winston-uber.js +7 -0
- package/dictionary/winston.js +7 -0
- package/dictionary/ws.js +3 -0
- package/dictionary/xlsx.js +16 -0
- package/dictionary/xml2js.js +3 -0
- package/dictionary/yargs.js +3 -0
- package/dictionary/zeromq.js +13 -0
- package/lib-es5/bin.js +19 -0
- package/lib-es5/chmod.js +15 -0
- package/lib-es5/common.js +235 -0
- package/lib-es5/compress_type.js +10 -0
- package/lib-es5/detector.js +420 -0
- package/lib-es5/fabricator.js +141 -0
- package/lib-es5/follow.js +91 -0
- package/lib-es5/help.js +53 -0
- package/lib-es5/index.d.ts +2 -0
- package/lib-es5/index.js +541 -0
- package/lib-es5/log.js +7 -0
- package/lib-es5/mach-o.js +61 -0
- package/lib-es5/packer.js +131 -0
- package/lib-es5/producer.js +343 -0
- package/lib-es5/refiner.js +87 -0
- package/lib-es5/types.js +9 -0
- package/lib-es5/walker.js +853 -0
- package/package.json +143 -0
- package/prelude/bootstrap.js +2256 -0
- package/prelude/diagnostic.js +136 -0
|
@@ -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,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
|
+
};
|
package/dictionary/ws.js
ADDED
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
|
package/lib-es5/chmod.js
ADDED
|
@@ -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
|