@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.
@@ -38,6 +38,22 @@
38
38
  return err._type === '_' && typeof err.code === 'number'
39
39
  }
40
40
 
41
+ /**
42
+ * "412 Precondition Failed" indicates that one or more conditions
43
+ * given in the request header fields evaluated to false when tested on the server.
44
+ * * Header Purpose
45
+ * * If-Match Only proceed if the resource's ETag matches the given value
46
+ * * If-None-Match Only proceed if the resource's ETag doesn't match the given value
47
+ * * If-Modified-Since Only proceed if the resource was modified after the given date
48
+ * * If-Unmodified-Since Only proceed if the resource wasn't modified after the given date
49
+
50
+ * @param {string} message
51
+ * @returns {_Error}
52
+ */
53
+ static PreconditionFailed (message) {
54
+ return new _Error(`Not Found: ${message}`, 412)
55
+ }
56
+
41
57
  /**
42
58
  * Creates and returns a 404 Not Found error instance with the given message.
43
59
  * @param {string} message - The error message to include.
@@ -2089,6 +2105,9 @@
2089
2105
  * 3. Notice:
2090
2106
  * * In Beginning, we start bulk(maxParallel) of tasks
2091
2107
  * * One task failed, it will start next task immediately, Not Wait for the bulk(maxParallel) to complete
2108
+ * * DO NOT ensure all tasks are executed.
2109
+ * * Tasks are NOT stoped immediately when a Task succeeds
2110
+ * * will be stopped when A bulk(maxParallel) is executed.
2092
2111
  * @param {Array<Function|Promise<any>>} tasks - Array of async functions to execute
2093
2112
  * @param {number} [maxParallel=5] - Maximum number of tasks to run in parallel
2094
2113
  * @param {string} [failureMessage] - Error message when all tasks failed
@@ -2525,8 +2544,8 @@
2525
2544
  * * if dataLength <= 0, throw "Not Positive" Error
2526
2545
  * * if dataLength is omitted, read all bytes from dataOffset to the end of dataArrayBuffer
2527
2546
  * * if dataLength + dataOffset > dataArrayBuffer.length, read all bytes from dataOffset to the end of dataArrayBuffer
2528
- * @param {ArrayBuffer} target - The target buffer to write into.
2529
- * @param {ArrayBuffer} dataArrayBuffer - The data ArrayBuffer to write.
2547
+ * @param {ArrayBuffer|SharedArrayBuffer} target - The target buffer to write into.
2548
+ * @param {ArrayBuffer|SharedArrayBuffer} dataArrayBuffer - The data ArrayBuffer to write.
2530
2549
  * @param {number} [targetOffset=0] - Zero-based index at which to start write.
2531
2550
  * @param {number} [dataOffset=0] - The offset in the dataArrayBuffer
2532
2551
  * @param {number} [dataLength] - how many bytes extract from dataArrayBuffer