ivl 0.1.3 → 0.1.4
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/helpers/index.d.ts +1 -1
- package/lib/helpers/index.js +1 -1
- package/package.json +1 -1
package/lib/helpers/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type RULES = {
|
|
|
5
5
|
[index: string]: RULE;
|
|
6
6
|
};
|
|
7
7
|
export declare const type: (type: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function") => RULE;
|
|
8
|
-
export declare const matchesRegex: (regex: RegExp) =>
|
|
8
|
+
export declare const matchesRegex: (regex: RegExp) => (value: unknown) => boolean;
|
|
9
9
|
export declare const stringBetween: (max?: number, min?: number) => (s: unknown) => boolean;
|
|
10
10
|
export declare const numberBetween: (max?: number, min?: number) => (i: unknown) => boolean;
|
|
11
11
|
export declare const acceptAny: (rules?: RULE[]) => (i: unknown, ...extra: unknown[]) => Promise<boolean>;
|
package/lib/helpers/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var u=(e)=>(n)=>typeof n===e,i=(e)=>(n)=>typeof n==="string"&&e.test(n),p=(e=100,n=0)=>(t)=>typeof t==="string"&&t.length>=n&&t.length<e,f=(e=100,n=1)=>(t)=>typeof t==="number"&&t>=n&&t<e,w=(e=[])=>async(n,...t)=>(await Promise.all(e.map((o)=>o.call(void 0,n,...t)))).some((o)=>o);var a=(e)=>Object.entries(e).reduce((n,[t,o])=>({...n,[t]:(r,...c)=>typeof r==="undefined"?!0:o(r,...c)}),{}),l=(e,n)=>Object.entries(n).reduce((t,[o,r])=>({...t,[o]:(c,...s)=>r(e(c),...s)}),{});export{u as type,p as stringBetween,l as preprocess,f as numberBetween,i as matchesRegex,a as allowUndefined,w as acceptAny};
|