ivl 0.1.5 → 0.1.6

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/README.md CHANGED
@@ -4,49 +4,51 @@ Main focus is on speed and flexibility of the validation rules
4
4
 
5
5
  Supports asynchronous rule validation by default. Use `getInputErrorsSync` and `getSchemaErrorsSync` for better performance if you don't need to support asynchronous checks on your inputs.
6
6
  # Main functionality
7
- Write your own custom validators to exactly match your usecase using a simple object:
7
+ Write your own custom validators to exactly match your use case using a simple object:
8
8
  ```javascript
9
9
  const my_rules = {
10
- "Input must be more than 4": (i) => i > 4,
11
- "Input must be divisible by 10": (i) => i % 10
10
+ "Input must be more than 40": (i) => i > 40,
11
+ "Input must be divisible by 10": (i) => !(i % 10)
12
12
  }
13
- ```
14
- The input will be checked against your rule set and return all failing rules names as a string array.
13
+ console.log(getInputErrors(50, my_rules)); // []
14
+ console.log(getInputErrors(11, my_rules)); // ["Input must be more than 40", "Input must be divisible by 10"]
15
+ console.log(getInputErrors(30, my_rules)) // ["Input must be more than 40"]
15
16
 
17
+ ```
16
18
 
17
19
  ## Frontend example
18
20
  ```javascript
19
21
  // src/index.ts
20
22
  import { getInputErrorsSync, getInputErrors } from 'ivl';
21
23
  import type { RULES } from 'ivl';
22
- import { matchesRegex, stringBetween, type } from 'ivl/helpers';
24
+ import { matchesRegex, minLength, maxLength, isType } from 'ivl/helpers';
23
25
 
24
- // This is also exportable from 'ivl/patterns'
26
+ // This pattern is also exportable from 'ivl/patterns'
25
27
  const EMAIL_PATTERN = /^[\w.%+-]+@[\w.-]+\.[a-zA-Z]{1,}$/;
26
28
 
27
29
  const EMAIL_REQUIREMENTS: RULES = {
28
- "Must be string": type('string'),
29
- "Must be less then 100 characters": stringBetween(),
30
- "Not a valid email address": matchesRegex(EMAIL_PATTERN),
31
- "That email is already in use": async (i) => {
32
- // Fetch info from whatever backend and make a decision based on that asynchronously
33
- const email_in_use = await fetch(`https://mybackend/email-exists/${i}`)
34
- return !email_in_use // We will return true if the email is not already taken
35
- }
30
+ "Must be string": isType('string'),
31
+ "Must be less then 100 characters": maxLength(100),
32
+ "Not a valid email address": matchesRegex(EMAIL_PATTERN),
33
+ "That email is already in use": async (i) => {
34
+ // Fetch info from whatever backend and make a decision based on that asynchronously
35
+ const email_in_use = await fetch(`https://mybackend/email-exists/${i}`)
36
+ return !email_in_use // We will return true if the email is not already taken
37
+ }
36
38
  };
37
39
 
38
40
  const PASSWORD_REQUIREMENTS: RULES = {
39
- "Must be string": type('string'),
40
- "Must be at least 8 characters": stringBetween(Infinity, 8),
41
- "Must contain at least one upper case character": matchesRegex(/(?=.*[A-Z])/),
42
- "Must contain at least one lower case character": matchesRegex(/(?=.*[a-z])/),
41
+ "Must be string": isType('string'),
42
+ "Must be at least 8 characters": minLength(Infinity, 8),
43
+ "Must contain at least one upper case character": matchesRegex(/(?=.*[A-Z])/),
44
+ "Must contain at least one lower case character": matchesRegex(/(?=.*[a-z])/),
43
45
  }
44
46
 
45
47
  // You can of course expand on your existing rules:
46
48
  const STRONG_PASSWORD_REQUIREMENTS: RULES = {
47
- ...PASSWORD_REQUIREMENTS,
48
- "Must contain at least one digit": matchesRegex(/(?=.*\d)/),
49
- "Must contain at least one symbol": matchesRegex(/[^\w]/),
49
+ ...PASSWORD_REQUIREMENTS,
50
+ "Must contain at least one digit": matchesRegex(/(?=.*\d)/),
51
+ "Must contain at least one symbol": matchesRegex(/[^\w]/),
50
52
  };
