-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharray.js
28 lines (28 loc) · 995 Bytes
/
array.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**!
* Copyright (C) 2020 Silas B. Domingos
* @license MIT
*/
const Objects = require("@balmanth/objects");
const core_1 = require("./core");
/**
* Differing Array.
*/
class Array {
/**
* Get the comparison patches based on the specified base and input array.
* @param base Base array.
* @param input Input array.
* @param comparator Optional comparator callback.
* @returns Returns the comparison patches.
*/
static from(base, input, comparator) {
const table = core_1.Core.getTable(base, input, comparator !== null && comparator !== void 0 ? comparator : Objects.areEqual);
const changes = core_1.Core.getChanges(base, input, comparator !== null && comparator !== void 0 ? comparator : Objects.areEqual, table);
const patches = core_1.Core.getPatches(changes);
return patches;
}
}
exports.Array = Array;
//# sourceMappingURL=array.js.map