@soratani-code/samtools 1.3.18 → 1.3.19

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/lib/tools.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export declare function isDeepEqual(a: any, b: any): any;
2
2
  export declare function deepDelete(data: any, path: string): any;
3
+ export declare function insertArray(arr: any[], index: number, item: any): any[];
package/lib/tools.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deepDelete = exports.isDeepEqual = void 0;
3
+ exports.insertArray = exports.deepDelete = exports.isDeepEqual = void 0;
4
4
  const lodash_1 = require("lodash");
5
5
  const type_1 = require("./type");
6
6
  function isDeepEqual(a, b) {
@@ -63,3 +63,11 @@ function deepDelete(data, path) {
63
63
  return clone;
64
64
  }
65
65
  exports.deepDelete = deepDelete;
66
+ function insertArray(arr, index, item) {
67
+ if (!Array.isArray(arr))
68
+ return arr;
69
+ const clone = (0, lodash_1.cloneDeep)(arr);
70
+ clone.splice(index, 0, item);
71
+ return clone;
72
+ }
73
+ exports.insertArray = insertArray;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soratani-code/samtools",
3
- "version": "1.3.18",
3
+ "version": "1.3.19",
4
4
  "description": "",
5
5
  "typings": "lib/index.d.ts",
6
6
  "main": "lib/index.js",