51
53
 
52
54
  const email_value = "some-value";
@@ -64,39 +66,47 @@ console.log({email_errors, pw_errors, strong_pw_errors});
64
66
 
65
67
  ```typescript
66
68
  // rules.ts
69
+
70
+ import { isType, minLength, maxLength, matchesRegex } from 'ivl/helpers';
71
+ import { checkValueInDatabase } from 'my-database-controller';
72
+
73
+ const existsInDatabase = (key: string, table: string, exists: boolean = true): RULE =>
74
+ async (value) =>
75
+ exists != !(await checkValueInDatabase(value as string, key, table)).length
76
+
67
77
  const EMAIL_REQUIREMENTS = {
68
- "Must be string": type('string'),
69
- "Must be less then 100 characters": stringBetween(),
70
- "Not a valid email address": matchesRegex(EMAIL_PATTERN),
78
+ "Must be string": isType('string'),
79
+ "Must be less then 100 characters": maxLength(100),
80
+ "Not a valid email address": matchesRegex(EMAIL_PATTERN),
71
81
  };
72
82
 
73
83
  const PASSWORD_REQUIREMENTS = {
74
- "Must be string": type('string'),
75
- "Must be at least 8 characters": stringBetween(Infinity, 8),
76
- "Must contain at least one upper case character": matchesRegex(/(?=.*[A-Z])/),
77
- "Must contain at least one lower case character": matchesRegex(/(?=.*[a-z])/),
78
- "Must contain at least one digit": matchesRegex(/(?=.*\d)/),
79
- "Must contain at least one symbol": matchesRegex(/[^\w]/),
84
+ "Must be string": isType('string'),
85
+ "Must be at least 8 characters": minLength(8),
86
+ "Must contain at least one upper case character": matchesRegex(/(?=.*[A-Z])/),
87
+ "Must contain at least one lower case character": matchesRegex(/(?=.*[a-z])/),
88
+ "Must contain at least one digit": matchesRegex(/(?=.*\d)/),
89
+ "Must contain at least one symbol": matchesRegex(/[^\w]/),
80
90
  };
81
91
 
82
- export const LOGIN_SCHEMA = {
83
- email: EMAIL_REQUIREMENTS,
84
- password: PASSWORD_REQUIREMENTS
92
+ export const LOGIN_SCHEMA: SCHEMA = {
93
+ email: EMAIL_REQUIREMENTS,
94
+ password: PASSWORD_REQUIREMENTS
85
95
  }
86
96
 
87
- export const REGISTER_SCHEMA = {
88
- organization_name: {} // Pass in an empty rule set, so the value can be whatever
89
- email: {
90
- ...EMAIL_REQUIREMENTS,
91
- "Email already registered": checkValueInDatabase('email','users', false)
92
- },
93
- password: PASSWORD_REQUIREMENTS
97
+ export const REGISTER_SCHEMA: SCHEMA = {
98
+ organization_name: {} // Pass in an empty rule set, so the value can be whatever
99
+ email: {
100
+ ...EMAIL_REQUIREMENTS,
101
+ "Email already registered": existsInDatabase('email','users', false)
102
+ },
103
+ password: PASSWORD_REQUIREMENTS
94
104
  }
95
105
 
96
106
  export const INVITATION_PARAM: SCHEMA = {
97
- code: {
98
- "Not a valid invitation": existsInDatabase('code', 'invitation')
99
- }
107
+ code: {
108
+ "Not a valid invitation": existsInDatabase('code', 'invitation')
109
+ }
100
110
  }
101
111
 
102
112
  ```
@@ -112,43 +122,43 @@ import { LOGIN_SCHEMA, REGISTER_SCHEMA, INVITATION_PARAM } from './rules.ts'
112
122
 
113
123
  // Wrapper for hono validator middleware
114
124
  const validateWrapper = (schema: SCHEMA, error: ClientErrorStatusCode | RedirectStatusCode = 400, strict = true) =>
