@e-mc/compat-v4 0.8.4 → 0.8.6
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 +1 -1
- package/README.md +1 -1
- package/index.js +35 -39
- package/package.json +4 -4
package/LICENSE
CHANGED
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const path = require("path");
|
|
4
|
-
const V4 = require("
|
|
5
|
-
const types_1 = require("
|
|
4
|
+
const V4 = require("@e-mc/module/lib-v4");
|
|
5
|
+
const types_1 = require("@e-mc/types");
|
|
6
6
|
function setModule(name, target, self) {
|
|
7
7
|
try {
|
|
8
8
|
require(name);
|
|
@@ -15,8 +15,8 @@ function setModule(name, target, self) {
|
|
|
15
15
|
if (pathname.endsWith(name)) {
|
|
16
16
|
if (target) {
|
|
17
17
|
switch (name) {
|
|
18
|
-
case "@squared-functions/compress"
|
|
19
|
-
case "@squared-functions/compress-v1"
|
|
18
|
+
case "@squared-functions/compress":
|
|
19
|
+
case "@squared-functions/compress-v1":
|
|
20
20
|
target = target.singleton();
|
|
21
21
|
break;
|
|
22
22
|
}
|
|
@@ -32,33 +32,30 @@ function setModule(name, target, self) {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
try {
|
|
35
|
-
const Module = require("@e-mc/module"
|
|
35
|
+
const Module = require("@e-mc/module");
|
|
36
36
|
const kStartCPU = Symbol('startCPU');
|
|
37
37
|
for (const name in V4) {
|
|
38
|
-
// @ts-ignore
|
|
39
38
|
Module[name] = V4[name].bind(Module);
|
|
40
39
|
}
|
|
41
40
|
Object.defineProperties(Module.prototype, {
|
|
42
41
|
[kStartCPU]: { value: null, writable: true },
|
|
43
42
|
startCPU: {
|
|
44
43
|
set(value) {
|
|
45
|
-
// @ts-ignore
|
|
46
44
|
this[kStartCPU] = value;
|
|
47
45
|
},
|
|
48
46
|
get() {
|
|
49
47
|
let host;
|
|
50
|
-
// @ts-ignore
|
|
51
48
|
return this[kStartCPU] || (host = this.host) && host.startCPU;
|
|
52
49
|
}
|
|
53
50
|
}
|
|
54
51
|
});
|
|
55
|
-
setModule("@squared-functions/module"
|
|
52
|
+
setModule("@squared-functions/module", Module);
|
|
56
53
|
}
|
|
57
54
|
catch {
|
|
58
55
|
}
|
|
59
56
|
try {
|
|
60
|
-
const FileManager = require("@e-mc/file-manager"
|
|
61
|
-
const Request = require("@e-mc/request"
|
|
57
|
+
const FileManager = require("@e-mc/file-manager");
|
|
58
|
+
const Request = require("@e-mc/request");
|
|
62
59
|
FileManager.fromHttpStatusCode = Request.fromStatusCode.bind(FileManager);
|
|
63
60
|
FileManager.defineHttpAgent = Request.defineHttpAgent.bind(FileManager);
|
|
64
61
|
FileManager.defineDnsLookup = Request.defineDnsLookup.bind(FileManager);
|
|
@@ -102,7 +99,6 @@ try {
|
|
|
102
99
|
set(value) {
|
|
103
100
|
const kIncremental = Object.getOwnPropertySymbols(this).find(sym => sym.toString() === 'Symbol(incremental)');
|
|
104
101
|
if (kIncremental) {
|
|
105
|
-
// @ts-ignore
|
|
106
102
|
this[kIncremental] = value ? 'staging' : 'none';
|
|
107
103
|
}
|
|
108
104
|
},
|
|
@@ -189,21 +185,21 @@ try {
|
|
|
189
185
|
}
|
|
190
186
|
}
|
|
191
187
|
});
|
|
192
|
-
setModule("@squared-functions/file-manager"
|
|
188
|
+
setModule("@squared-functions/file-manager", FileManager);
|
|
193
189
|
}
|
|
194
190
|
catch {
|
|
195
191
|
}
|
|
196
192
|
try {
|
|
197
|
-
const Image = require("@e-mc/image"
|
|
193
|
+
const Image = require("@e-mc/image");
|
|
198
194
|
Image.using = async function (instance, data, command) {
|
|
199
195
|
return instance.using?.(data, command);
|
|
200
196
|
};
|
|
201
|
-
setModule("@squared-functions/image-v3"
|
|
197
|
+
setModule("@squared-functions/image-v3", Image);
|
|
202
198
|
}
|
|
203
199
|
catch {
|
|
204
200
|
}
|
|
205
201
|
try {
|
|
206
|
-
const Cloud = require("@e-mc/cloud"
|
|
202
|
+
const Cloud = require("@e-mc/cloud");
|
|
207
203
|
Cloud.prototype.hasDatabaseCache = function (service, sessionKey) {
|
|
208
204
|
return this.hasCache(service, sessionKey);
|
|
209
205
|
};
|
|
@@ -216,24 +212,24 @@ try {
|
|
|
216
212
|
Cloud.prototype.setDatabaseResult = function (service, credential, queryString, result, options) {
|
|
217
213
|
return this.setQueryResult(service, credential, queryString, result, options);
|
|
218
214
|
};
|
|
219
|
-
setModule("@squared-functions/cloud"
|
|
215
|
+
setModule("@squared-functions/cloud", Cloud);
|
|
220
216
|
}
|
|
221
217
|
catch {
|
|
222
218
|
}
|
|
223
219
|
try {
|
|
224
|
-
const Watch = require("@e-mc/watch"
|
|
225
|
-
const Request = require("@e-mc/request"
|
|
220
|
+
const Watch = require("@e-mc/watch");
|
|
221
|
+
const Request = require("@e-mc/request");
|
|
226
222
|
Watch.readCACert = Request.readCACert.bind(Watch);
|
|
227
223
|
Watch.readTLSKey = Request.readTLSKey.bind(Watch);
|
|
228
224
|
Watch.readTLSCert = Request.readTLSCert.bind(Watch);
|
|
229
225
|
Watch.isCert = Request.isCert.bind(Watch);
|
|
230
226
|
Watch.parseExpires = types_1.parseExpires.bind(Watch);
|
|
231
|
-
setModule("@squared-functions/watch"
|
|
227
|
+
setModule("@squared-functions/watch", Watch);
|
|
232
228
|
}
|
|
233
229
|
catch {
|
|
234
230
|
}
|
|
235
231
|
try {
|
|
236
|
-
const { TransformSeries } = require("@e-mc/document/transform"
|
|
232
|
+
const { TransformSeries } = require("@e-mc/document/transform");
|
|
237
233
|
Object.defineProperties(TransformSeries.prototype, {
|
|
238
234
|
outSourceFiles: {
|
|
239
235
|
set(value) {
|
|
@@ -268,28 +264,28 @@ try {
|
|
|
268
264
|
}
|
|
269
265
|
}
|
|
270
266
|
});
|
|
271
|
-
const Util = require("@squared-functions/document/util"
|
|
267
|
+
const Util = require("@squared-functions/document/util");
|
|
272
268
|
Util.parseExpires = types_1.parseExpires;
|
|
273
269
|
}
|
|
274
270
|
catch {
|
|
275
271
|
}
|
|
276
272
|
[
|
|
277
|
-
["@squared-functions/types"
|
|
278
|
-
["@squared-functions/compress"
|
|
279
|
-
["@squared-functions/compress-v1"
|
|
280
|
-
["@squared-functions/compress-v3"
|
|
281
|
-
["@squared-functions/core"
|
|
282
|
-
["@squared-functions/db"
|
|
283
|
-
["@squared-functions/db/pool"
|
|
284
|
-
["@squared-functions/document"
|
|
285
|
-
["@squared-functions/document/android"
|
|
286
|
-
["@squared-functions/document/chrome"
|
|
287
|
-
["@squared-functions/document/transform"
|
|
288
|
-
["@squared-functions/file-manager/http/host"
|
|
289
|
-
["@squared-functions/image-v3/jimp"
|
|
290
|
-
["@squared-functions/task"
|
|
291
|
-
["@squared-functions/task/gulp"
|
|
292
|
-
["@squared-functions/watch/filegroup"
|
|
293
|
-
["@e-mc/compat-v4"
|
|
273
|
+
["@squared-functions/types", "@e-mc/types"],
|
|
274
|
+
["@squared-functions/compress", "@e-mc/compress"],
|
|
275
|
+
["@squared-functions/compress-v1", "@e-mc/compress"],
|
|
276
|
+
["@squared-functions/compress-v3", "@e-mc/compress"],
|
|
277
|
+
["@squared-functions/core", "@e-mc/core"],
|
|
278
|
+
["@squared-functions/db", "@e-mc/db"],
|
|
279
|
+
["@squared-functions/db/pool", "@e-mc/db/pool", '1'],
|
|
280
|
+
["@squared-functions/document", "@e-mc/document"],
|
|
281
|
+
["@squared-functions/document/android", "@pi-r/android"],
|
|
282
|
+
["@squared-functions/document/chrome", "@pi-r/chrome"],
|
|
283
|
+
["@squared-functions/document/transform", "@e-mc/document/transform"],
|
|
284
|
+
["@squared-functions/file-manager/http/host", "@e-mc/request/http/host"],
|
|
285
|
+
["@squared-functions/image-v3/jimp", "@pi-r/jimp"],
|
|
286
|
+
["@squared-functions/task", "@e-mc/task"],
|
|
287
|
+
["@squared-functions/task/gulp", "@pi-r/gulp"],
|
|
288
|
+
["@squared-functions/watch/filegroup", "@e-mc/watch/filegroup"],
|
|
289
|
+
["@e-mc/compat-v4"]
|
|
294
290
|
]
|
|
295
291
|
.forEach(item => setModule(item[0], item[1], item[2]));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/compat-v4",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.6",
|
|
4
4
|
"description": "Base class compatibility with squared-functions.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"license": "BSD 3-Clause",
|
|
23
23
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@e-mc/module": "0.8.
|
|
26
|
-
"@e-mc/request": "0.8.
|
|
27
|
-
"@e-mc/types": "0.8.
|
|
25
|
+
"@e-mc/module": "0.8.6",
|
|
26
|
+
"@e-mc/request": "0.8.6",
|
|
27
|
+
"@e-mc/types": "0.8.6"
|
|
28
28
|
}
|
|
29
29
|
}
|