@creejs/commons-lang 2.1.27 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creejs/commons-lang",
3
- "version": "2.1.27",
3
+ "version": "2.1.29",
4
4
  "description": "Commons Utils About Language, used inside creejs",
5
5
  "keywords": [
6
6
  "commons",
package/types/_error.d.ts CHANGED
@@ -15,6 +15,19 @@ export default class _Error extends Error {
15
15
  static isErrorLike(err: {
16
16
  [key: string]: any;
17
17
  }): boolean;
18
+ /**
19
+ * "412 Precondition Failed" indicates that one or more conditions
20
+ * given in the request header fields evaluated to false when tested on the server.
21
+ * * Header Purpose
22
+ * * If-Match Only proceed if the resource's ETag matches the given value
23
+ * * If-None-Match Only proceed if the resource's ETag doesn't match the given value
24
+ * * If-Modified-Since Only proceed if the resource was modified after the given date
25
+ * * If-Unmodified-Since Only proceed if the resource wasn't modified after the given date
26
+
27
+ * @param {string} message
28
+ * @returns {_Error}
29
+ */
30
+ static PreconditionFailed(message: string): _Error;
18
31
  /**
19
32
  * Creates and returns a 404 Not Found error instance with the given message.
20
33
  * @param {string} message - The error message to include.
@@ -41,11 +41,11 @@ export function writeString(buffer: ArrayBuffer, str: string, offset?: number):
41
41
  * * if dataLength <= 0, throw "Not Positive" Error
42
42
  * * if dataLength is omitted, read all bytes from dataOffset to the end of dataArrayBuffer
43
43
  * * if dataLength + dataOffset > dataArrayBuffer.length, read all bytes from dataOffset to the end of dataArrayBuffer
44
- * @param {ArrayBuffer} target - The target buffer to write into.
45
- * @param {ArrayBuffer} dataArrayBuffer - The data ArrayBuffer to write.
44
+ * @param {ArrayBuffer|SharedArrayBuffer} target - The target buffer to write into.
45
+ * @param {ArrayBuffer|SharedArrayBuffer} dataArrayBuffer - The data ArrayBuffer to write.
46
46
  * @param {number} [targetOffset=0] - Zero-based index at which to start write.
47
47
  * @param {number} [dataOffset=0] - The offset in the dataArrayBuffer
48
48
  * @param {number} [dataLength] - how many bytes extract from dataArrayBuffer
49
49
  * @returns {void}
50
50
  */
51
- export function writeArrayBuffer(target: ArrayBuffer, dataArrayBuffer: ArrayBuffer, targetOffset?: number, dataOffset?: number, dataLength?: number): void;
51
+ export function writeArrayBuffer(target: ArrayBuffer | SharedArrayBuffer, dataArrayBuffer: ArrayBuffer | SharedArrayBuffer, targetOffset?: number, dataOffset?: number, dataLength?: number): void;
@@ -123,6 +123,9 @@ export function parallelAllSettled(tasks: Function[], maxParallel?: number): Pro
123
123
  * 3. Notice:
124
124
  * * In Beginning, we start bulk(maxParallel) of tasks
125
125
  * * One task failed, it will start next task immediately, Not Wait for the bulk(maxParallel) to complete
126
+ * * DO NOT ensure all tasks are executed.
127
+ * * Tasks are NOT stoped immediately when a Task succeeds
128
+ * * will be stopped when A bulk(maxParallel) is executed.
126
129
  * @param {Array<Function|Promise<any>>} tasks - Array of async functions to execute
127
130
  * @param {number} [maxParallel=5] - Maximum number of tasks to run in parallel
128
131
  * @param {string} [failureMessage] - Error message when all tasks failed