@loaders.gl/polyfills 4.1.0-alpha.1 → 4.1.0-alpha.3
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/dist/fetch/fetch-polyfill.d.ts.map +1 -1
- package/dist/fetch/fetch-polyfill.js.map +1 -1
- package/dist/fetch/response-polyfill.d.ts.map +1 -1
- package/dist/fetch/response-polyfill.js.map +1 -1
- package/dist/filesystems/fetch-node.d.ts.map +1 -1
- package/dist/filesystems/fetch-node.js.map +1 -1
- package/dist/filesystems/node-file.d.ts +3 -1
- package/dist/filesystems/node-file.d.ts.map +1 -1
- package/dist/filesystems/node-file.js +26 -0
- package/dist/filesystems/node-file.js.map +1 -1
- package/dist/filesystems/node-filesystem.d.ts.map +1 -1
- package/dist/filesystems/node-filesystem.js.map +1 -1
- package/dist/filesystems/stream-utils.node.d.ts.map +1 -1
- package/dist/filesystems/stream-utils.node.js.map +1 -1
- package/dist/images/parse-image-node.d.ts.map +1 -1
- package/dist/images/parse-image-node.js.map +1 -1
- package/dist/images/parse-image.node.d.ts.map +1 -1
- package/dist/images/parse-image.node.js.map +1 -1
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +26 -0
- package/dist/libs/encoding-indexes-asian.js +13 -2
- package/dist/utils/is-browser.d.ts.map +1 -1
- package/dist/utils/is-browser.js.map +1 -1
- package/package.json +4 -4
- package/src/fetch/fetch-polyfill.ts +2 -1
- package/src/fetch/response-polyfill.ts +2 -1
- package/src/filesystems/fetch-node.ts +2 -1
- package/src/filesystems/node-file.ts +29 -1
- package/src/filesystems/node-filesystem.ts +2 -1
- package/src/filesystems/stream-utils.node.ts +2 -1
- package/src/images/parse-image-node.ts +2 -1
- package/src/images/parse-image.node.ts +2 -1
- package/src/index.browser.ts +2 -1
- package/src/utils/is-browser.ts +2 -1
- package/dist/libs/encoding-indexes-asian.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-browser.d.ts","sourceRoot":"","sources":["../../src/utils/is-browser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-browser.d.ts","sourceRoot":"","sources":["../../src/utils/is-browser.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS,EAAE,OAEkE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-browser.js","names":["isBrowser","process","String","browser"],"sources":["../../src/utils/is-browser.ts"],"sourcesContent":["// loaders.gl
|
|
1
|
+
{"version":3,"file":"is-browser.js","names":["isBrowser","process","String","browser"],"sources":["../../src/utils/is-browser.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable no-restricted-globals */\nexport const isBrowser: boolean =\n // @ts-ignore process.browser\n typeof process !== 'object' || String(process) !== '[object process]' || process.browser;\n"],"mappings":"AAKA,OAAO,MAAMA,SAAkB,GAE7B,OAAOC,OAAO,KAAK,QAAQ,IAAIC,MAAM,CAACD,OAAO,CAAC,KAAK,kBAAkB,IAAIA,OAAO,CAACE,OAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/polyfills",
|
|
3
|
-
"version": "4.1.0-alpha.
|
|
3
|
+
"version": "4.1.0-alpha.3",
|
|
4
4
|
"description": "Polyfills for TextEncoder/TextDecoder",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@babel/runtime": "^7.3.1",
|
|
49
|
-
"@loaders.gl/crypto": "4.1.0-alpha.
|
|
50
|
-
"@loaders.gl/loader-utils": "4.1.0-alpha.
|
|
49
|
+
"@loaders.gl/crypto": "4.1.0-alpha.3",
|
|
50
|
+
"@loaders.gl/loader-utils": "4.1.0-alpha.3",
|
|
51
51
|
"buffer": "^6.0.3",
|
|
52
52
|
"get-pixels": "^3.3.3",
|
|
53
53
|
"ndarray": "^1.0.19",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"through": "^2.3.8",
|
|
57
57
|
"web-streams-polyfill": "^3.2.1"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "b78075a7cb8d4ecd4aac84805ce74b8ceb400cf7"
|
|
60
60
|
}
|
|
@@ -8,7 +8,7 @@ export class NodeFile implements ReadableFile, WritableFile {
|
|
|
8
8
|
bigsize: bigint;
|
|
9
9
|
url: string;
|
|
10
10
|
|
|
11
|
-
constructor(path: string, flags: 'r' | 'w' | 'wx', mode?: number) {
|
|
11
|
+
constructor(path: string, flags: 'r' | 'w' | 'wx' | 'a+', mode?: number) {
|
|
12
12
|
path = resolvePath(path);
|
|
13
13
|
this.handle = fs.openSync(path, flags, mode);
|
|
14
14
|
const stats = fs.fstatSync(this.handle, {bigint: true});
|
|
@@ -23,6 +23,34 @@ export class NodeFile implements ReadableFile, WritableFile {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
async truncate(length: number): Promise<void> {
|
|
27
|
+
return new Promise((resolve, reject) => {
|
|
28
|
+
fs.ftruncate(this.handle, length, (err) => {
|
|
29
|
+
if (err) {
|
|
30
|
+
reject(err);
|
|
31
|
+
} else {
|
|
32
|
+
this.bigsize = BigInt(length);
|
|
33
|
+
this.size = Number(this.bigsize);
|
|
34
|
+
resolve();
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async append(data: Uint8Array): Promise<void> {
|
|
41
|
+
return new Promise((resolve, reject) => {
|
|
42
|
+
fs.appendFile(this.handle, data, (err) => {
|
|
43
|
+
if (err) {
|
|
44
|
+
reject(err);
|
|
45
|
+
} else {
|
|
46
|
+
this.bigsize = this.bigsize + BigInt(data.length);
|
|
47
|
+
this.size = Number(this.bigsize);
|
|
48
|
+
resolve();
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
26
54
|
async stat(): Promise<Stat> {
|
|
27
55
|
return await new Promise((resolve, reject) =>
|
|
28
56
|
fs.fstat(this.handle, {bigint: true}, (err, info) => {
|
package/src/index.browser.ts
CHANGED
package/src/utils/is-browser.ts
CHANGED