tuijs-util 2.0.0 → 2.0.1
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/LICENSE +21 -21
- package/README.md +28 -24
- package/dist/lib/parse.d.ts.map +1 -1
- package/dist/lib/parse.js +0 -1
- package/dist/lib/parse.js.map +1 -1
- package/package.json +19 -19
- package/src/index.ts +10 -10
- package/src/lib/check.ts +254 -254
- package/src/lib/dom.ts +54 -54
- package/src/lib/http.ts +90 -90
- package/src/lib/lists/colors.ts +150 -150
- package/src/lib/lists/html-tags.ts +83 -83
- package/src/lib/lists/misc.ts +4 -4
- package/src/lib/lists/subnets.ts +27 -27
- package/src/lib/misc.ts +117 -117
- package/src/lib/parse.ts +23 -24
- package/src/lib/regex.ts +51 -51
- package/tsconfig.json +20 -20
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 TechTB
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 TechTB
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
# TUIJS-UTIL
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
# TUIJS-UTIL
|
|
2
|
+
***Last Updated 03/11/2026***
|
|
3
|
+
|
|
4
|
+
## Description
|
|
5
|
+
A simple JavaScript utility library. TUIJS-UTIL contains a number of different functions, lists, and regular expressions that make coding a little easier.
|
|
6
|
+
|
|
7
|
+
<br>
|
|
8
|
+
<br>
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
npm i tuijs-util
|
|
12
|
+
|
|
13
|
+
## Import
|
|
14
|
+
All utilities are provide both via named exports and can be called like any other function.
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
```javascript
|
|
18
|
+
import { parseTemplate } from 'tuijs-util';
|
|
19
|
+
|
|
20
|
+
const titleTemple = parseTemplate(/*html*/`
|
|
21
|
+
<div>
|
|
22
|
+
<h1>Page Title</h1>
|
|
23
|
+
</div>
|
|
24
|
+
`);
|
|
25
|
+
document.body.appendChild(titleTemple);
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
|
package/dist/lib/parse.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/lib/parse.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/lib/parse.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAgBxE"}
|
package/dist/lib/parse.js
CHANGED
|
@@ -8,7 +8,6 @@ export function parseFunctionString(string) {
|
|
|
8
8
|
if (!match) {
|
|
9
9
|
throw new Error('Input does not match the expected pattern "functionName(args)".');
|
|
10
10
|
}
|
|
11
|
-
const _ = match[0]; // Full match (not used)
|
|
12
11
|
const funcName = match[1]; // Function name
|
|
13
12
|
const args = match[2]; // Arguments as a single string
|
|
14
13
|
const func = window[funcName];
|
package/dist/lib/parse.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/lib/parse.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAc;IAC9C,MAAM,KAAK,GAA4B,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,6BAA6B;IACrG,IAAI,CAAC,KAAK,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;IACvF,CAAC;IACD,MAAM,
|
|
1
|
+
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/lib/parse.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAc;IAC9C,MAAM,KAAK,GAA4B,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,6BAA6B;IACrG,IAAI,CAAC,KAAK,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;IACvF,CAAC;IACD,MAAM,QAAQ,GAAW,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB;IACnD,MAAM,IAAI,GAAW,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,+BAA+B;IAC9D,MAAM,IAAI,GAAG,MAAM,CAAC,QAAwB,CAAC,CAAC;IAC9C,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,IAAI,QAAQ,4BAA4B,CAAC,CAAC;IAC9D,CAAC;IACD,MAAM,UAAU,GAAa,IAAI;SAC5B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,yBAAyB;SAC5E,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,iCAAiC;IACjE,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;AACrC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "tuijs-util",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "A simple JavaScript utility library",
|
|
5
|
-
"author": "TechTB LLC",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"repository": "github:TechTB-OpenSource/tuijs-util",
|
|
8
|
-
"main": "src/index.js",
|
|
9
|
-
"type": "module",
|
|
10
|
-
"scripts": {
|
|
11
|
-
"clean": "rimraf dist",
|
|
12
|
-
"build": "npm run clean && tsc",
|
|
13
|
-
"deploy": "npm run build && npm publish"
|
|
14
|
-
},
|
|
15
|
-
"devDependencies": {
|
|
16
|
-
"rimraf": "^6.1.3",
|
|
17
|
-
"typescript": "^5.9.3"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "tuijs-util",
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "A simple JavaScript utility library",
|
|
5
|
+
"author": "TechTB LLC",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": "github:TechTB-OpenSource/tuijs-util",
|
|
8
|
+
"main": "src/index.js",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"clean": "rimraf dist",
|
|
12
|
+
"build": "npm run clean && tsc",
|
|
13
|
+
"deploy": "npm run build && npm publish"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"rimraf": "^6.1.3",
|
|
17
|
+
"typescript": "^5.9.3"
|
|
18
|
+
}
|
|
19
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from './lib/lists/colors.js';
|
|
2
|
-
export * from './lib/lists/html-tags.js';
|
|
3
|
-
export * from './lib/lists/misc.js';
|
|
4
|
-
export * from './lib/lists/subnets.js';
|
|
5
|
-
export * from './lib/check.js';
|
|
6
|
-
export * from './lib/dom.js';
|
|
7
|
-
export * from './lib/http.js';
|
|
8
|
-
export * from './lib/misc.js';
|
|
9
|
-
export * from './lib/parse.js';
|
|
10
|
-
export * from './lib/regex.js';
|
|
1
|
+
export * from './lib/lists/colors.js';
|
|
2
|
+
export * from './lib/lists/html-tags.js';
|
|
3
|
+
export * from './lib/lists/misc.js';
|
|
4
|
+
export * from './lib/lists/subnets.js';
|
|
5
|
+
export * from './lib/check.js';
|
|
6
|
+
export * from './lib/dom.js';
|
|
7
|
+
export * from './lib/http.js';
|
|
8
|
+
export * from './lib/misc.js';
|
|
9
|
+
export * from './lib/parse.js';
|
|
10
|
+
export * from './lib/regex.js';
|