@e-mc/compat-v4 0.5.2 → 0.5.4
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 +7 -11
- package/README.md +5 -3
- package/index.js +35 -39
- package/package.json +6 -6
package/LICENSE
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
Copyright 2023
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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.
|
|
1
|
+
Copyright 2023 Mile Square Park
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
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.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "Base class compatibility with squared-functions.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/anpham6/e-mc.git",
|
|
11
|
+
"url": "git+https://github.com/anpham6/e-mc.git",
|
|
12
12
|
"directory": "src/compat-v4"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"name": "An Pham",
|
|
20
20
|
"email": "anpham6@gmail.com"
|
|
21
21
|
},
|
|
22
|
-
"license": "
|
|
22
|
+
"license": "MIT",
|
|
23
23
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@e-mc/module": "0.5.
|
|
26
|
-
"@e-mc/request": "0.5.
|
|
27
|
-
"@e-mc/types": "0.5.
|
|
25
|
+
"@e-mc/module": "0.5.4",
|
|
26
|
+
"@e-mc/request": "0.5.4",
|
|
27
|
+
"@e-mc/types": "0.5.4"
|
|
28
28
|
}
|
|
29
29
|
}
|