tuijs-util 2.0.2 → 2.0.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/dist/index.d.ts CHANGED
@@ -8,4 +8,5 @@ export * from './lib/http.js';
8
8
  export * from './lib/misc.js';
9
9
  export * from './lib/parse.js';
10
10
  export * from './lib/regex.js';
11
+ export * from './lib/math.js';
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -8,4 +8,5 @@ export * from './lib/http.js';
8
8
  export * from './lib/misc.js';
9
9
  export * from './lib/parse.js';
10
10
  export * from './lib/regex.js';
11
+ export * from './lib/math.js';
11
12
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"html-tags.d.ts","sourceRoot":"","sources":["../../../src/lib/lists/html-tags.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,EAAE,MAAM,EAkFhC,CAAC"}
1
+ {"version":3,"file":"html-tags.d.ts","sourceRoot":"","sources":["../../../src/lib/lists/html-tags.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,EAAE,MAAM,EAqHhC,CAAC"}
@@ -1,84 +1,119 @@
1
1
  export const listHtmlTags = [
2
- "html",
3
- "body",
4
- "div",
5
- "span",
6
- "applet",
7
- "object",
8
- "iframe",
9
- "h1",
10
- "h2",
11
- "h3",
12
- "h4",
13
- "h5",
14
- "h6",
15
- "p",
16
- "blockquote",
17
- "pre",
18
2
  "a",
19
3
  "abbr",
20
4
  "acronym",
21
5
  "address",
6
+ "applet",
7
+ "area",
8
+ "article",
9
+ "aside",
10
+ "audio",
11
+ "b",
12
+ "base",
13
+ "bdi",
14
+ "bdo",
22
15
  "big",
16
+ "blockquote",
17
+ "body",
18
+ "br",
19
+ "button",
20
+ "canvas",
21
+ "caption",
22
+ "center",
23
23
  "cite",
24
24
  "code",
25
+ "col",
26
+ "colgroup",
27
+ "data",
28
+ "datalist",
29
+ "dd",
25
30
  "del",
31
+ "details",
26
32
  "dfn",
33
+ "dialog",
34
+ "div",
35
+ "dl",
36
+ "dt",
27
37
  "em",
38
+ "embed",
39
+ "fieldset",
40
+ "figcaption",
41
+ "figure",
42
+ "footer",
43
+ "form",
44
+ "h1",
45
+ "h2",
46
+ "h3",
47
+ "h4",
48
+ "h5",
49
+ "h6",
50
+ "head",
51
+ "header",
52
+ "hgroup",
53
+ "hr",
54
+ "html",
55
+ "i",
56
+ "iframe",
28
57
  "img",
58
+ "input",
29
59
  "ins",
30
60
  "kbd",
61
+ "label",
62
+ "legend",
63
+ "li",
64
+ "link",
65
+ "main",
66
+ "map",
67
+ "mark",
68
+ "menu",
69
+ "meta",
70
+ "meter",
71
+ "nav",
72
+ "noscript",
73
+ "object",
74
+ "ol",
75
+ "optgroup",
76
+ "option",
77
+ "output",
78
+ "p",
79
+ "picture",
80
+ "pre",
81
+ "progress",
31
82
  "q",
83
+ "rp",
84
+ "rt",
85
+ "ruby",
32
86
  "s",
33
87
  "samp",
88
+ "script",
89
+ "section",
90
+ "select",
34
91
  "small",
92
+ "source",
93
+ "span",
35
94
  "strike",
36
95
  "strong",
96
+ "style",
37
97
  "sub",
98
+ "summary",
38
99
  "sup",
39
- "tt",
40
- "var",
41
- "b",
42
- "u",
43
- "i",
44
- "center",
45
- "dl",
46
- "dt",
47
- "dd",
48
- "ol",
49
- "ul",
50
- "li",
51
- "fieldset",
52
- "form",
53
- "label",
54
- "legend",
55
100
  "table",
56
- "caption",
57
101
  "tbody",
102
+ "td",
103
+ "template",
104
+ "textarea",
58
105
  "tfoot",
59
- "thead",
60
- "tr",
61
106
  "th",
62
- "td",
63
- "article",
64
- "aside",
65
- "canvas",
66
- "details",
67
- "embed",
68
- "figure",
69
- "figcaption",
70
- "footer",
71
- "header",
72
- "hgroup",
73
- "menu",
74
- "nav",
75
- "output",
76
- "ruby",
77
- "section",
78
- "summary",
107
+ "thead",
79
108
  "time",
80
- "mark",
81
- "audio",
82
- "video"
109
+ "title",
110
+ "tr",
111
+ "track",
112
+ "tt",
113
+ "u",
114
+ "ul",
115
+ "var",
116
+ "video",
117
+ "wbr"
83
118
  ];
84
119
  //# sourceMappingURL=html-tags.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"html-tags.js","sourceRoot":"","sources":["../../../src/lib/lists/html-tags.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAa;IAClC,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,GAAG;IACH,YAAY;IACZ,KAAK;IACL,GAAG;IACH,MAAM;IACN,SAAS;IACT,SAAS;IACT,KAAK;IACL,MAAM;IACN,MAAM;IACN,KAAK;IACL,KAAK;IACL,IAAI;IACJ,KAAK;IACL,KAAK;IACL,KAAK;IACL,GAAG;IACH,GAAG;IACH,MAAM;IACN,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,KAAK;IACL,IAAI;IACJ,KAAK;IACL,GAAG;IACH,GAAG;IACH,GAAG;IACH,QAAQ;IACR,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,UAAU;IACV,MAAM;IACN,OAAO;IACP,QAAQ;IACR,OAAO;IACP,SAAS;IACT,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,SAAS;IACT,OAAO;IACP,QAAQ;IACR,SAAS;IACT,OAAO;IACP,QAAQ;IACR,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,KAAK;IACL,QAAQ;IACR,MAAM;IACN,SAAS;IACT,SAAS;IACT,MAAM;IACN,MAAM;IACN,OAAO;IACP,OAAO;CACV,CAAC"}
1
+ {"version":3,"file":"html-tags.js","sourceRoot":"","sources":["../../../src/lib/lists/html-tags.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAa;IAClC,GAAG;IACH,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;IACR,MAAM;IACN,SAAS;IACT,OAAO;IACP,OAAO;IACP,GAAG;IACH,MAAM;IACN,KAAK;IACL,KAAK;IACL,KAAK;IACL,YAAY;IACZ,MAAM;IACN,IAAI;IACJ,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,MAAM;IACN,MAAM;IACN,KAAK;IACL,UAAU;IACV,MAAM;IACN,UAAU;IACV,IAAI;IACJ,KAAK;IACL,SAAS;IACT,KAAK;IACL,QAAQ;IACR,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,GAAG;IACH,QAAQ;IACR,KAAK;IACL,OAAO;IACP,KAAK;IACL,KAAK;IACL,OAAO;IACP,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,UAAU;IACV,QAAQ;IACR,IAAI;IACJ,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,GAAG;IACH,SAAS;IACT,KAAK;IACL,UAAU;IACV,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,GAAG;IACH,MAAM;IACN,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,KAAK;IACL,SAAS;IACT,KAAK;IACL,OAAO;IACP,OAAO;IACP,IAAI;IACJ,UAAU;IACV,UAAU;IACV,OAAO;IACP,IAAI;IACJ,OAAO;IACP,MAAM;IACN,OAAO;IACP,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,KAAK;IACL,OAAO;IACP,KAAK;CACR,CAAC"}
@@ -0,0 +1,20 @@
1
+ export declare const millisecond = 1;
2
+ export declare const second = 1000;
3
+ export declare const minute: number;
4
+ export declare const hour: number;
5
+ export declare const day: number;
6
+ export declare const day30: number;
7
+ export declare const day60: number;
8
+ export declare const day90: number;
9
+ export declare const week: number;
10
+ export declare const fortnight: number;
11
+ export declare const month28: number;
12
+ export declare const month29: number;
13
+ export declare const month: number;
14
+ export declare const month30: number;
15
+ export declare const month31: number;
16
+ export declare const quarter: number;
17
+ export declare const year: number;
18
+ export declare const leapYear: number;
19
+ export declare const averageYear: number;
20
+ //# sourceMappingURL=math.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/lib/math.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,MAAM,OAAO,CAAC;AAC3B,eAAO,MAAM,MAAM,QAAc,CAAC;AAClC,eAAO,MAAM,IAAI,QAAc,CAAC;AAChC,eAAO,MAAM,GAAG,QAAY,CAAC;AAC7B,eAAO,MAAM,KAAK,QAAW,CAAC;AAC9B,eAAO,MAAM,KAAK,QAAW,CAAC;AAC9B,eAAO,MAAM,KAAK,QAAW,CAAC;AAC9B,eAAO,MAAM,IAAI,QAAU,CAAC;AAC5B,eAAO,MAAM,SAAS,QAAW,CAAC;AAClC,eAAO,MAAM,OAAO,QAAW,CAAC;AAChC,eAAO,MAAM,OAAO,QAAW,CAAC;AAChC,eAAO,MAAM,KAAK,QAAW,CAAC;AAC9B,eAAO,MAAM,OAAO,QAAW,CAAC;AAChC,eAAO,MAAM,OAAO,QAAW,CAAC;AAChC,eAAO,MAAM,OAAO,QAAY,CAAC;AACjC,eAAO,MAAM,IAAI,QAAY,CAAC;AAC9B,eAAO,MAAM,QAAQ,QAAY,CAAC;AAClC,eAAO,MAAM,WAAW,QAAe,CAAC"}
@@ -0,0 +1,20 @@
1
+ export const millisecond = 1;
2
+ export const second = 1000;
3
+ export const minute = 60 * second;
4
+ export const hour = 60 * minute;
5
+ export const day = 24 * hour;
6
+ export const day30 = 30 * day;
7
+ export const day60 = 60 * day;
8
+ export const day90 = 90 * day;
9
+ export const week = 7 * day;
10
+ export const fortnight = 2 * week;
11
+ export const month28 = 28 * day;
12
+ export const month29 = 29 * day;
13
+ export const month = 30 * day;
14
+ export const month30 = 30 * day;
15
+ export const month31 = 31 * day;
16
+ export const quarter = 3 * month;
17
+ export const year = 365 * day;
18
+ export const leapYear = 366 * day;
19
+ export const averageYear = 365.25 * day;
20
+ //# sourceMappingURL=math.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"math.js","sourceRoot":"","sources":["../../src/lib/math.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC;AAC7B,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC;AAC3B,MAAM,CAAC,MAAM,MAAM,GAAG,EAAE,GAAG,MAAM,CAAC;AAClC,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,GAAG,MAAM,CAAC;AAChC,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC;AAC7B,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,GAAG,GAAG,CAAC;AAC9B,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,GAAG,GAAG,CAAC;AAC9B,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,GAAG,GAAG,CAAC;AAC9B,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,GAAG,GAAG,CAAC;AAC5B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC;AAClC,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,GAAG,GAAG,CAAC;AAChC,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,GAAG,GAAG,CAAC;AAChC,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,GAAG,GAAG,CAAC;AAC9B,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,GAAG,GAAG,CAAC;AAChC,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,GAAG,GAAG,CAAC;AAChC,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC;AACjC,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC;AAC9B,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,GAAG,GAAG,CAAC;AAClC,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,GAAG,GAAG,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tuijs-util",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "A simple JavaScript utility library",
5
5
  "author": "TechTB LLC",
6
6
  "license": "MIT",
@@ -22,6 +22,6 @@
22
22
  },
23
23
  "devDependencies": {
24
24
  "rimraf": "^6.1.3",
25
- "typescript": "^5.9.3"
25
+ "typescript": "^6.0.2"
26
26
  }
27
27
  }
