occam-verify-cli 0.0.1055 → 0.0.1057
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/utilities/array.js +2 -46
- package/package.json +7 -7
- package/src/utilities/array.js +1 -31
package/lib/utilities/array.js
CHANGED
|
@@ -62,51 +62,7 @@ _export(exports, {
|
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
var _necessary = require("necessary");
|
|
65
|
-
|
|
66
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
67
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
68
|
-
return arr2;
|
|
69
|
-
}
|
|
70
|
-
function _array_without_holes(arr) {
|
|
71
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
72
|
-
}
|
|
73
|
-
function _iterable_to_array(iter) {
|
|
74
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
75
|
-
}
|
|
76
|
-
function _non_iterable_spread() {
|
|
77
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
78
|
-
}
|
|
79
|
-
function _to_consumable_array(arr) {
|
|
80
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
81
|
-
}
|
|
82
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
83
|
-
if (!o) return;
|
|
84
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
85
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
86
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
87
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
88
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
89
|
-
}
|
|
90
|
-
var first = _necessary.arrayUtilities.first, last = _necessary.arrayUtilities.last, front = _necessary.arrayUtilities.front, tail = _necessary.arrayUtilities.tail, push = _necessary.arrayUtilities.push, find = _necessary.arrayUtilities.find, match = _necessary.arrayUtilities.match, clear = _necessary.arrayUtilities.clear, prune = _necessary.arrayUtilities.prune, extract = _necessary.arrayUtilities.extract, filter = _necessary.arrayUtilities.filter, compress = _necessary.arrayUtilities.compress, separate = _necessary.arrayUtilities.separate;
|
|
91
|
-
function reverse(array) {
|
|
92
|
-
array = _to_consumable_array(array).reverse();
|
|
93
|
-
return array;
|
|
94
|
-
}
|
|
95
|
-
function correlate(arrayA, arrayB, callback) {
|
|
96
|
-
arrayB = _to_consumable_array(arrayB);
|
|
97
|
-
var correlates = arrayA.every(function(elementA) {
|
|
98
|
-
var elementB = extract(arrayB, function(elementB) {
|
|
99
|
-
var result = callback(elementA, elementB);
|
|
100
|
-
if (result) {
|
|
101
|
-
return true;
|
|
102
|
-
}
|
|
103
|
-
}) || null;
|
|
104
|
-
if (elementB !== null) {
|
|
105
|
-
return true;
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
return correlates;
|
|
109
|
-
}
|
|
65
|
+
var first = _necessary.arrayUtilities.first, last = _necessary.arrayUtilities.last, front = _necessary.arrayUtilities.front, tail = _necessary.arrayUtilities.tail, push = _necessary.arrayUtilities.push, find = _necessary.arrayUtilities.find, match = _necessary.arrayUtilities.match, clear = _necessary.arrayUtilities.clear, prune = _necessary.arrayUtilities.prune, reverse = _necessary.arrayUtilities.reverse, extract = _necessary.arrayUtilities.extract, correlate = _necessary.arrayUtilities.correlate, filter = _necessary.arrayUtilities.filter, compress = _necessary.arrayUtilities.compress, separate = _necessary.arrayUtilities.separate;
|
|
110
66
|
function leftDifference(arrayA, arrayB) {
|
|
111
67
|
filter(arrayA, function(elementA) {
|
|
112
68
|
var arrayBIncludesElementA = arrayB.includes(elementA);
|
|
@@ -124,4 +80,4 @@ function rightDifference(arrayA, arrayB) {
|
|
|
124
80
|
});
|
|
125
81
|
}
|
|
126
82
|
|
|
127
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
83
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvYXJyYXkuanMiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmltcG9ydCB7IGFycmF5VXRpbGl0aWVzIH0gZnJvbSBcIm5lY2Vzc2FyeVwiO1xuXG5leHBvcnQgY29uc3QgeyBmaXJzdCwgbGFzdCwgZnJvbnQsIHRhaWwsIHB1c2gsIGZpbmQsIG1hdGNoLCBjbGVhciwgcHJ1bmUsIHJldmVyc2UsIGV4dHJhY3QsIGNvcnJlbGF0ZSwgZmlsdGVyLCBjb21wcmVzcywgc2VwYXJhdGUgfSA9IGFycmF5VXRpbGl0aWVzO1xuXG5leHBvcnQgZnVuY3Rpb24gbGVmdERpZmZlcmVuY2UoYXJyYXlBLCBhcnJheUIpIHtcbiAgZmlsdGVyKGFycmF5QSwgKGVsZW1lbnRBKSA9PiB7XG4gICAgY29uc3QgYXJyYXlCSW5jbHVkZXNFbGVtZW50QSA9IGFycmF5Qi5pbmNsdWRlcyhlbGVtZW50QSk7XG5cbiAgICBpZiAoIWFycmF5QkluY2x1ZGVzRWxlbWVudEEpIHtcbiAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cbiAgfSk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiByaWdodERpZmZlcmVuY2UoYXJyYXlBLCBhcnJheUIpIHtcbiAgZmlsdGVyKGFycmF5QiwgKGVsZW1lbnRCKSA9PiB7XG4gICAgY29uc3QgYXJyYXlBSW5jbHVkZXNFbGVtZW50QiA9IGFycmF5QS5pbmNsdWRlcyhlbGVtZW50Qik7XG5cbiAgICBpZiAoIWFycmF5QUluY2x1ZGVzRWxlbWVudEIpIHtcbiAgICAgIHJldHVybiB0cn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ksseUJBQWMsQ0FBM0dMLE1BQU1QLE9BQXVGWSx5QkFBYyxDQUFyR1osTUFBTUssUUFBaUZPLHlCQUFjLENBQS9GUCxPQUFPVixRQUEwRWlCLHlCQUFjLENBQXhGakIsT0FBT1csUUFBbUVNLHlCQUFjLENBQWpGTixPQUFPRSxVQUE0REkseUJBQWMsQ0FBMUVKLFNBQVNWLFVBQW1EYyx5QkFBYyxDQUFqRWQsU0FBU0QsWUFBMENlLHlCQUFjLENBQXhEZixXQUFXRSxTQUErQmEseUJBQWMsQ0FBN0NiLFFBQVFILFdBQXVCZ0IseUJBQWMsQ0FBckNoQixVQUFVYyxXQUFhRSx5QkFBYyxDQUEzQkY7QUFFbEgsU0FBU04sZUFBZVMsTUFBTSxFQUFFQyxNQUFNO0lBQzNDZixPQUFPYyxRQUFRLFNBQUNFO1FBQ2QsSUFBTUMseUJBQXlCRixPQUFPRyxRQUFRLENBQUNGO1FBRS9DLElBQUksQ0FBQ0Msd0JBQXdCO1lBQzNCLE9BQU87UUFDVDtJQUNGO0FBQ0Y7QUFFTyxTQUFTUCxnQkFBZ0JJLE1BQU0sRUFBRUMsTUFBTTtJQUM1Q2YsT0FBT2UsUUFBUSxTQUFDSTtRQUNkLElBQU1DLHlCQUF5Qk4sT0FBT0ksUUFBUSxDQUFDQztRQUUvQyxJQUFJLENBQUNDLHdCQUF3QjtZQUMzQixPQUFPO1FBQ1Q7SUFDRjtBQUNGIn0=
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "occam-verify-cli",
|
|
3
3
|
"author": "James Smith",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.1057",
|
|
5
5
|
"license": "MIT, Anti-996",
|
|
6
6
|
"homepage": "https://github.com/djalbat/occam-verify-cli",
|
|
7
7
|
"description": "Occam's Verifier",
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"argumentative": "^2.0.32",
|
|
14
|
-
"necessary": "^14.
|
|
15
|
-
"occam-custom-grammars": "^5.0.
|
|
16
|
-
"occam-entities": "^1.0.
|
|
17
|
-
"occam-file-system": "^6.0.
|
|
18
|
-
"occam-grammar-utilities": "^8.0.
|
|
19
|
-
"occam-query": "^3.1.
|
|
14
|
+
"necessary": "^14.1.6",
|
|
15
|
+
"occam-custom-grammars": "^5.0.884",
|
|
16
|
+
"occam-entities": "^1.0.174",
|
|
17
|
+
"occam-file-system": "^6.0.211",
|
|
18
|
+
"occam-grammar-utilities": "^8.0.219",
|
|
19
|
+
"occam-query": "^3.1.195"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@swc/core": "^1.5.6",
|
package/src/utilities/array.js
CHANGED
|
@@ -2,37 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { arrayUtilities } from "necessary";
|
|
4
4
|
|
|
5
|
-
export const { first, last, front, tail, push, find, match, clear, prune, extract, filter, compress, separate } = arrayUtilities;
|
|
6
|
-
|
|
7
|
-
export function reverse(array) {
|
|
8
|
-
array = [ ///
|
|
9
|
-
...array
|
|
10
|
-
].reverse();
|
|
11
|
-
|
|
12
|
-
return array;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function correlate(arrayA, arrayB, callback) {
|
|
16
|
-
arrayB = [ ///
|
|
17
|
-
...arrayB
|
|
18
|
-
];
|
|
19
|
-
|
|
20
|
-
const correlates = arrayA.every((elementA) => {
|
|
21
|
-
const elementB = extract(arrayB, (elementB) => {
|
|
22
|
-
const result = callback(elementA, elementB);
|
|
23
|
-
|
|
24
|
-
if (result) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
}) || null;
|
|
28
|
-
|
|
29
|
-
if (elementB !== null) {
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
return correlates;
|
|
35
|
-
}
|
|
5
|
+
export const { first, last, front, tail, push, find, match, clear, prune, reverse, extract, correlate, filter, compress, separate } = arrayUtilities;
|
|
36
6
|
|
|
37
7
|
export function leftDifference(arrayA, arrayB) {
|
|
38
8
|
filter(arrayA, (elementA) => {
|