@creejs/commons-lang 2.1.28 → 2.1.29
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/cjs/index-dev.cjs +21 -2
- package/dist/cjs/index-dev.cjs.map +1 -1
- package/dist/cjs/index-min.cjs +1 -1
- package/dist/cjs/index-min.cjs.map +1 -1
- package/dist/esm/index-dev.js +21 -2
- package/dist/esm/index-dev.js.map +1 -1
- package/dist/esm/index-min.js +1 -1
- package/dist/esm/index-min.js.map +1 -1
- package/dist/umd/index.dev.js +21 -2
- package/dist/umd/index.dev.js.map +1 -1
- package/dist/umd/index.min.js +1 -1
- package/dist/umd/index.min.js.map +1 -1
- package/package.json +1 -1
- package/types/_error.d.ts +13 -0
- package/types/array-buffer-utils.d.ts +3 -3
- package/types/promise-utils.d.ts +3 -0
package/dist/esm/index-dev.js
CHANGED
|
@@ -32,6 +32,22 @@ class _Error extends Error {
|
|
|
32
32
|
return err._type === '_' && typeof err.code === 'number'
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* "412 Precondition Failed" indicates that one or more conditions
|
|
37
|
+
* given in the request header fields evaluated to false when tested on the server.
|
|
38
|
+
* * Header Purpose
|
|
39
|
+
* * If-Match Only proceed if the resource's ETag matches the given value
|
|
40
|
+
* * If-None-Match Only proceed if the resource's ETag doesn't match the given value
|
|
41
|
+
* * If-Modified-Since Only proceed if the resource was modified after the given date
|
|
42
|
+
* * If-Unmodified-Since Only proceed if the resource wasn't modified after the given date
|
|
43
|
+
|
|
44
|
+
* @param {string} message
|
|
45
|
+
* @returns {_Error}
|
|
46
|
+
*/
|
|
47
|
+
static PreconditionFailed (message) {
|
|
48
|
+
return new _Error(`Not Found: ${message}`, 412)
|
|
49
|
+
}
|
|
50
|
+
|
|
35
51
|
/**
|
|
36
52
|
* Creates and returns a 404 Not Found error instance with the given message.
|
|
37
53
|
* @param {string} message - The error message to include.
|
|
@@ -2083,6 +2099,9 @@ async function parallelAllSettled (tasks, maxParallel = 5) {
|
|
|
2083
2099
|
* 3. Notice:
|
|
2084
2100
|
* * In Beginning, we start bulk(maxParallel) of tasks
|
|
2085
2101
|
* * One task failed, it will start next task immediately, Not Wait for the bulk(maxParallel) to complete
|
|
2102
|
+
* * DO NOT ensure all tasks are executed.
|
|
2103
|
+
* * Tasks are NOT stoped immediately when a Task succeeds
|
|
2104
|
+
* * will be stopped when A bulk(maxParallel) is executed.
|
|
2086
2105
|
* @param {Array<Function|Promise<any>>} tasks - Array of async functions to execute
|
|
2087
2106
|
* @param {number} [maxParallel=5] - Maximum number of tasks to run in parallel
|
|
2088
2107
|
* @param {string} [failureMessage] - Error message when all tasks failed
|
|
@@ -2519,8 +2538,8 @@ function writeString (buffer, str, offset = 0) {
|
|
|
2519
2538
|
* * if dataLength <= 0, throw "Not Positive" Error
|
|
2520
2539
|
* * if dataLength is omitted, read all bytes from dataOffset to the end of dataArrayBuffer
|
|
2521
2540
|
* * if dataLength + dataOffset > dataArrayBuffer.length, read all bytes from dataOffset to the end of dataArrayBuffer
|
|
2522
|
-
* @param {ArrayBuffer} target - The target buffer to write into.
|
|
2523
|
-
* @param {ArrayBuffer} dataArrayBuffer - The data ArrayBuffer to write.
|
|
2541
|
+
* @param {ArrayBuffer|SharedArrayBuffer} target - The target buffer to write into.
|
|
2542
|
+
* @param {ArrayBuffer|SharedArrayBuffer} dataArrayBuffer - The data ArrayBuffer to write.
|
|
2524
2543
|
* @param {number} [targetOffset=0] - Zero-based index at which to start write.
|
|
2525
2544
|
* @param {number} [dataOffset=0] - The offset in the dataArrayBuffer
|
|
2526
2545
|
* @param {number} [dataLength] - how many bytes extract from dataArrayBuffer
|