core-3nweb-client-lib 0.30.3 → 0.30.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/build/api-defs/asmail.d.ts +9 -6
- package/build/core/app-files.d.ts +4 -4
- package/build/core/app-files.js +2 -2
- package/build/core/asmail/asmail-cap-ipc.d.ts +1 -1
- package/build/core/asmail/asmail-cap-ipc.js +2 -3
- package/build/core/asmail/config/common.d.ts +2 -2
- package/build/core/asmail/config/index.d.ts +1 -1
- package/build/core/asmail/config/invitations-anon.d.ts +1 -1
- package/build/core/asmail/config/invitations-anon.js +1 -2
- package/build/core/asmail/config/published-intro-key.d.ts +2 -2
- package/build/core/asmail/config/published-intro-key.js +1 -2
- package/build/core/asmail/delivery/common.d.ts +6 -6
- package/build/core/asmail/delivery/common.js +3 -3
- package/build/core/asmail/delivery/index.d.ts +4 -4
- package/build/core/asmail/delivery/msg.d.ts +4 -4
- package/build/core/asmail/delivery/msg.js +3 -3
- package/build/core/asmail/inbox/attachments/fs.d.ts +1 -1
- package/build/core/asmail/inbox/attachments/fs.js +1 -2
- package/build/core/asmail/inbox/inbox-events.d.ts +4 -3
- package/build/core/asmail/inbox/inbox-events.js +1 -1
- package/build/core/asmail/inbox/index.d.ts +2 -2
- package/build/core/asmail/inbox/index.js +7 -4
- package/build/core/asmail/inbox/msg-indexing/index.d.ts +2 -2
- package/build/core/asmail/inbox/msg-indexing/logs-n-entries.d.ts +3 -3
- package/build/core/asmail/inbox/msg-indexing/logs-n-entries.js +2 -2
- package/build/core/asmail/inbox/msg-indexing/sql-indexing.d.ts +1 -1
- package/build/core/asmail/inbox/msg-indexing/sql-indexing.js +1 -2
- package/build/core/asmail/inbox/msg-on-disk.d.ts +2 -2
- package/build/core/asmail/inbox/msg-on-disk.js +3 -3
- package/build/core/asmail/index.d.ts +3 -3
- package/build/core/asmail/key-verification.js +2 -3
- package/build/core/asmail/keyring/common.d.ts +1 -1
- package/build/core/asmail/keyring/common.js +7 -7
- package/build/core/asmail/keyring/correspondent-keys.d.ts +1 -1
- package/build/core/asmail/keyring/correspondent-keys.js +5 -5
- package/build/core/asmail/keyring/index.d.ts +3 -3
- package/build/core/asmail/keyring/index.js +2 -2
- package/build/core/asmail/keyring/keyring-storage.d.ts +1 -1
- package/build/core/asmail/keyring/keyring-storage.js +1 -2
- package/build/core/asmail/msg/attachments-container.d.ts +3 -3
- package/build/core/asmail/msg/attachments-container.js +7 -8
- package/build/core/asmail/msg/opener.js +2 -2
- package/build/core/asmail/msg/packer.d.ts +2 -2
- package/build/core/asmail/sending-params/index.d.ts +3 -3
- package/build/core/asmail/sending-params/own-params.d.ts +3 -3
- package/build/core/asmail/sending-params/params-from-others.d.ts +3 -3
- package/build/core/id-manager/index.d.ts +4 -4
- package/build/core/id-manager/key-storage.d.ts +1 -1
- package/build/core/id-manager/mailerid-cap-ipc.d.ts +1 -1
- package/build/core/id-manager/mailerid-cap-ipc.js +2 -3
- package/build/core/index.d.ts +3 -3
- package/build/core/startup/sign-in.d.ts +6 -6
- package/build/core/startup/sign-in.js +2 -2
- package/build/core/startup/sign-up.d.ts +1 -1
- package/build/core/startup/sign-up.js +6 -6
- package/build/core/startup/startup-cap.d.ts +2 -2
- package/build/core/startup/startup-cap.js +4 -5
- package/build/core/storage/common/obj-info-file.js +12 -13
- package/build/core/storage/common/utils.js +2 -3
- package/build/core/storage/index.d.ts +5 -5
- package/build/core/storage/index.js +2 -2
- package/build/core/storage/local/storage.d.ts +3 -3
- package/build/core/storage/storage-cap-ipc.d.ts +1 -1
- package/build/core/storage/storage-cap-ipc.js +3 -4
- package/build/core/storage/synced/obj-files.d.ts +1 -1
- package/build/core/storage/synced/obj-status.d.ts +2 -2
- package/build/core/storage/synced/obj-status.js +2 -2
- package/build/core/storage/synced/storage.d.ts +4 -4
- package/build/core/storage/synced/upload-header-file.js +3 -3
- package/build/core/storage/synced/upsyncer.d.ts +1 -1
- package/build/core/storage/system-folders/apps-data.d.ts +1 -1
- package/build/core/storage/system-folders/index.d.ts +2 -2
- package/build/core/storage/system-folders/index.js +4 -4
- package/build/core-ipc/bytes.d.ts +2 -2
- package/build/core-ipc/bytes.js +4 -5
- package/build/core-ipc/common-caps.d.ts +1 -1
- package/build/core-ipc/common-caps.js +3 -4
- package/build/core-ipc/file.d.ts +13 -14
- package/build/core-ipc/file.js +31 -31
- package/build/core-ipc/fs.d.ts +3 -3
- package/build/core-ipc/fs.js +6 -6
- package/build/core-ipc/generic.d.ts +4 -4
- package/build/core-ipc/generic.js +3 -4
- package/build/core-ipc/log-cap.d.ts +1 -1
- package/build/core-ipc/log-cap.js +2 -3
- package/build/core-ipc/startup-caps.d.ts +1 -1
- package/build/core-ipc/startup-caps.js +2 -3
- package/build/ipc-via-protobuf/connector.d.ts +6 -7
- package/build/ipc-via-protobuf/connector.js +3 -3
- package/build/ipc-via-protobuf/protobuf-msg.d.ts +1 -2
- package/build/ipc-via-protobuf/protobuf-msg.js +20 -20
- package/build/lib-client/3nstorage/exceptions.d.ts +1 -1
- package/build/lib-client/3nstorage/exceptions.js +9 -10
- package/build/lib-client/3nstorage/service.d.ts +2 -2
- package/build/lib-client/3nstorage/util/file-based-json.d.ts +3 -3
- package/build/lib-client/3nstorage/util/for-arrays.js +1 -2
- package/build/lib-client/3nstorage/xsp-fs/attrs.d.ts +1 -2
- package/build/lib-client/3nstorage/xsp-fs/common.d.ts +12 -12
- package/build/lib-client/3nstorage/xsp-fs/common.js +5 -5
- package/build/lib-client/3nstorage/xsp-fs/file-node.d.ts +4 -4
- package/build/lib-client/3nstorage/xsp-fs/file.d.ts +15 -15
- package/build/lib-client/3nstorage/xsp-fs/folder-node-serialization.js +2 -3
- package/build/lib-client/3nstorage/xsp-fs/folder-node.d.ts +7 -7
- package/build/lib-client/3nstorage/xsp-fs/fs.d.ts +27 -27
- package/build/lib-client/3nstorage/xsp-fs/link-node.d.ts +2 -2
- package/build/lib-client/3nstorage/xsp-fs/node-in-fs.d.ts +7 -7
- package/build/lib-client/3nstorage/xsp-fs/node-in-fs.js +11 -11
- package/build/lib-client/3nstorage/xsp-fs/node-persistence.d.ts +2 -2
- package/build/lib-client/3nstorage/xsp-fs/xsp-payload-v1.js +1 -2
- package/build/lib-client/3nstorage/xsp-fs/xsp-payload-v2.js +3 -4
- package/build/lib-client/3nweb-signup.js +4 -5
- package/build/lib-client/asmail/recipient.d.ts +1 -1
- package/build/lib-client/asmail/recipient.js +4 -4
- package/build/lib-client/asmail/sender.d.ts +3 -3
- package/build/lib-client/asmail/sender.js +9 -9
- package/build/lib-client/cryptor/cryptor-in-worker.d.ts +2 -2
- package/build/lib-client/cryptor/cryptor.d.ts +2 -2
- package/build/lib-client/cryptor/cryptor.js +3 -3
- package/build/lib-client/cryptor/in-proc-js.js +1 -2
- package/build/lib-client/cryptor/in-proc-wasm.js +1 -2
- package/build/lib-client/cryptor/serialization-for-wasm.d.ts +1 -2
- package/build/lib-client/cryptor/serialization-for-wasm.js +6 -7
- package/build/lib-client/cryptor/wasm-mp1-modules.js +1 -2
- package/build/lib-client/cryptor-work-labels.js +1 -1
- package/build/lib-client/fs-utils/files-select.d.ts +3 -3
- package/build/lib-client/fs-utils/files-select.js +1 -2
- package/build/lib-client/fs-utils/files.d.ts +7 -7
- package/build/lib-client/fs-utils/files.js +7 -8
- package/build/lib-client/fs-utils/fs-collection.d.ts +1 -1
- package/build/lib-client/fs-utils/fs-collection.js +2 -3
- package/build/lib-client/fs-utils/fs-sync-utils.d.ts +5 -5
- package/build/lib-client/fs-utils/fs-sync-utils.js +4 -5
- package/build/lib-client/fs-utils/fs-view.d.ts +4 -4
- package/build/lib-client/fs-utils/fs-view.js +1 -2
- package/build/lib-client/key-derivation.js +3 -4
- package/build/lib-client/local-files/dev-file-sink.d.ts +2 -3
- package/build/lib-client/local-files/dev-file-src.d.ts +0 -1
- package/build/lib-client/local-files/device-fs.d.ts +18 -18
- package/build/lib-client/logging/log-to-file.d.ts +5 -5
- package/build/lib-client/logging/log-to-file.js +2 -2
- package/build/lib-client/mailer-id/login.js +2 -3
- package/build/lib-client/objs-on-disk/file-writing-proc.d.ts +1 -1
- package/build/lib-client/objs-on-disk/obj-folders.d.ts +1 -1
- package/build/lib-client/objs-on-disk/obj-folders.js +3 -3
- package/build/lib-client/objs-on-disk/obj-on-disk.d.ts +1 -1
- package/build/lib-client/protobuf-type.d.ts +0 -1
- package/build/lib-client/request-utils.d.ts +2 -4
- package/build/lib-client/request-utils.js +6 -6
- package/build/lib-client/service-locator.d.ts +3 -4
- package/build/lib-client/service-locator.js +5 -6
- package/build/lib-client/user-with-mid-session.d.ts +1 -1
- package/build/lib-client/user-with-mid-session.js +17 -17
- package/build/lib-client/user-with-pkl-session.js +16 -16
- package/build/lib-client/ws-utils.js +1 -2
- package/build/lib-common/assert.js +1 -2
- package/build/lib-common/async-cryptor-wrap.js +4 -5
- package/build/lib-common/async-fs-node.d.ts +0 -3
- package/build/lib-common/async-fs-node.js +35 -35
- package/build/lib-common/async-iter.js +2 -3
- package/build/lib-common/big-endian.d.ts +0 -1
- package/build/lib-common/big-endian.js +10 -11
- package/build/lib-common/binding.js +1 -2
- package/build/lib-common/buffer-utils.d.ts +0 -1
- package/build/lib-common/buffer-utils.js +9 -9
- package/build/lib-common/byte-streaming/bytes-fifo-buffer.js +5 -5
- package/build/lib-common/byte-streaming/pipe.d.ts +2 -2
- package/build/lib-common/byte-streaming/pipe.js +1 -2
- package/build/lib-common/byte-streaming/wrapping.d.ts +2 -2
- package/build/lib-common/byte-streaming/wrapping.js +3 -4
- package/build/lib-common/bytes-equal.js +1 -2
- package/build/lib-common/canonical-address.js +3 -4
- package/build/lib-common/exceptions/error.js +3 -4
- package/build/lib-common/exceptions/file.d.ts +2 -2
- package/build/lib-common/exceptions/file.js +7 -7
- package/build/lib-common/exceptions/http.js +2 -3
- package/build/lib-common/exceptions/runtime.js +1 -2
- package/build/lib-common/ipc/generic-ipc.d.ts +3 -3
- package/build/lib-common/ipc/generic-ipc.js +11 -11
- package/build/lib-common/ipc/ws-ipc.js +2 -2
- package/build/lib-common/json-utils.js +4 -5
- package/build/lib-common/jwkeys.d.ts +1 -1
- package/build/lib-common/jwkeys.js +13 -13
- package/build/lib-common/mid-sigs-NaCl-Ed.d.ts +3 -3
- package/build/lib-common/mid-sigs-NaCl-Ed.js +5 -5
- package/build/lib-common/obj-streaming/sink-utils.d.ts +2 -2
- package/build/lib-common/obj-streaming/sink-utils.js +2 -3
- package/build/lib-common/obj-streaming/wrapping.js +1 -2
- package/build/lib-common/objs-on-disk/file-layout.d.ts +4 -5
- package/build/lib-common/objs-on-disk/obj-file.d.ts +0 -1
- package/build/lib-common/objs-on-disk/utils.d.ts +3 -5
- package/build/lib-common/objs-on-disk/utils.js +5 -6
- package/build/lib-common/objs-on-disk/v1-obj-file-format.d.ts +0 -1
- package/build/lib-common/objs-on-disk/v1-obj-file-format.js +1 -1
- package/build/lib-common/processes/deferred.js +1 -2
- package/build/lib-common/processes/sleep.js +1 -2
- package/build/lib-common/processes/synced.d.ts +1 -1
- package/build/lib-common/processes/synced.js +2 -2
- package/build/lib-common/processes/timeout.js +1 -2
- package/build/lib-common/random-node.js +10 -11
- package/build/lib-common/service-api/3nstorage/owner.js +19 -19
- package/build/lib-common/service-api/asmail/config.js +3 -3
- package/build/lib-common/service-api/asmail/delivery.js +8 -8
- package/build/lib-common/service-api/asmail/retrieval.js +11 -11
- package/build/lib-common/service-api/mailer-id/login.js +2 -2
- package/build/lib-common/service-api/mailer-id/provisioning.js +2 -2
- package/build/lib-common/service-api/pub-key-login.js +2 -2
- package/build/lib-common/service-api/web-socket-base.d.ts +1 -1
- package/build/lib-common/service-api/web-socket-base.js +3 -3
- package/build/lib-common/session-encryptor.js +1 -2
- package/build/lib-common/timed-cache.js +1 -2
- package/build/lib-common/user-admin-api/signup.js +4 -4
- package/build/lib-common/utils-for-observables.js +5 -5
- package/build/lib-sqlite-on-3nstorage/deferred.js +1 -2
- package/build/lib-sqlite-on-3nstorage/index.d.ts +5 -5
- package/build/lib-sqlite-on-3nstorage/index.js +2 -2
- package/build/lib-sqlite-on-3nstorage/synced.d.ts +1 -1
- package/build/lib-sqlite-on-3nstorage/synced.js +2 -2
- package/build/raw-3nweb-clients.d.ts +7 -7
- package/build/raw-3nweb-clients.js +2 -2
- package/package.json +2 -2
|
@@ -16,7 +16,41 @@
|
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.Stats = void 0;
|
|
20
|
+
exports.readFile = readFile;
|
|
21
|
+
exports.writeFile = writeFile;
|
|
22
|
+
exports.appendFile = appendFile;
|
|
23
|
+
exports.mkdir = mkdir;
|
|
24
|
+
exports.open = open;
|
|
25
|
+
exports.close = close;
|
|
26
|
+
exports.symlink = symlink;
|
|
27
|
+
exports.readlink = readlink;
|
|
28
|
+
exports.lstat = lstat;
|
|
29
|
+
exports.stat = stat;
|
|
30
|
+
exports.fstat = fstat;
|
|
31
|
+
exports.readdir = readdir;
|
|
32
|
+
exports.rmdir = rmdir;
|
|
33
|
+
exports.unlink = unlink;
|
|
34
|
+
exports.rename = rename;
|
|
35
|
+
exports.truncate = truncate;
|
|
36
|
+
exports.ftruncate = ftruncate;
|
|
37
|
+
exports.readToBuf = readToBuf;
|
|
38
|
+
exports.writeFromBuf = writeFromBuf;
|
|
39
|
+
exports.createEmptyFile = createEmptyFile;
|
|
40
|
+
exports.existsFolder = existsFolder;
|
|
41
|
+
exports.existsFolderSync = existsFolderSync;
|
|
42
|
+
exports.existsFileSync = existsFileSync;
|
|
43
|
+
exports.getFileSize = getFileSize;
|
|
44
|
+
exports.getFolderContentSize = getFolderContentSize;
|
|
45
|
+
exports.write = write;
|
|
46
|
+
exports.append = append;
|
|
47
|
+
exports.streamToExistingFile = streamToExistingFile;
|
|
48
|
+
exports.read = read;
|
|
49
|
+
exports.rmDirWithContent = rmDirWithContent;
|
|
50
|
+
exports.streamFromFile = streamFromFile;
|
|
51
|
+
exports.copyFile = copyFile;
|
|
52
|
+
exports.copyTree = copyTree;
|
|
53
|
+
exports.ensureFolderExists = ensureFolderExists;
|
|
20
54
|
const fs = require("fs");
|
|
21
55
|
const fs_1 = require("fs");
|
|
22
56
|
const file_1 = require("./exceptions/file");
|
|
@@ -48,7 +82,6 @@ function readFile(path, options) {
|
|
|
48
82
|
}
|
|
49
83
|
});
|
|
50
84
|
}
|
|
51
|
-
exports.readFile = readFile;
|
|
52
85
|
function writeFile(path, data, options = {}) {
|
|
53
86
|
return new Promise((resolve, reject) => {
|
|
54
87
|
fs.writeFile(path, data, options, err => {
|
|
@@ -61,7 +94,6 @@ function writeFile(path, data, options = {}) {
|
|
|
61
94
|
});
|
|
62
95
|
});
|
|
63
96
|
}
|
|
64
|
-
exports.writeFile = writeFile;
|
|
65
97
|
function appendFile(path, data, options = {}) {
|
|
66
98
|
return new Promise((resolve, reject) => {
|
|
67
99
|
fs.appendFile(path, data, options, err => {
|
|
@@ -74,7 +106,6 @@ function appendFile(path, data, options = {}) {
|
|
|
74
106
|
});
|
|
75
107
|
});
|
|
76
108
|
}
|
|
77
|
-
exports.appendFile = appendFile;
|
|
78
109
|
function mkdir(path, options) {
|
|
79
110
|
return new Promise((resolve, reject) => {
|
|
80
111
|
fs.mkdir(path, options, (err) => {
|
|
@@ -87,7 +118,6 @@ function mkdir(path, options) {
|
|
|
87
118
|
});
|
|
88
119
|
});
|
|
89
120
|
}
|
|
90
|
-
exports.mkdir = mkdir;
|
|
91
121
|
function open(path, flags) {
|
|
92
122
|
return new Promise((resolve, reject) => {
|
|
93
123
|
fs.open(path, flags, (err, df) => {
|
|
@@ -100,7 +130,6 @@ function open(path, flags) {
|
|
|
100
130
|
});
|
|
101
131
|
});
|
|
102
132
|
}
|
|
103
|
-
exports.open = open;
|
|
104
133
|
function writeOrig(fd, buffer, offset, length, position) {
|
|
105
134
|
return new Promise((resolve, reject) => {
|
|
106
135
|
const cb = (err, written) => {
|
|
@@ -143,7 +172,6 @@ function close(fd) {
|
|
|
143
172
|
});
|
|
144
173
|
});
|
|
145
174
|
}
|
|
146
|
-
exports.close = close;
|
|
147
175
|
function symlink(target, path, type) {
|
|
148
176
|
return new Promise((resolve, reject) => {
|
|
149
177
|
fs.symlink(target, path, type, (err) => {
|
|
@@ -156,7 +184,6 @@ function symlink(target, path, type) {
|
|
|
156
184
|
});
|
|
157
185
|
});
|
|
158
186
|
}
|
|
159
|
-
exports.symlink = symlink;
|
|
160
187
|
function readlink(path) {
|
|
161
188
|
return new Promise((resolve, reject) => {
|
|
162
189
|
fs.readlink(path, (err, targetPath) => {
|
|
@@ -169,7 +196,6 @@ function readlink(path) {
|
|
|
169
196
|
});
|
|
170
197
|
});
|
|
171
198
|
}
|
|
172
|
-
exports.readlink = readlink;
|
|
173
199
|
function lstat(path) {
|
|
174
200
|
return new Promise((resolve, reject) => {
|
|
175
201
|
fs.lstat(path, (err, stat) => {
|
|
@@ -182,7 +208,6 @@ function lstat(path) {
|
|
|
182
208
|
});
|
|
183
209
|
});
|
|
184
210
|
}
|
|
185
|
-
exports.lstat = lstat;
|
|
186
211
|
function stat(path) {
|
|
187
212
|
return new Promise((resolve, reject) => {
|
|
188
213
|
fs.stat(path, (err, stat) => {
|
|
@@ -195,7 +220,6 @@ function stat(path) {
|
|
|
195
220
|
});
|
|
196
221
|
});
|
|
197
222
|
}
|
|
198
|
-
exports.stat = stat;
|
|
199
223
|
function fstat(fd) {
|
|
200
224
|
return new Promise((resolve, reject) => {
|
|
201
225
|
// from some moment, typing of fs.fstat is broken
|
|
@@ -209,7 +233,6 @@ function fstat(fd) {
|
|
|
209
233
|
});
|
|
210
234
|
});
|
|
211
235
|
}
|
|
212
|
-
exports.fstat = fstat;
|
|
213
236
|
function readdir(path) {
|
|
214
237
|
return new Promise((resolve, reject) => {
|
|
215
238
|
fs.readdir(path, (err, list) => {
|
|
@@ -222,7 +245,6 @@ function readdir(path) {
|
|
|
222
245
|
});
|
|
223
246
|
});
|
|
224
247
|
}
|
|
225
|
-
exports.readdir = readdir;
|
|
226
248
|
function rmdir(path) {
|
|
227
249
|
return new Promise((resolve, reject) => {
|
|
228
250
|
fs.rmdir(path, (err) => {
|
|
@@ -235,7 +257,6 @@ function rmdir(path) {
|
|
|
235
257
|
});
|
|
236
258
|
});
|
|
237
259
|
}
|
|
238
|
-
exports.rmdir = rmdir;
|
|
239
260
|
function unlink(path) {
|
|
240
261
|
return new Promise((resolve, reject) => {
|
|
241
262
|
fs.unlink(path, (err) => {
|
|
@@ -248,7 +269,6 @@ function unlink(path) {
|
|
|
248
269
|
});
|
|
249
270
|
});
|
|
250
271
|
}
|
|
251
|
-
exports.unlink = unlink;
|
|
252
272
|
function rename(oldPath, newPath) {
|
|
253
273
|
return new Promise((resolve, reject) => {
|
|
254
274
|
fs.rename(oldPath, newPath, (err) => {
|
|
@@ -261,7 +281,6 @@ function rename(oldPath, newPath) {
|
|
|
261
281
|
});
|
|
262
282
|
});
|
|
263
283
|
}
|
|
264
|
-
exports.rename = rename;
|
|
265
284
|
function truncate(path, size) {
|
|
266
285
|
return new Promise((resolve, reject) => {
|
|
267
286
|
fs.truncate(path, size, (err) => {
|
|
@@ -274,7 +293,6 @@ function truncate(path, size) {
|
|
|
274
293
|
});
|
|
275
294
|
});
|
|
276
295
|
}
|
|
277
|
-
exports.truncate = truncate;
|
|
278
296
|
function ftruncate(fd, size) {
|
|
279
297
|
return new Promise((resolve, reject) => {
|
|
280
298
|
fs.ftruncate(fd, size, (err) => {
|
|
@@ -287,7 +305,6 @@ function ftruncate(fd, size) {
|
|
|
287
305
|
});
|
|
288
306
|
});
|
|
289
307
|
}
|
|
290
|
-
exports.ftruncate = ftruncate;
|
|
291
308
|
/**
|
|
292
309
|
* @param fd is an open file descriptor
|
|
293
310
|
* @param pos is a position in the file, from which reading should start
|
|
@@ -313,7 +330,6 @@ async function readToBuf(fd, pos, buf) {
|
|
|
313
330
|
pos += bNum;
|
|
314
331
|
}
|
|
315
332
|
}
|
|
316
|
-
exports.readToBuf = readToBuf;
|
|
317
333
|
/**
|
|
318
334
|
* @param fd is an open file descriptor
|
|
319
335
|
* @param pos is a position in the file, from which writing should start
|
|
@@ -331,7 +347,6 @@ async function writeFromBuf(fd, pos, buf) {
|
|
|
331
347
|
pos += bNum;
|
|
332
348
|
}
|
|
333
349
|
}
|
|
334
|
-
exports.writeFromBuf = writeFromBuf;
|
|
335
350
|
const SINGLE_BYTE_BUF = Buffer.alloc(1);
|
|
336
351
|
SINGLE_BYTE_BUF[0] = 0;
|
|
337
352
|
/**
|
|
@@ -366,7 +381,6 @@ async function createEmptyFile(filePath, fileSize, keepFileOpen) {
|
|
|
366
381
|
throw exc;
|
|
367
382
|
}
|
|
368
383
|
}
|
|
369
|
-
exports.createEmptyFile = createEmptyFile;
|
|
370
384
|
/**
|
|
371
385
|
* @param path
|
|
372
386
|
* @return a promise, resolvable to true, if given path represents directory,
|
|
@@ -389,7 +403,6 @@ async function existsFolder(path) {
|
|
|
389
403
|
throw e;
|
|
390
404
|
}
|
|
391
405
|
}
|
|
392
|
-
exports.existsFolder = existsFolder;
|
|
393
406
|
/**
|
|
394
407
|
* @param path
|
|
395
408
|
* @return true, if given path represents directory, or false, if it does not.
|
|
@@ -410,7 +423,6 @@ function existsFolderSync(path) {
|
|
|
410
423
|
throw e;
|
|
411
424
|
}
|
|
412
425
|
}
|
|
413
|
-
exports.existsFolderSync = existsFolderSync;
|
|
414
426
|
/**
|
|
415
427
|
* @param path
|
|
416
428
|
* @return true, if given path represents file, or false, if it does not.
|
|
@@ -431,7 +443,6 @@ function existsFileSync(path) {
|
|
|
431
443
|
throw e;
|
|
432
444
|
}
|
|
433
445
|
}
|
|
434
|
-
exports.existsFileSync = existsFileSync;
|
|
435
446
|
/**
|
|
436
447
|
* @param filePath
|
|
437
448
|
* @return a promise, resolvable to file's size.
|
|
@@ -440,7 +451,6 @@ async function getFileSize(filePath) {
|
|
|
440
451
|
const st = await stat(filePath);
|
|
441
452
|
return st.size;
|
|
442
453
|
}
|
|
443
|
-
exports.getFileSize = getFileSize;
|
|
444
454
|
/**
|
|
445
455
|
* This returns a promise of total size of given folder's content.
|
|
446
456
|
* Sizes of linked objects are not included.
|
|
@@ -461,7 +471,6 @@ async function getFolderContentSize(folderPath) {
|
|
|
461
471
|
}
|
|
462
472
|
return size;
|
|
463
473
|
}
|
|
464
|
-
exports.getFolderContentSize = getFolderContentSize;
|
|
465
474
|
/**
|
|
466
475
|
* @param fd is an open file descriptor
|
|
467
476
|
* @param pos is a position in the file, from which writing should start
|
|
@@ -479,7 +488,6 @@ async function write(fd, pos, buf) {
|
|
|
479
488
|
pos += bNum;
|
|
480
489
|
}
|
|
481
490
|
}
|
|
482
|
-
exports.write = write;
|
|
483
491
|
/**
|
|
484
492
|
* @param fd is an open file descriptor in append mode.
|
|
485
493
|
* @param buf is a buffer, from which all bytes should be written into the file.
|
|
@@ -492,7 +500,6 @@ async function append(fd, buf) {
|
|
|
492
500
|
bytesWritten += bNum;
|
|
493
501
|
}
|
|
494
502
|
}
|
|
495
|
-
exports.append = append;
|
|
496
503
|
/**
|
|
497
504
|
* @param filePath is a path to an existing file
|
|
498
505
|
* @param pos is a position in the file, from which writing should start
|
|
@@ -594,7 +601,6 @@ async function streamToExistingFile(filePath, pos, len, src, bufSize) {
|
|
|
594
601
|
src.resume(); // noop, if stream wasn't paused
|
|
595
602
|
return deferred.promise;
|
|
596
603
|
}
|
|
597
|
-
exports.streamToExistingFile = streamToExistingFile;
|
|
598
604
|
/**
|
|
599
605
|
* @param fd is an open file descriptor
|
|
600
606
|
* @param pos is a position in the file, from which reading should start
|
|
@@ -620,7 +626,6 @@ async function read(fd, pos, buf) {
|
|
|
620
626
|
pos += bNum;
|
|
621
627
|
}
|
|
622
628
|
}
|
|
623
|
-
exports.read = read;
|
|
624
629
|
/**
|
|
625
630
|
* @param filePath is a file's path, from which to read
|
|
626
631
|
* @param pos is a position in the file, from which reading should start
|
|
@@ -669,7 +674,6 @@ async function rmDirWithContent(folder) {
|
|
|
669
674
|
await Promise.all(rmTasks);
|
|
670
675
|
await rmdir(folder);
|
|
671
676
|
}
|
|
672
|
-
exports.rmDirWithContent = rmDirWithContent;
|
|
673
677
|
/**
|
|
674
678
|
* @param w is a writable stream
|
|
675
679
|
* @param buf is buffer of bytes that should be sunk into given stream
|
|
@@ -719,7 +723,6 @@ async function streamFromFile(filePath, pos, len, sink, bufSize) {
|
|
|
719
723
|
byteCount += buf.length;
|
|
720
724
|
}
|
|
721
725
|
}
|
|
722
|
-
exports.streamFromFile = streamFromFile;
|
|
723
726
|
/**
|
|
724
727
|
* This pipes source file into destination file.
|
|
725
728
|
* @param src
|
|
@@ -749,7 +752,6 @@ function copyFile(src, dst, overwrite = false, dstMode = '660') {
|
|
|
749
752
|
dstStream.on('error', onErr);
|
|
750
753
|
});
|
|
751
754
|
}
|
|
752
|
-
exports.copyFile = copyFile;
|
|
753
755
|
/**
|
|
754
756
|
* This copies tree of files from source to destination folders.
|
|
755
757
|
* Target folders may exist in a destination tree.
|
|
@@ -788,7 +790,6 @@ async function copyTree(src, dst, fileOverwrite = false) {
|
|
|
788
790
|
}
|
|
789
791
|
await Promise.all(cpTasks);
|
|
790
792
|
}
|
|
791
|
-
exports.copyTree = copyTree;
|
|
792
793
|
/**
|
|
793
794
|
* This function checks that given folder exists. If folder is not present,
|
|
794
795
|
* it is created, recreating whole folder tree, if needed.
|
|
@@ -808,5 +809,4 @@ async function ensureFolderExists(path) {
|
|
|
808
809
|
});
|
|
809
810
|
});
|
|
810
811
|
}
|
|
811
|
-
exports.ensureFolderExists = ensureFolderExists;
|
|
812
812
|
Object.freeze(exports);
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
You should have received a copy of the GNU General Public License along with
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.
|
|
18
|
+
exports.asyncIteration = asyncIteration;
|
|
19
|
+
exports.asyncFind = asyncFind;
|
|
19
20
|
async function asyncIteration(iter, func) {
|
|
20
21
|
let item;
|
|
21
22
|
do {
|
|
@@ -26,7 +27,6 @@ async function asyncIteration(iter, func) {
|
|
|
26
27
|
await func(item.value);
|
|
27
28
|
} while (true);
|
|
28
29
|
}
|
|
29
|
-
exports.asyncIteration = asyncIteration;
|
|
30
30
|
async function asyncFind(iter, predicate) {
|
|
31
31
|
let item;
|
|
32
32
|
do {
|
|
@@ -40,5 +40,4 @@ async function asyncFind(iter, predicate) {
|
|
|
40
40
|
}
|
|
41
41
|
} while (true);
|
|
42
42
|
}
|
|
43
|
-
exports.asyncFind = asyncFind;
|
|
44
43
|
Object.freeze(exports);
|
|
@@ -16,7 +16,16 @@
|
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.packUintTo2Bytes = packUintTo2Bytes;
|
|
20
|
+
exports.uintFrom2Bytes = uintFrom2Bytes;
|
|
21
|
+
exports.packUintTo3Bytes = packUintTo3Bytes;
|
|
22
|
+
exports.uintFrom3Bytes = uintFrom3Bytes;
|
|
23
|
+
exports.packUintTo4Bytes = packUintTo4Bytes;
|
|
24
|
+
exports.uintFrom4Bytes = uintFrom4Bytes;
|
|
25
|
+
exports.packUintTo6Bytes = packUintTo6Bytes;
|
|
26
|
+
exports.uintFrom6Bytes = uintFrom6Bytes;
|
|
27
|
+
exports.packUintTo8Bytes = packUintTo8Bytes;
|
|
28
|
+
exports.uintFrom8Bytes = uintFrom8Bytes;
|
|
20
29
|
/**
|
|
21
30
|
* @param u is an unsigned integer up to 16-bits to be stored big-endian way in
|
|
22
31
|
* 2 bytes.
|
|
@@ -31,7 +40,6 @@ function packUintTo2Bytes(u, b, i) {
|
|
|
31
40
|
b[i] = u >>> 8;
|
|
32
41
|
b[i + 1] = u;
|
|
33
42
|
}
|
|
34
|
-
exports.packUintTo2Bytes = packUintTo2Bytes;
|
|
35
43
|
/**
|
|
36
44
|
* @param x
|
|
37
45
|
* @param i
|
|
@@ -44,7 +52,6 @@ function uintFrom2Bytes(x, i = 0) {
|
|
|
44
52
|
}
|
|
45
53
|
return (x[i] << 8) | x[i + 1];
|
|
46
54
|
}
|
|
47
|
-
exports.uintFrom2Bytes = uintFrom2Bytes;
|
|
48
55
|
/**
|
|
49
56
|
* @param u is an unsigned integer up to 24-bits to be stored big-endian way in
|
|
50
57
|
* 3 bytes.
|
|
@@ -60,7 +67,6 @@ function packUintTo3Bytes(u, b, i) {
|
|
|
60
67
|
b[i + 1] = u >>> 8;
|
|
61
68
|
b[i + 2] = u;
|
|
62
69
|
}
|
|
63
|
-
exports.packUintTo3Bytes = packUintTo3Bytes;
|
|
64
70
|
/**
|
|
65
71
|
* @param x
|
|
66
72
|
* @param i
|
|
@@ -73,7 +79,6 @@ function uintFrom3Bytes(x, i = 0) {
|
|
|
73
79
|
}
|
|
74
80
|
return (x[i] << 16) | (x[i + 1] << 8) | x[i + 2];
|
|
75
81
|
}
|
|
76
|
-
exports.uintFrom3Bytes = uintFrom3Bytes;
|
|
77
82
|
/**
|
|
78
83
|
* @param u is an unsigned integer up to 32-bits to be stored big-endian way in
|
|
79
84
|
* 4 bytes.
|
|
@@ -90,7 +95,6 @@ function packUintTo4Bytes(u, b, i) {
|
|
|
90
95
|
b[i + 2] = u >>> 8;
|
|
91
96
|
b[i + 3] = u;
|
|
92
97
|
}
|
|
93
|
-
exports.packUintTo4Bytes = packUintTo4Bytes;
|
|
94
98
|
/**
|
|
95
99
|
* @param x
|
|
96
100
|
* @param i
|
|
@@ -106,7 +110,6 @@ function uintFrom4Bytes(x, i = 0) {
|
|
|
106
110
|
// float number. Hence, we need a bit different operation here.
|
|
107
111
|
return (x[i] * 0x1000000) + ((x[i + 1] << 16) | (x[i + 2] << 8) | x[i + 3]);
|
|
108
112
|
}
|
|
109
|
-
exports.uintFrom4Bytes = uintFrom4Bytes;
|
|
110
113
|
/**
|
|
111
114
|
* @param u is an unsigned integer up to 48-bits to be stored big-endian way in
|
|
112
115
|
* 6 bytes.
|
|
@@ -127,7 +130,6 @@ function packUintTo6Bytes(u, b, i) {
|
|
|
127
130
|
b[i + 4] = l >>> 8;
|
|
128
131
|
b[i + 5] = l;
|
|
129
132
|
}
|
|
130
|
-
exports.packUintTo6Bytes = packUintTo6Bytes;
|
|
131
133
|
/**
|
|
132
134
|
* @param x
|
|
133
135
|
* @param i
|
|
@@ -145,7 +147,6 @@ function uintFrom6Bytes(x, i = 0) {
|
|
|
145
147
|
const l = (x[i] * 0x1000000) + ((x[i + 3] << 16) | (x[i + 4] << 8) | x[i + 5]);
|
|
146
148
|
return (h * 0x100000000 + l);
|
|
147
149
|
}
|
|
148
|
-
exports.uintFrom6Bytes = uintFrom6Bytes;
|
|
149
150
|
/**
|
|
150
151
|
* @param u is an unsigned integer up to 53-bits to be stored big-endian way in
|
|
151
152
|
* 8 bytes.
|
|
@@ -168,7 +169,6 @@ function packUintTo8Bytes(u, b, i) {
|
|
|
168
169
|
b[i + 6] = l >>> 8;
|
|
169
170
|
b[i + 7] = l;
|
|
170
171
|
}
|
|
171
|
-
exports.packUintTo8Bytes = packUintTo8Bytes;
|
|
172
172
|
/**
|
|
173
173
|
* @param x
|
|
174
174
|
* @param i
|
|
@@ -186,5 +186,4 @@ function uintFrom8Bytes(x, i = 0) {
|
|
|
186
186
|
const l = (x[i + 4] * 0x1000000) + ((x[i + 5] << 16) | (x[i + 6] << 8) | x[i + 7]);
|
|
187
187
|
return (h * 0x100000000 + l);
|
|
188
188
|
}
|
|
189
|
-
exports.uintFrom8Bytes = uintFrom8Bytes;
|
|
190
189
|
Object.freeze(exports);
|
|
@@ -15,9 +15,8 @@
|
|
|
15
15
|
You should have received a copy of the GNU General Public License along with
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.bind =
|
|
18
|
+
exports.bind = bind;
|
|
19
19
|
function bind(thisArg, func) {
|
|
20
20
|
return func.bind(thisArg);
|
|
21
21
|
}
|
|
22
|
-
exports.bind = bind;
|
|
23
22
|
Object.freeze(exports);
|
|
@@ -15,7 +15,12 @@
|
|
|
15
15
|
You should have received a copy of the GNU General Public License along with
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.
|
|
18
|
+
exports.utf8 = exports.base64urlSafe = exports.base64 = exports.EMPTY_BUFFER = void 0;
|
|
19
|
+
exports.toBuffer = toBuffer;
|
|
20
|
+
exports.bufFromJson = bufFromJson;
|
|
21
|
+
exports.joinByteArrs = joinByteArrs;
|
|
22
|
+
exports.byteLengthIn = byteLengthIn;
|
|
23
|
+
exports.makeUint8ArrayCopy = makeUint8ArrayCopy;
|
|
19
24
|
exports.EMPTY_BUFFER = Buffer.alloc(0);
|
|
20
25
|
/**
|
|
21
26
|
* Buffer and Uint8Array are intimately linked in Node, starting with some
|
|
@@ -35,7 +40,6 @@ function toBuffer(bytes) {
|
|
|
35
40
|
}
|
|
36
41
|
return Buffer.from(bytes.buffer, bytes.byteOffset, bytes.length);
|
|
37
42
|
}
|
|
38
|
-
exports.toBuffer = toBuffer;
|
|
39
43
|
/**
|
|
40
44
|
* Node's JSON.stringify turns Buffer into a particular json.
|
|
41
45
|
* This function turns this json back to Buffer.
|
|
@@ -48,7 +52,6 @@ function bufFromJson(json) {
|
|
|
48
52
|
}
|
|
49
53
|
return Buffer.from(json.data);
|
|
50
54
|
}
|
|
51
|
-
exports.bufFromJson = bufFromJson;
|
|
52
55
|
var base64;
|
|
53
56
|
(function (base64) {
|
|
54
57
|
function pack(bytes) {
|
|
@@ -60,7 +63,7 @@ var base64;
|
|
|
60
63
|
return Buffer.from(str, 'base64');
|
|
61
64
|
}
|
|
62
65
|
base64.open = open;
|
|
63
|
-
})(base64
|
|
66
|
+
})(base64 || (exports.base64 = base64 = {}));
|
|
64
67
|
Object.freeze(base64);
|
|
65
68
|
var base64urlSafe;
|
|
66
69
|
(function (base64urlSafe) {
|
|
@@ -78,7 +81,7 @@ var base64urlSafe;
|
|
|
78
81
|
return base64.open(str);
|
|
79
82
|
}
|
|
80
83
|
base64urlSafe.open = open;
|
|
81
|
-
})(base64urlSafe
|
|
84
|
+
})(base64urlSafe || (exports.base64urlSafe = base64urlSafe = {}));
|
|
82
85
|
Object.freeze(base64);
|
|
83
86
|
var utf8;
|
|
84
87
|
(function (utf8) {
|
|
@@ -91,7 +94,7 @@ var utf8;
|
|
|
91
94
|
return buf.toString('utf8');
|
|
92
95
|
}
|
|
93
96
|
utf8.open = open;
|
|
94
|
-
})(utf8
|
|
97
|
+
})(utf8 || (exports.utf8 = utf8 = {}));
|
|
95
98
|
Object.freeze(utf8);
|
|
96
99
|
function joinByteArrs(arrs) {
|
|
97
100
|
let totalLen = 0;
|
|
@@ -106,7 +109,6 @@ function joinByteArrs(arrs) {
|
|
|
106
109
|
}
|
|
107
110
|
return allBytes;
|
|
108
111
|
}
|
|
109
|
-
exports.joinByteArrs = joinByteArrs;
|
|
110
112
|
function byteLengthIn(arrs) {
|
|
111
113
|
let len = 0;
|
|
112
114
|
for (let i = 0; i < arrs.length; i += 1) {
|
|
@@ -114,11 +116,9 @@ function byteLengthIn(arrs) {
|
|
|
114
116
|
}
|
|
115
117
|
return len;
|
|
116
118
|
}
|
|
117
|
-
exports.byteLengthIn = byteLengthIn;
|
|
118
119
|
function makeUint8ArrayCopy(arr) {
|
|
119
120
|
const copy = new Uint8Array(arr.length);
|
|
120
121
|
copy.set(arr);
|
|
121
122
|
return copy;
|
|
122
123
|
}
|
|
123
|
-
exports.makeUint8ArrayCopy = makeUint8ArrayCopy;
|
|
124
124
|
Object.freeze(exports);
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.BytesFIFOBuffer = void 0;
|
|
19
19
|
class BytesFIFOBuffer {
|
|
20
|
-
constructor() {
|
|
21
|
-
this.queue = [];
|
|
22
|
-
this.bytesLen = 0;
|
|
23
|
-
Object.seal(this);
|
|
24
|
-
}
|
|
25
20
|
get length() {
|
|
26
21
|
return this.bytesLen;
|
|
27
22
|
}
|
|
28
23
|
get queueLength() {
|
|
29
24
|
return this.queue.length;
|
|
30
25
|
}
|
|
26
|
+
constructor() {
|
|
27
|
+
this.queue = [];
|
|
28
|
+
this.bytesLen = 0;
|
|
29
|
+
Object.seal(this);
|
|
30
|
+
}
|
|
31
31
|
clear() {
|
|
32
32
|
this.queue = [];
|
|
33
33
|
this.bytesLen = 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type FileByteSource = web3n.files.FileByteSource;
|
|
2
|
+
type FileByteSink = web3n.files.FileByteSink;
|
|
3
3
|
/**
|
|
4
4
|
* This function pipes bytes from a given source to a given sink. Returned
|
|
5
5
|
* promise resolves to a total number of piped bytes.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
You should have received a copy of the GNU General Public License along with
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.pipe =
|
|
18
|
+
exports.pipe = pipe;
|
|
19
19
|
const sink_utils_1 = require("../obj-streaming/sink-utils");
|
|
20
20
|
/**
|
|
21
21
|
* This function pipes bytes from a given source to a given sink. Returned
|
|
@@ -53,5 +53,4 @@ async function pipe(src, sink, progressCB, closeSink = true, bufSize = 64 * 1024
|
|
|
53
53
|
throw err;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
exports.pipe = pipe;
|
|
57
56
|
Object.freeze(exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ByteSource } from "xsp-files";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type FileByteSource = web3n.files.FileByteSource;
|
|
3
|
+
type FileByteSink = web3n.files.FileByteSink;
|
|
4
4
|
export declare function wrapAndSyncFileSink(sink: FileByteSink): FileByteSink;
|
|
5
5
|
export declare function wrapAndSyncSource(src: ByteSource): ByteSource;
|
|
6
6
|
export declare function wrapAndSyncFileSource(src: FileByteSource): FileByteSource;
|
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.wrapAndSyncFileSink = wrapAndSyncFileSink;
|
|
20
|
+
exports.wrapAndSyncSource = wrapAndSyncSource;
|
|
21
|
+
exports.wrapAndSyncFileSource = wrapAndSyncFileSource;
|
|
20
22
|
const synced_1 = require("../processes/synced");
|
|
21
23
|
function wrapAndSyncFileSink(sink) {
|
|
22
24
|
const syncProc = new synced_1.SingleProc();
|
|
@@ -29,7 +31,6 @@ function wrapAndSyncFileSink(sink) {
|
|
|
29
31
|
};
|
|
30
32
|
return w;
|
|
31
33
|
}
|
|
32
|
-
exports.wrapAndSyncFileSink = wrapAndSyncFileSink;
|
|
33
34
|
function wrapAndSyncSource(src) {
|
|
34
35
|
const syncProc = new synced_1.SingleProc();
|
|
35
36
|
const w = {
|
|
@@ -41,7 +42,6 @@ function wrapAndSyncSource(src) {
|
|
|
41
42
|
};
|
|
42
43
|
return w;
|
|
43
44
|
}
|
|
44
|
-
exports.wrapAndSyncSource = wrapAndSyncSource;
|
|
45
45
|
function wrapAndSyncFileSource(src) {
|
|
46
46
|
const syncProc = new synced_1.SingleProc();
|
|
47
47
|
const w = {
|
|
@@ -53,5 +53,4 @@ function wrapAndSyncFileSource(src) {
|
|
|
53
53
|
};
|
|
54
54
|
return w;
|
|
55
55
|
}
|
|
56
|
-
exports.wrapAndSyncFileSource = wrapAndSyncFileSource;
|
|
57
56
|
Object.freeze(exports);
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
You should have received a copy of the GNU General Public License along with
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.bytesEqual =
|
|
18
|
+
exports.bytesEqual = bytesEqual;
|
|
19
19
|
function bytesEqual(a, b) {
|
|
20
20
|
if (a.BYTES_PER_ELEMENT !== b.BYTES_PER_ELEMENT) {
|
|
21
21
|
return false;
|
|
@@ -30,4 +30,3 @@ function bytesEqual(a, b) {
|
|
|
30
30
|
}
|
|
31
31
|
return true;
|
|
32
32
|
}
|
|
33
|
-
exports.bytesEqual = bytesEqual;
|
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.toCanonicalAddress = toCanonicalAddress;
|
|
20
|
+
exports.areAddressesEqual = areAddressesEqual;
|
|
21
|
+
exports.checkAndTransformAddress = checkAndTransformAddress;
|
|
20
22
|
const punycode_1 = require("punycode");
|
|
21
23
|
/**
|
|
22
24
|
* @param address
|
|
@@ -38,7 +40,6 @@ function toCanonicalAddress(address) {
|
|
|
38
40
|
checkDomainString(domain, address);
|
|
39
41
|
return (user + '@' + domain).toLowerCase();
|
|
40
42
|
}
|
|
41
|
-
exports.toCanonicalAddress = toCanonicalAddress;
|
|
42
43
|
const whiteSpace = /\s/g;
|
|
43
44
|
const invalidInDomain = /[^a-zA-Z0-9\-\.]/;
|
|
44
45
|
function checkDomainString(d, addrForErrMsg) {
|
|
@@ -79,7 +80,6 @@ function areAddressesEqual(a, b) {
|
|
|
79
80
|
}
|
|
80
81
|
return (canonicalA === canonicalB);
|
|
81
82
|
}
|
|
82
|
-
exports.areAddressesEqual = areAddressesEqual;
|
|
83
83
|
/**
|
|
84
84
|
* @param address
|
|
85
85
|
* @return if given address is ok, its canonical form is returned.
|
|
@@ -91,5 +91,4 @@ function checkAndTransformAddress(address) {
|
|
|
91
91
|
}
|
|
92
92
|
catch (err) { }
|
|
93
93
|
}
|
|
94
|
-
exports.checkAndTransformAddress = checkAndTransformAddress;
|
|
95
94
|
Object.freeze(exports);
|
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
You should have received a copy of the GNU General Public License along with
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.
|
|
18
|
+
exports.errWithCause = errWithCause;
|
|
19
|
+
exports.recursiveErrJSONify = recursiveErrJSONify;
|
|
20
|
+
exports.stringifyErr = stringifyErr;
|
|
19
21
|
function errWithCause(cause, message) {
|
|
20
22
|
const err = new Error(message);
|
|
21
23
|
err.cause = cause;
|
|
@@ -24,7 +26,6 @@ function errWithCause(cause, message) {
|
|
|
24
26
|
}
|
|
25
27
|
return err;
|
|
26
28
|
}
|
|
27
|
-
exports.errWithCause = errWithCause;
|
|
28
29
|
function recursiveErrJSONify(err) {
|
|
29
30
|
if (!err || (typeof err !== 'object') || Array.isArray(err)) {
|
|
30
31
|
return err;
|
|
@@ -46,7 +47,6 @@ function recursiveErrJSONify(err) {
|
|
|
46
47
|
return jsonErr;
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
|
-
exports.recursiveErrJSONify = recursiveErrJSONify;
|
|
50
50
|
function stringifyErr(err) {
|
|
51
51
|
if (!err) {
|
|
52
52
|
return '';
|
|
@@ -80,5 +80,4 @@ function stringifyErr(err) {
|
|
|
80
80
|
}
|
|
81
81
|
return errStr.split('\\n').join('\n').split('\\\\').join('\\');
|
|
82
82
|
}
|
|
83
|
-
exports.stringifyErr = stringifyErr;
|
|
84
83
|
Object.freeze(exports);
|