@e-mc/compat-v4 0.8.5 → 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 +8 -4
- package/README.md +11 -2
- package/index.js +35 -39
- package/package.json +5 -5
package/LICENSE
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
Copyright 2024
|
|
1
|
+
Copyright 2024 An Pham
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
8
|
+
|
|
9
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
10
|
+
|
|
11
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
# @e-mc/compat-v4
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
* NodeJS 14
|
|
4
|
+
* ES2020
|
|
5
|
+
|
|
6
|
+
## General Usage
|
|
7
|
+
|
|
8
|
+
* [Read the Docs](https://e-mc.readthedocs.io)
|
|
9
|
+
|
|
10
|
+
## Interface
|
|
11
|
+
|
|
12
|
+
- https://www.unpkg.com/@e-mc/types@0.8.6/lib/compat-v4.d.ts
|
|
4
13
|
|
|
5
14
|
## LICENSE
|
|
6
15
|
|
|
7
|
-
|
|
16
|
+
BSD 3-Clause
|
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": {
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"name": "An Pham",
|
|
20
20
|
"email": "anpham6@gmail.com"
|
|
21
21
|
},
|
|
22
|
-
"license": "
|
|
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
|
}
|