package/src/index.ts CHANGED
@@ -8,3 +8,4 @@ export * from './lib/http.js';
8
8
  export * from './lib/misc.js';
9
9
  export * from './lib/parse.js';
10
10
  export * from './lib/regex.js';
11
+ export * from './lib/math.js';
@@ -1,83 +1,118 @@
1
1
  export const listHtmlTags: string[] = [
2
- "html",
3
- "body",
4
- "div",
5
- "span",
6
- "applet",
7
- "object",
8
- "iframe",
9
- "h1",
10
- "h2",
11
- "h3",
12
- "h4",
13
- "h5",
14
- "h6",
15
- "p",
16
- "blockquote",
17
- "pre",
18
2
  "a",
19
3
  "abbr",
20
4
  "acronym",
21
5
  "address",
6
+ "applet",
7
+ "area",
8
+ "article",
9
+ "aside",
10
+ "audio",
11
+ "b",
12
+ "base",
13
+ "bdi",
14
+ "bdo",
22
15
  "big",
16
+ "blockquote",
17
+ "body",
18
+ "br",
19
+ "button",
20
+ "canvas",
21
+ "caption",
22
+ "center",
23
23
  "cite",
24
24
  "code",
25
+ "col",
26
+ "colgroup",
27
+ "data",
28
+ "datalist",
29
+ "dd",
25
30
  "del",
31
+ "details",
26
32
  "dfn",
33
+ "dialog",
34
+ "div",
35
+ "dl",
36
+ "dt",
27
37
  "em",
38
+ "embed",
39
+ "fieldset",
40
+ "figcaption",
41
+ "figure",
42
+ "footer",
43
+ "form",
44
+ "h1",
45
+ "h2",
46
+ "h3",
47
+ "h4",
48
+ "h5",
49
+ "h6",
50
+ "head",
51
+ "header",
52
+ "hgroup",
53
+ "hr",
54
+ "html",
55
+ "i",
56
+ "iframe",
28
57
  "img",
58
+ "input",
29
59
  "ins",
30
60
  "kbd",
61
+ "label",
62
+ "legend",
63
+ "li",
64
+ "link",
65
+ "main",
66
+ "map",
67
+ "mark",
68
+ "menu",
69
+ "meta",
70
+ "meter",
71
+ "nav",
72
+ "noscript",
73
+ "object",
74
+ "ol",
75
+ "optgroup",
76
+ "option",
77
+ "output",
78
+ "p",
79
+ "picture",
80
+ "pre",
81
+ "progress",
31
82
  "q",
83
+ "rp",
84
+ "rt",
85
+ "ruby",
32
86
  "s",
33
87
  "samp",
88
+ "script",
89
+ "section",
90
+ "select",
34
91
  "small",
92
+ "source",
93
+ "span",
35
94
  "strike",
36
95
  "strong",
96
+ "style",
37
97
  "sub",
98
+ "summary",
38
99
  "sup",
39
- "tt",
40
- "var",
41
- "b",
42
- "u",
43
- "i",
44
- "center",
45
- "dl",
46
- "dt",
47
- "dd",
48
- "ol",
49
- "ul",
50
- "li",
51
- "fieldset",
52
- "form",
53
- "label",
54
- "legend",
55
100
  "table",
56
- "caption",
57
101
  "tbody",
102
+ "td",
103
+ "template",
104
+ "textarea",
58
105
  "tfoot",
59
- "thead",
60
- "tr",
61
106
  "th",
62
- "td",
63
- "article",
64
- "aside",
65
- "canvas",
66
- "details",
67
- "embed",
68
- "figure",
69
- "figcaption",
70
- "footer",
71
- "header",
72
- "hgroup",
73
- "menu",
74
- "nav",
75
- "output",
76
- "ruby",
77
- "section",
78
- "summary",
107
+ "thead",
79
108
  "time",
80
- "mark",
81
- "audio",
82
- "video"
109
+ "title",
110
+ "tr",
111
+ "track",
112
+ "tt",
113
+ "u",
114
+ "ul",
115
+ "var",
116
+ "video",
117
+ "wbr"
83
118
  ];
@@ -0,0 +1,19 @@
1
+ export const millisecond = 1;
2
+ export const second = 1000;
3
+ export const minute = 60 * second;
4
+ export const hour = 60 * minute;
5
+ export const day = 24 * hour;
6
+ export const day30 = 30 * day;
7
+ export const day60 = 60 * day;
8
+ export const day90 = 90 * day;
9
+ export const week = 7 * day;
10
+ export const fortnight = 2 * week;
11
+ export const month28 = 28 * day;
12
+ export const month29 = 29 * day;
13
+ export const month = 30 * day;
14
+ export const month30 = 30 * day;
15
+ export const month31 = 31 * day;
16
+ export const quarter = 3 * month;
17
+ export const year = 365 * day;
18
+ export const leapYear = 366 * day;
19
+ export const averageYear = 365.25 * day;
package/tsconfig.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "module": "ES2022",
6
6
  "target": "ES2020",
7
7
  "lib": ["ES2020", "DOM"],
8
- "moduleResolution": "node",
8
+ "moduleResolution": "bundler",
9
9
  "declaration": true,
10
10
  "declarationMap": true,
11
11
  "sourceMap": true,