115
- async (value: any, c: Context) => {
116
- const jwt = c.get('jwtPayload'); // Pass jwt to the validator so we could use its value when checking input validation rules
117
- const errors = await getSchemaErrors(value, schema, strict, jwt);
118
- if (Object.values(errors).filter((e) => e.length).length) {
119
- throw new HTTPException(error, {
120
- message: JSON.stringify(errors),
121
- })
122
- }
123
- return value
124
- }
125
+ async (value: any, c: Context) => {
126
+ const jwt = c.get('jwtPayload'); // Pass jwt to the validator so we could use its value when checking input validation rules
127
+ const errors = await getSchemaErrors(value, schema, {strict:true}, jwt);
128
+ if (Object.values(errors).filter((e) => e.length).length) {
129
+ throw new HTTPException(error, {
130
+ message: JSON.stringify(errors),
131
+ });
132
+ }
133
+ return value;
134
+ }
125
135
 
126
136
  const app = new Hono();
127
137
 
128
138
  app.use(jwt({
129
- secret: "some-secret-value",
130
- cookie: 'token'
131
- }))
139
+ secret: "some-secret-value",
140
+ cookie: 'token'
141
+ }));
132
142
 
133
143
  app.post('/login',
134
- validator('json', validateWrapper(LOGIN_SCHEMA)),
135
- (c) => c.text("Success"));
144
+ validator('json', validateWrapper(LOGIN_SCHEMA)),
145
+ (c) => c.text("Success"));
136
146
 
137
147
  app.all('/logout', (c) => c.text("Success"));
138
148
 
139
149
  app.put('/register',
140
- validator('json', validateWrapper(REGISTER_SCHEMA)),
141
- (c) => c.text("Success"));
150
+ validator('json', validateWrapper(REGISTER_SCHEMA)),
151
+ (c) => c.text("Success"));
142
152
 
143
153
  // This first validates the invitation parameter against our database
144
154
  // And then validates the body of the request
145
155
  app.put('/register/:invitation_code',
146
- validator('param', validateWrapper(INVITATION_PARAM)),
147
- validator('json', validateWrapper(
148
- // Registering via invitation needs all the same values except organization name - inherit parts of rule sets, as opposed to extending the rule set as shown above
149
- (({ organization_name, ...invite_schema }) => invite_schema)(REGISTRATION_SCHEMA)
150
- )),
151
- (c)=> c.text("Success")))
156
+ validator('param', validateWrapper(INVITATION_PARAM)),
157
+ validator('json', validateWrapper(
158
+ // Registering via invitation needs all the same values except organization name - inherit parts of rule sets, as opposed to extending the rule set as shown above
159
+ (({ organization_name, ...invite_schema }) => invite_schema)(REGISTRATION_SCHEMA)
160
+ )),
161
+ (c)=> c.text("Success"));
152
162
 
153
163
  export default app;
