pepka 1.4.2 → 1.4.3
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/bundle.cjs +8 -5
- package/dist/bundle.mjs +8 -5
- package/package.json +1 -2
- package/src/safe.ts +7 -5
- package/dts-fix.js +0 -10
package/dist/bundle.cjs
CHANGED
|
@@ -343,11 +343,14 @@ const range = curry2((from, to) => genBy(add(from), to - from));
|
|
|
343
343
|
const uniq = (xs) => qreduce((accum, x) => find(equals(x), accum) ? accum : qappend(x, accum), [], xs);
|
|
344
344
|
const intersection = curry2((xs1, xs2) => xs1.filter(flip(includes)(xs2)));
|
|
345
345
|
const diff = curry2((_xs1, _xs2) => {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
const
|
|
350
|
-
const
|
|
346
|
+
// BUG: if _xs1 is empty, results in [undefined, ...]
|
|
347
|
+
let len1 = length(_xs1);
|
|
348
|
+
let len2 = length(_xs2); // xs2 should be shorter 4 Set mem consumption.
|
|
349
|
+
const xs1 = len1 > len2 ? _xs1 : _xs2; // ['qwe', 'qwe2'].
|
|
350
|
+
const xs2 = len1 > len2 ? _xs2 : _xs1; // [].
|
|
351
|
+
if (len1 <= len2)
|
|
352
|
+
[len1, len2] = [len2, len1];
|
|
353
|
+
const xset2 = new Set(xs2); // empty set.
|
|
351
354
|
const common = new Set();
|
|
352
355
|
const out = [];
|
|
353
356
|
let i;
|
package/dist/bundle.mjs
CHANGED
|
@@ -341,11 +341,14 @@ const range = curry2((from, to) => genBy(add(from), to - from));
|
|
|
341
341
|
const uniq = (xs) => qreduce((accum, x) => find(equals(x), accum) ? accum : qappend(x, accum), [], xs);
|
|
342
342
|
const intersection = curry2((xs1, xs2) => xs1.filter(flip(includes)(xs2)));
|
|
343
343
|
const diff = curry2((_xs1, _xs2) => {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
const
|
|
348
|
-
const
|
|
344
|
+
// BUG: if _xs1 is empty, results in [undefined, ...]
|
|
345
|
+
let len1 = length(_xs1);
|
|
346
|
+
let len2 = length(_xs2); // xs2 should be shorter 4 Set mem consumption.
|
|
347
|
+
const xs1 = len1 > len2 ? _xs1 : _xs2; // ['qwe', 'qwe2'].
|
|
348
|
+
const xs2 = len1 > len2 ? _xs2 : _xs1; // [].
|
|
349
|
+
if (len1 <= len2)
|
|
350
|
+
[len1, len2] = [len2, len1];
|
|
351
|
+
const xset2 = new Set(xs2); // empty set.
|
|
349
352
|
const common = new Set();
|
|
350
353
|
const out = [];
|
|
351
354
|
let i;
|
package/package.json
CHANGED
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"test": "npm run gentypes && npm run prod:es && ava",
|
|
36
36
|
"test:report": "nyc npm test && nyc report --reporter=text-lcov > coverage.lcov && codecov",
|
|
37
37
|
"test:lazy": "ava",
|
|
38
|
-
"dts-fix": "node dts-fix.js",
|
|
39
38
|
"gentypes": "dts-bundle-generator --no-check --export-referenced-types=false -o dist/bundle.d.ts src/index.ts",
|
|
40
39
|
"dev": "cross-env NODE_ENV=development BUILD=es rollup -c",
|
|
41
40
|
"prod:cjs": "cross-env NODE_ENV=production BUILD=cjs rollup -c",
|
|
@@ -43,7 +42,7 @@
|
|
|
43
42
|
"prod": "npm run gentypes && npm run prod:es && npm run prod:cjs",
|
|
44
43
|
"all": "npm run dev && npm run prod"
|
|
45
44
|
},
|
|
46
|
-
"version": "1.4.
|
|
45
|
+
"version": "1.4.3",
|
|
47
46
|
"ava": {
|
|
48
47
|
"files": [
|
|
49
48
|
"./test/specs/*.ts"
|
package/src/safe.ts
CHANGED
|
@@ -131,11 +131,13 @@ export const uniq = (xs: any[]) => qreduce(
|
|
|
131
131
|
[], xs)
|
|
132
132
|
export const intersection = curry2((xs1: any[], xs2: any[]) => xs1.filter(flip(includes)(xs2)))
|
|
133
133
|
export const diff = curry2((_xs1: any[], _xs2: any[]) => {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
const
|
|
134
|
+
// BUG: if _xs1 is empty, results in [undefined, ...]
|
|
135
|
+
let len1 = length(_xs1)
|
|
136
|
+
let len2 = length(_xs2) // xs2 should be shorter 4 Set mem consumption.
|
|
137
|
+
const xs1 = len1>len2 ? _xs1 : _xs2 // ['qwe', 'qwe2'].
|
|
138
|
+
const xs2 = len1>len2 ? _xs2 : _xs1 // [].
|
|
139
|
+
if(len1<=len2) [len1, len2] = [len2, len1]
|
|
140
|
+
const xset2 = new Set(xs2) // empty set.
|
|
139
141
|
const common = new Set()
|
|
140
142
|
const out: any[] = []
|
|
141
143
|
let i: number
|