@bbn/bbn 1.0.179 → 1.0.181

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/bbn.js CHANGED
@@ -672,7 +672,7 @@ __webpack_require__.r(__webpack_exports__);
672
672
  /* harmony import */ var _fn_misc_money_js__WEBPACK_IMPORTED_MODULE_168__ = __webpack_require__(/*! ./fn/misc/money.js */ "./dist/fn/misc/money.js");
673
673
  /* harmony import */ var _fn_object_move_js__WEBPACK_IMPORTED_MODULE_169__ = __webpack_require__(/*! ./fn/object/move.js */ "./dist/fn/object/move.js");
674
674
  /* harmony import */ var _fn_object_multiorder_js__WEBPACK_IMPORTED_MODULE_170__ = __webpack_require__(/*! ./fn/object/multiorder.js */ "./dist/fn/object/multiorder.js");
675
- Object(function webpackMissingModule() { var e = new Error("Cannot find module './fn/object/mutateArray.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }());
675
+ /* harmony import */ var _fn_object_mutateArray_js__WEBPACK_IMPORTED_MODULE_171__ = __webpack_require__(/*! ./fn/object/mutateArray.js */ "./dist/fn/object/mutateArray.js");
676
676
  /* harmony import */ var _fn_string_nl2br_js__WEBPACK_IMPORTED_MODULE_172__ = __webpack_require__(/*! ./fn/string/nl2br.js */ "./dist/fn/string/nl2br.js");
677
677
  /* harmony import */ var _fn_object_numProperties_js__WEBPACK_IMPORTED_MODULE_173__ = __webpack_require__(/*! ./fn/object/numProperties.js */ "./dist/fn/object/numProperties.js");
678
678
  /* harmony import */ var _fn_form_objectToFormData_js__WEBPACK_IMPORTED_MODULE_174__ = __webpack_require__(/*! ./fn/form/objectToFormData.js */ "./dist/fn/form/objectToFormData.js");
@@ -1131,7 +1131,7 @@ var fn = {
1131
1131
  money: _fn_misc_money_js__WEBPACK_IMPORTED_MODULE_168__.money,
1132
1132
  move: _fn_object_move_js__WEBPACK_IMPORTED_MODULE_169__.move,
1133
1133
  multiorder: _fn_object_multiorder_js__WEBPACK_IMPORTED_MODULE_170__.multiorder,
1134
- mutateArray: Object(function webpackMissingModule() { var e = new Error("Cannot find module './fn/object/mutateArray.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()),
1134
+ mutateArray: _fn_object_mutateArray_js__WEBPACK_IMPORTED_MODULE_171__.mutateArray,
1135
1135
  nl2br: _fn_string_nl2br_js__WEBPACK_IMPORTED_MODULE_172__.nl2br,
1136
1136
  numProperties: _fn_object_numProperties_js__WEBPACK_IMPORTED_MODULE_173__.numProperties,
1137
1137
  objectToFormData: _fn_form_objectToFormData_js__WEBPACK_IMPORTED_MODULE_174__.objectToFormData,
@@ -9286,6 +9286,61 @@ var multiorder = function (arr, orders) {
9286
9286
 
9287
9287
 
9288
9288
 
9289
+ /***/ }),
9290
+
9291
+ /***/ "./dist/fn/object/mutateArray.js":
9292
+ /*!***************************************!*\
9293
+ !*** ./dist/fn/object/mutateArray.js ***!
9294
+ \***************************************/
9295
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
9296
+
9297
+ "use strict";
9298
+ __webpack_require__.r(__webpack_exports__);
9299
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9300
+ /* harmony export */ mutateArray: () => (/* binding */ mutateArray)
9301
+ /* harmony export */ });
9302
+ /* harmony import */ var _type_isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../type/isArray.js */ "./dist/fn/type/isArray.js");
9303
+ /* harmony import */ var _string_hash_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../string/hash.js */ "./dist/fn/string/hash.js");
9304
+ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
9305
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
9306
+ if (ar || !(i in from)) {
9307
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
9308
+ ar[i] = from[i];
9309
+ }
9310
+ }
9311
+ return to.concat(ar || Array.prototype.slice.call(from));
9312
+ };
9313
+
9314
+
9315
+ var mutateArray = function (a1, a2) {
9316
+ if (!(0,_type_isArray_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(a1) || !(0,_type_isArray_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(a2)) {
9317
+ throw new TypeError('mutateArray can only be called with arrays');
9318
+ }
9319
+ // Create a map from the second array using the identity function to get the key
9320
+ var mapA2 = new Map(a2.map(function (item) { return [(0,_string_hash_js__WEBPACK_IMPORTED_MODULE_1__.hash)(item), item]; }));
9321
+ var mapA1 = new Map(a1.map(function (item) { return [(0,_string_hash_js__WEBPACK_IMPORTED_MODULE_1__.hash)(item), item]; }));
9322
+ // Result array to build the correct order
9323
+ var result = [];
9324
+ // Iterate over a2 and build the result array
9325
+ for (var _i = 0, a2_1 = a2; _i < a2_1.length; _i++) {
9326
+ var item = a2_1[_i];
9327
+ var key = (0,_string_hash_js__WEBPACK_IMPORTED_MODULE_1__.hash)(item);
9328
+ if (mapA1.has(key)) {
9329
+ // If the item is in a1, use the item from a2 to preserve the order
9330
+ result.push(mapA2.get(key));
9331
+ }
9332
+ else {
9333
+ // If the item is not in a1, it's a new item to be added
9334
+ result.push(item);
9335
+ }
9336
+ }
9337
+ // Clear a1 and push the ordered results into it
9338
+ a1.splice.apply(a1, __spreadArray([0, a1.length], result, false));
9339
+ return a1;
9340
+ };
9341
+
9342
+
9343
+
9289
9344
  /***/ }),
9290
9345
 
9291
9346
  /***/ "./dist/fn/object/numProperties.js":