154
164
  ```
@@ -1,16 +1,20 @@
1
1
  // Generated by dts-bundle-generator v8.1.1
2
2
 
3
- export type RULE = (value: unknown, ...overload: unknown[]) => boolean | Promise<boolean>;
4
3
  export type RULE_SYNC = (value: unknown, ...overload: unknown[]) => boolean;
4
+ export type RULE = (value: unknown, ...overload: unknown[]) => boolean | Promise<boolean>;
5
5
  export type RULES = {
6
6
  [index: string]: RULE;
7
7
  };
8
- export declare const type: (type: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function") => RULE;
9
- export declare const matchesRegex: (regex: RegExp) => (value: unknown) => boolean;
10
- export declare const stringBetween: (max?: number, min?: number) => (s: unknown) => boolean;
11
- export declare const numberBetween: (max?: number, min?: number) => (i: unknown) => boolean;
12
- export declare const acceptAny: (rules?: RULE[]) => (i: unknown, ...extra: unknown[]) => Promise<boolean>;
13
- export declare const acceptAnySync: (rules?: RULE_SYNC[]) => (i: unknown, ...extra: unknown[]) => boolean;
8
+ export declare const isType: (type: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function") => RULE_SYNC;
9
+ export declare const matchesRegex: (regex: RegExp) => RULE_SYNC;
10
+ export declare const max: (max_value?: number) => RULE_SYNC;
11
+ export declare const min: (min_value?: number) => RULE_SYNC;
12
+ export declare const maxLength: (max_length?: number) => RULE_SYNC;
13
+ export declare const minLength: (min_length?: number) => RULE_SYNC;
14
+ export declare const stringBetween: (max?: number, min?: number) => RULE_SYNC;
15
+ export declare const numberBetween: (max?: number, min?: number) => RULE_SYNC;
16
+ export declare const acceptAny: (rules?: RULE[]) => RULE;
17
+ export declare const acceptAnySync: (rules?: RULE_SYNC[]) => RULE_SYNC;
14
18
  export declare const allowUndefined: (rules: RULES) => {};
15
19
  export declare const preprocess: (fn: Function, rules: RULES) => {};
16
20
 
@@ -1 +1 @@
1
- var u=(e)=>(n)=>typeof n===e,p=(e)=>(n)=>typeof n==="string"&&e.test(n),i=(e=100,n=0)=>(o)=>typeof o==="string"&&o.length>=n&&o.length<e,f=(e=100,n=1)=>(o)=>typeof o==="number"&&o>=n&&o<e,w=(e=[])=>async(n,...o)=>(await Promise.all(e.map((t)=>t.call(void 0,n,...o)))).some((t)=>t),a=(e=[])=>(n,...o)=>e.map((t)=>t.call(void 0,n,...o)).some((t)=>t);var l=(e)=>Object.entries(e).reduce((n,[o,t])=>({...n,[o]:(c,...r)=>typeof c==="undefined"?!0:t(c,...r)}),{}),d=(e,n)=>Object.entries(n).reduce((o,[t,c])=>({...o,[t]:(r,...s)=>c(e(r),...s)}),{});export{u as type,i as stringBetween,d as preprocess,f as numberBetween,p as matchesRegex,l as allowUndefined,a as acceptAnySync,w as acceptAny};
1
+ var s=(n)=>n!==null&&typeof n==="object"&&("length"in n)&&typeof n.length==="number",p=(n)=>(e)=>typeof e===n,i=(n)=>(e)=>typeof e==="string"&&n.test(e),m=(n=1/0)=>(e)=>typeof e==="number"&&e<=n,f=(n=-1/0)=>(e)=>typeof e==="number"&&e>=n,w=(n=1/0)=>(e)=>s(e)&&e.length<=n,y=(n=1/0)=>(e)=>s(e)&&e.length>=n,a=(n=100,e=0)=>(t)=>typeof t==="string"&&t.length>=e&&t.length<n,L=(n=100,e=1)=>(t)=>typeof t==="number"&&t>=e&&t<n,h=(n=[])=>async(e,...t)=>(await Promise.all(n.map((o)=>o(void 0,e,...t)))).some((o)=>o),R=(n=[])=>(e,...t)=>n.map((o)=>o(void 0,e,...t)).some((o)=>o);var g=(n)=>Object.entries(n).reduce((e,[t,o])=>({...e,[t]:(r,...u)=>typeof r==="undefined"?!0:o(r,...u)}),{}),l=(n,e)=>Object.entries(e).reduce((t,[o,r])=>({...t,[o]:(u,...c)=>r(n(u),...c)}),{});export{a as stringBetween,l as preprocess,L as numberBetween,y as minLength,f as min,w as maxLength,m as max,i as matchesRegex,p as isType,g as allowUndefined,R as acceptAnySync,h as acceptAny};
package/lib/index.d.ts CHANGED
@@ -1,31 +1,36 @@
1
1
  // Generated by dts-bundle-generator v8.1.1
2
2
 
3
- export type RULE = (value: unknown, ...overload: unknown[]) => boolean | Promise<boolean>;
4
3
  export type RULE_SYNC = (value: unknown, ...overload: unknown[]) => boolean;
5
- export type RULES = {
6
- [index: string]: RULE;
7
- };
4
+ export type RULE = (value: unknown, ...overload: unknown[]) => boolean | Promise<boolean>;
8
5
  export type RULES_SYNC = {
9
6
  [index: string]: RULE_SYNC;
10
7
  };
11
- export type SCHEMA = {
12
- [index: string]: RULES;
8
+ export type RULES = {
9
+ [index: string]: RULE;
13
10
  };
14
11
  export type SCHEMA_SYNC = {
15
12
  [index: string]: RULES_SYNC;
16
13
  };
14
+ export type SCHEMA = {
15
+ [index: string]: RULES;
16
+ };
17
17
  export type CHECKABLE_OBJECT = {
18
18
  [index: string]: unknown;
19
19
  };
20
- export type CHECKED_SCHEMA = Promise<{
21
- [index: string]: string[];
22
- }>;
20
+ /**
21
+ * @arg {boolean} strict --- Don't allow object to have keys not included in the schema
22
+ * @arg {boolean} break_early --- Return the first error found
23
+ */
24
+ export type SCHEMA_OPTIONS = {
25
+ strict?: boolean;
26
+ };
23
27
  export type CHECKED_SCHEMA_SYNC = {
24
28
  [index: string]: string[];
25
29
  };
30
+ export type CHECKED_SCHEMA = Promise<CHECKED_SCHEMA_SYNC>;
26
31
  export declare const getValueErrors: (value: unknown, rules: RULES, ...overload: unknown[]) => Promise<string[]>;
27
- export declare const getSchemaErrors: (object: CHECKABLE_OBJECT, schema: SCHEMA, strict?: boolean, ...overload: unknown[]) => CHECKED_SCHEMA;
32
+ export declare const getSchemaErrors: (object: CHECKABLE_OBJECT, schema: SCHEMA, options?: SCHEMA_OPTIONS, ...overload: unknown[]) => CHECKED_SCHEMA;
28
33
  export declare const getValueErrorsSync: (value: unknown, rules: RULES_SYNC, ...overload: unknown[]) => string[];
29
- export declare const getSchemaErrorsSync: (object: CHECKABLE_OBJECT, schema: SCHEMA_SYNC, strict?: boolean, ...overload: unknown[]) => CHECKED_SCHEMA_SYNC;
34
+ export declare const getSchemaErrorsSync: (object: CHECKABLE_OBJECT, schema: SCHEMA_SYNC, options?: SCHEMA_OPTIONS, ...overload: unknown[]) => CHECKED_SCHEMA_SYNC;
30
35
 
31
36
  export {};
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- var U=async(E,S,...L)=>{const p={};return Object.entries(S).forEach(([n,x])=>{p[n]=Promise.resolve().then(()=>x(E,...L)).then((C)=>p[n]=C).catch(()=>{p[n]=!1})}),await Promise.allSettled(Object.values(p)),Object.entries(p).reduce((n,[x,C])=>C?n:[...n,x],[])},N=async(E,S,L=!1,...p)=>{const n={};if(Object.entries(S).forEach(([x,C])=>{n[x]=U(E[x],C,...p).then((i)=>{n[x]=i}).catch((i)=>{n[x]=i})}),L){const x=Object.keys(E),C=new Set(Object.keys(S));x.filter((R)=>!C.has(R)).forEach((R)=>{n[R]=["Key not allowed"]})}return await Promise.allSettled(Object.values(n)),n},H=(E,S,...L)=>Object.entries(S).reduce((p,[n,x])=>{try{return x(E,...L)?p:[...p,n]}catch(C){return[...p,n]}},[]),Y=(E,S,L=!1,...p)=>{const n=Object.entries(S).reduce((x,[C,i])=>({...x,[C]:H(E[C],i,...p)}),{});if(L){const x=Object.keys(E),C=new Set(Object.keys(S));x.filter((R)=>!C.has(R)).forEach((R)=>{n[R]=["Key not allowed"]})}return n};export{H as getValueErrorsSync,U as getValueErrors,Y as getSchemaErrorsSync,N as getSchemaErrors};
1
+ var W={strict:!1},X=async(B,G,...J)=>{const q={};return Object.entries(G).forEach(([x,f])=>{q[x]=Promise.resolve(!1).then(()=>f(B,...J)).then((z)=>q[x]=z).catch(()=>q[x]=!1)}),await Promise.allSettled(Object.values(q)),Object.entries(q).reduce((x,[f,z])=>z?x:[...x,f],[])},Z=async(B,G,J=W,...q)=>{const x={};if(Object.entries(G).forEach(([f,z])=>{x[f]=X(B[f],z,...q).then((K)=>{x[f]=K}).catch((K)=>{x[f]=K})}),J.strict){const f=Object.keys(B),z=new Set(Object.keys(G));f.filter((Q)=>!z.has(Q)).forEach((Q)=>{x[Q]=["Key not allowed"]})}return await Promise.allSettled(Object.values(x)),x},Y=(B,G,...J)=>Object.entries(G).reduce((q,[x,f])=>{try{return f(B,...J)?q:[...q,x]}catch(z){return[...q,x]}},[]),$=(B,G,J=W,...q)=>{const x=Object.entries(G).reduce((f,[z,K])=>({...f,[z]:Y(B[z],K,...q)}),{});if(J.strict){const f=Object.keys(B),z=new Set(Object.keys(G));f.filter((Q)=>!z.has(Q)).forEach((Q)=>{x[Q]=["Key not allowed"]})}return x};export{Y as getValueErrorsSync,X as getValueErrors,$ as getSchemaErrorsSync,Z as getSchemaErrors};
@@ -1,7 +1,11 @@
1
1
  // Generated by dts-bundle-generator v8.1.1
2
2
 
3
3
  export declare const EMAIL_PATTERN: RegExp;
4
- export declare const TIMESTAMP_PATTERN: RegExp;
4
+ export declare const MYSQL_TIMESTAMP_PATTERN: RegExp;
5
5
  export declare const URL_PATTERN: RegExp;
6
+ export declare const ISO_8601_DATETIME_PATTERN_STRICT: RegExp;
7
+ export declare const ISO_8601_DATETIME_PATTERN: RegExp;
8
+ export declare const ISO_8601_TIME_PATTERN: RegExp;
9
+ export declare const RFC_2822_TIMESTAMP_PATTERN: RegExp;
6
10
 
7
11
  export {};
@@ -1 +1 @@
1
- var T=/^[\w.%+-]+@[\w.-]+\.[a-zA-Z]{1,}$/,s=/^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})$/,t=/^(https?:\/\/)?([^\s$.?#].[^\s]*)\.[a-z]{2,}(\/[^\s]*)?$/i;export{t as URL_PATTERN,s as TIMESTAMP_PATTERN,T as EMAIL_PATTERN};
1
+ var x=/^[\w.%+-]+@[\w.-]+\.[a-zA-Z]{1,}$/,c=/^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})$/,d=/^(https?:\/\/)?([^\s$.?#].[^\s]*)\.[a-z]{2,}(\/[^\s]*)?$/i,f=/^(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))$/,j=/^(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+)|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d)|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d)$/,k=/^(2[0-3]|[01][0-9]):?([0-5][0-9]):?([0-5][0-9])(Z|[+-](?:2[0-3]|[01][0-9])(?::?(?:[0-5][0-9]))?)$/,l=/^(?:(Sun|Mon|Tue|Wed|Thu|Fri|Sat),\s+)?(0[1-9]|[1-2]?[0-9]|3[01])\s+(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+(19[0-9]{2}|[2-9][0-9]{3})\s+(2[0-3]|[0-1][0-9]):([0-5][0-9])(?::(60|[0-5][0-9]))?\s+([-\+][0-9]{2}[0-5][0-9]|(?:UT|GMT|(?:E|C|M|P)(?:ST|DT)|[A-IK-Z]))(\s+|\(([^\(\)]+|\\\(|\\\))*\))*$/;export{d as URL_PATTERN,l as RFC_2822_TIMESTAMP_PATTERN,c as MYSQL_TIMESTAMP_PATTERN,k as ISO_8601_TIME_PATTERN,f as ISO_8601_DATETIME_PATTERN_STRICT,j as ISO_8601_DATETIME_PATTERN,x as EMAIL_PATTERN};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ivl",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "author": {
5
5
  "name": "Oskar Voorel",
6
6
  "email": "oskar@voorel.com"
@@ -48,7 +48,7 @@
48
48
  ],
49
49
  "license": "MIT",
50
50
  "scripts": {
51
- "build": "bun run build.mjs",
51
+ "build": "rm -rf ./lib && bun run build.mjs",
52
52
  "prepublishOnly": "bun run build",
53
53
  "benchmark": "bun run ./benchmark/index.ts"
54
54
  },