@mxfb/tools 0.0.33 → 0.0.34
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/index.js +2 -4
- package/package.json +1 -1
- package/utils/agnostic/array/index.d.ts +7 -0
- package/utils/agnostic/array/index.js +1 -0
- package/utils/agnostic/array-random-pick/index.d.ts +0 -3
- package/utils/agnostic/array-random-pick/index.js +0 -1
- package/utils/agnostic/find-duplicates-in-array/index.d.ts +0 -1
- package/utils/agnostic/find-duplicates-in-array/index.js +0 -1
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Comp from './components/Comp/index.js'
|
|
2
2
|
import * as absoluteModulo from './utils/agnostic/absolute-modulo/index.js'
|
|
3
|
-
import * as
|
|
3
|
+
import * as array from './utils/agnostic/array/index.js'
|
|
4
4
|
import * as assert from './utils/agnostic/assert/index.js'
|
|
5
5
|
import * as awaitTimeout from './utils/agnostic/await-timeout/index.js'
|
|
6
6
|
import * as bem from './utils/agnostic/bem/index.js'
|
|
@@ -9,7 +9,6 @@ import * as charcodeString from './utils/agnostic/charcode-string/index.js'
|
|
|
9
9
|
import * as clamp from './utils/agnostic/clamp/index.js'
|
|
10
10
|
import * as clientsideHtmlSanitizer from './utils/agnostic/clientside-html-sanitizer/index.js'
|
|
11
11
|
import * as crossenv from './utils/agnostic/crossenv/index.js'
|
|
12
|
-
import * as findDuplicatesInArray from './utils/agnostic/find-duplicates-in-array/index.js'
|
|
13
12
|
import * as flattenGetters from './utils/agnostic/flatten-getters/index.js'
|
|
14
13
|
import * as generateHtmlPlaceholders from './utils/agnostic/generate-html-placeholders/index.js'
|
|
15
14
|
import * as generateNiceColor from './utils/agnostic/generate-nice-color/index.js'
|
|
@@ -47,7 +46,7 @@ import * as processExit from './utils/node/process-exit/index.js'
|
|
|
47
46
|
import * as readWriteFile from './utils/node/read-write-file/index.js'
|
|
48
47
|
export { Comp }
|
|
49
48
|
export { absoluteModulo }
|
|
50
|
-
export {
|
|
49
|
+
export { array }
|
|
51
50
|
export { assert }
|
|
52
51
|
export { awaitTimeout }
|
|
53
52
|
export { bem }
|
|
@@ -56,7 +55,6 @@ export { charcodeString }
|
|
|
56
55
|
export { clamp }
|
|
57
56
|
export { clientsideHtmlSanitizer }
|
|
58
57
|
export { crossenv }
|
|
59
|
-
export { findDuplicatesInArray }
|
|
60
58
|
export { flattenGetters }
|
|
61
59
|
export { generateHtmlPlaceholders }
|
|
62
60
|
export { generateNiceColor }
|
package/package.json
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type Filler<T = any> = (pos?: number) => T;
|
|
2
|
+
export declare function make<T>(filler: Filler<T>, length: number): T[];
|
|
3
|
+
export declare function findDuplicates<T>(arr: T[], stopAtFirst?: boolean): T[];
|
|
4
|
+
export declare const randomPickErrorSybol: unique symbol;
|
|
5
|
+
export type RandomPickErrorSymbol = typeof randomPickErrorSybol;
|
|
6
|
+
export default function randomPick<T>(arr: T[], exclude?: T[]): T | RandomPickErrorSymbol;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function f(e,t){return new Array(t).fill(null).map((r,o)=>e(o))}function s(e,t=!1){let r=new Set,o=new Set;for(let n of e){if(r.has(n)&&t)return[n];r.has(n)&&o.add(n),r.add(n)}return Array.from(o)}var a=Symbol();function i(e,t=[]){let r=[...e].filter(l=>!t.includes(l)),o=r.length;if(o===0)return a;let n=Math.floor(Math.random()*o);return r[n]}export{i as default,s as findDuplicates,f as make,a as randomPickErrorSybol};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var f=Symbol();function a(t,e=[]){let r=[...t].filter(l=>!e.includes(l)),o=r.length;if(o===0)return f;let n=Math.floor(Math.random()*o);return r[n]}export{a as default,f as errorSybol};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function findDuplicatesInArray<T>(arr: T[], stopAtFirst?: boolean): T[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function o(a,r=!1){let n=new Set,t=new Set;for(let e of a){if(n.has(e)&&r)return[e];n.has(e)&&t.add(e),n.add(e)}return Array.from(t)}export{o as default};
|