@utilix-tech/sdk 0.3.0 → 0.3.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/CHANGELOG.md +15 -0
- package/README.md +28 -28
- package/SECURITY.md +16 -0
- package/dist/{chunk-OKSWDVOM.js → chunk-GX7H6TAX.js} +1 -1
- package/dist/{chunk-W4UBLYFU.js → chunk-HFRTZE7T.js} +2 -2
- package/dist/{chunk-ROTPLW7T.js → chunk-IPR7FSX4.js} +2 -2
- package/dist/{chunk-T3JTY2M5.js → chunk-N7C52YGL.js} +1 -1
- package/dist/{chunk-XST6X3HT.js → chunk-QJE743LY.js} +10 -10
- package/dist/{chunk-NSOARQCM.js → chunk-V5S6OJ4A.js} +14 -14
- package/dist/index.cjs +30 -30
- package/dist/index.js +6 -6
- package/dist/tools/api.cjs +2 -2
- package/dist/tools/api.js +1 -1
- package/dist/tools/code.cjs +14 -14
- package/dist/tools/code.js +1 -1
- package/dist/tools/encoding.cjs +2 -2
- package/dist/tools/encoding.js +1 -1
- package/dist/tools/media.cjs +1 -1
- package/dist/tools/media.js +1 -1
- package/dist/tools/misc.cjs +1 -1
- package/dist/tools/misc.js +1 -1
- package/dist/tools/units.cjs +10 -10
- package/dist/tools/units.js +1 -1
- package/package.json +18 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Full release notes for all Utilix surfaces (browser tools, REST API, SDKs, MCP server) live at [utilix.tech/changelog](https://utilix.tech/changelog). This file tracks just this package.
|
|
4
|
+
|
|
5
|
+
## 0.3.1
|
|
6
|
+
- Metadata fixes: corrected repository/bug tracker links, updated tool count in the package description.
|
|
7
|
+
|
|
8
|
+
## 0.3.0
|
|
9
|
+
- Added the `media` module.
|
|
10
|
+
|
|
11
|
+
## 0.2.0
|
|
12
|
+
- 400+ functions across 14 modules, including the `ai_agent` module for LLM/RAG pipelines.
|
|
13
|
+
|
|
14
|
+
## 0.1.0
|
|
15
|
+
- Initial release.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @utilix-tech/sdk
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**140+ developer utility functions for Node.js: runs locally, no API key required.**
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@utilix-tech/sdk)
|
|
6
6
|
[](https://www.npmjs.com/package/@utilix-tech/sdk)
|
|
@@ -62,7 +62,7 @@ const { formatJson } = require("@utilix-tech/sdk/json");
|
|
|
62
62
|
|
|
63
63
|
## Modules
|
|
64
64
|
|
|
65
|
-
### `/json
|
|
65
|
+
### `/json`: JSON Tools
|
|
66
66
|
|
|
67
67
|
```ts
|
|
68
68
|
import { formatJson, minifyJson, diffJson, jsonToTypescript, validateJson,
|
|
@@ -71,7 +71,7 @@ import { formatJson, minifyJson, diffJson, jsonToTypescript, validateJson,
|
|
|
71
71
|
// Format with 2-space indent
|
|
72
72
|
formatJson('{"name":"alice","age":30}', { indent: 2 });
|
|
73
73
|
|
|
74
|
-
// Diff two JSON strings
|
|
74
|
+
// Diff two JSON strings: returns line-by-line diff
|
|
75
75
|
diffJson(jsonA, jsonB);
|
|
76
76
|
|
|
77
77
|
// Generate TypeScript interface from JSON
|
|
@@ -89,7 +89,7 @@ validateJson(data, schema);
|
|
|
89
89
|
|
|
90
90
|
---
|
|
91
91
|
|
|
92
|
-
### `/encoding
|
|
92
|
+
### `/encoding`: Encode & Decode
|
|
93
93
|
|
|
94
94
|
```ts
|
|
95
95
|
import { encodeBase64, decodeBase64, encodeUrl, decodeUrl,
|
|
@@ -104,7 +104,7 @@ base32Encode("hello"); // "NBSWY3DPEB3W64TMMQ======"
|
|
|
104
104
|
|
|
105
105
|
---
|
|
106
106
|
|
|
107
|
-
### `/hashing
|
|
107
|
+
### `/hashing`: Hash & Password
|
|
108
108
|
|
|
109
109
|
```ts
|
|
110
110
|
import { hashAll, hashOne, hashPassword, verifyPassword, generateHtpasswdFile } from "@utilix-tech/sdk/hashing";
|
|
@@ -123,7 +123,7 @@ generateHtpasswdFile([{ username: "alice", password: "secret" }]);
|
|
|
123
123
|
|
|
124
124
|
---
|
|
125
125
|
|
|
126
|
-
### `/text
|
|
126
|
+
### `/text`: String & Text
|
|
127
127
|
|
|
128
128
|
```ts
|
|
129
129
|
import { convertCase, slugify, countWords, generateWords, generateParagraphs,
|
|
@@ -152,7 +152,7 @@ detectPassiveVoice("The report was reviewed by the committee. They approved it."
|
|
|
152
152
|
|
|
153
153
|
---
|
|
154
154
|
|
|
155
|
-
### `/data
|
|
155
|
+
### `/data`: CSV / YAML / TOML / XML / INI
|
|
156
156
|
|
|
157
157
|
```ts
|
|
158
158
|
import { parseCsv, csvToJson, validateYaml, tomlToJson, jsonToToml,
|
|
@@ -179,7 +179,7 @@ parseIni("[db]\nhost=localhost\nport=5432");
|
|
|
179
179
|
|
|
180
180
|
---
|
|
181
181
|
|
|
182
|
-
### `/generators
|
|
182
|
+
### `/generators`: UUID, Passwords, Fake Data
|
|
183
183
|
|
|
184
184
|
```ts
|
|
185
185
|
import { generateUuid, generateV4, generateV7, generateUlid,
|
|
@@ -202,7 +202,7 @@ generateData([
|
|
|
202
202
|
|
|
203
203
|
---
|
|
204
204
|
|
|
205
|
-
### `/time
|
|
205
|
+
### `/time`: Dates, Timezones, Cron
|
|
206
206
|
|
|
207
207
|
```ts
|
|
208
208
|
import { diffDates, parseCron, convertTime, formatRelative,
|
|
@@ -225,7 +225,7 @@ getNextRuns("*/5 * * * *", 5); // next 5 run timestamps
|
|
|
225
225
|
|
|
226
226
|
---
|
|
227
227
|
|
|
228
|
-
### `/units
|
|
228
|
+
### `/units`: Conversions
|
|
229
229
|
|
|
230
230
|
```ts
|
|
231
231
|
import { convertBytes, pxToAll, convert, formatValue } from "@utilix-tech/sdk/units";
|
|
@@ -250,7 +250,7 @@ formatValue(1234567.89, { locale: "en-US", currency: "USD" });
|
|
|
250
250
|
|
|
251
251
|
---
|
|
252
252
|
|
|
253
|
-
### `/network
|
|
253
|
+
### `/network`: URLs, IPs, HTTP
|
|
254
254
|
|
|
255
255
|
```ts
|
|
256
256
|
import { getStatusCode, isValidIp, isValidIpv4, isValidIpv6,
|
|
@@ -270,7 +270,7 @@ countryCodeToFlag("US"); // "🇺🇸"
|
|
|
270
270
|
|
|
271
271
|
---
|
|
272
272
|
|
|
273
|
-
### `/api
|
|
273
|
+
### `/api`: cURL, JWT, CORS, HTTP
|
|
274
274
|
|
|
275
275
|
```ts
|
|
276
276
|
import { buildCurl, parseCurlCommand, decodeJwt, signJwt,
|
|
@@ -289,7 +289,7 @@ buildCurl({
|
|
|
289
289
|
// Parse a curl command back into its parts
|
|
290
290
|
parseCurlCommand('curl -X GET https://api.example.com -H "Authorization: Bearer token"');
|
|
291
291
|
|
|
292
|
-
// JWT
|
|
292
|
+
// JWT: decode without verification
|
|
293
293
|
decodeJwt("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...");
|
|
294
294
|
// { header: {...}, payload: {...}, isExpired: false, expiresIn: "2h" }
|
|
295
295
|
|
|
@@ -302,7 +302,7 @@ generateCspHeader({ "default-src": ["'self'"], "script-src": ["'self'", "cdn.exa
|
|
|
302
302
|
|
|
303
303
|
---
|
|
304
304
|
|
|
305
|
-
### `/code
|
|
305
|
+
### `/code`: SQL, HTML, RegEx, GQL
|
|
306
306
|
|
|
307
307
|
```ts
|
|
308
308
|
import { formatSql, minifySql, testRegex, formatHtml, formatGql,
|
|
@@ -334,7 +334,7 @@ formatGql("query { user(id: 1) { name email } }");
|
|
|
334
334
|
|
|
335
335
|
---
|
|
336
336
|
|
|
337
|
-
### `/color
|
|
337
|
+
### `/color`: Color Conversion & Palettes
|
|
338
338
|
|
|
339
339
|
```ts
|
|
340
340
|
import { parseColor, convertColor, generatePalette, checkContrast } from "@utilix-tech/sdk/color";
|
|
@@ -354,7 +354,7 @@ checkContrast("#ffffff", "#000000");
|
|
|
354
354
|
|
|
355
355
|
---
|
|
356
356
|
|
|
357
|
-
### `/css
|
|
357
|
+
### `/css`: CSS Generators
|
|
358
358
|
|
|
359
359
|
```ts
|
|
360
360
|
import { generateGradient, generateBoxShadow, generateBorderRadius,
|
|
@@ -376,7 +376,7 @@ generateBorderRadius({ tl: 8, tr: 8, br: 0, bl: 0 });
|
|
|
376
376
|
|
|
377
377
|
---
|
|
378
378
|
|
|
379
|
-
### `/misc
|
|
379
|
+
### `/misc`: SVG, QR, Unicode
|
|
380
380
|
|
|
381
381
|
```ts
|
|
382
382
|
import { optimizeSvg, sanitizeSvg, analyzeString, toUnicodeEscape,
|
|
@@ -400,13 +400,13 @@ analyzeString("café"); // { length: 4, codePoints: [...], ... }
|
|
|
400
400
|
|
|
401
401
|
---
|
|
402
402
|
|
|
403
|
-
### `/media
|
|
403
|
+
### `/media`: Image Header Parsing
|
|
404
404
|
|
|
405
405
|
```ts
|
|
406
406
|
import { readImageInfo } from "@utilix-tech/sdk/media";
|
|
407
407
|
|
|
408
408
|
// Reads format, dimensions, bit depth, and alpha channel straight from
|
|
409
|
-
// file bytes
|
|
409
|
+
// file bytes: no decoding, no canvas, no image library.
|
|
410
410
|
const bytes = await fs.promises.readFile("photo.png");
|
|
411
411
|
readImageInfo(new Uint8Array(bytes));
|
|
412
412
|
// { format: "png", width: 1920, height: 1080, bitDepth: 8, colorType: "rgba", hasAlpha: true }
|
|
@@ -435,13 +435,13 @@ Supports PNG, JPEG, GIF, WebP, and BMP.
|
|
|
435
435
|
| `@utilix-tech/sdk/css` | CSS gradient, box-shadow, border-radius, keyframe animation generators |
|
|
436
436
|
| `@utilix-tech/sdk/misc` | SVG optimize/sanitize, file size format, Unicode inspector |
|
|
437
437
|
| `@utilix-tech/sdk/ai_agent` | Token estimate/trim, chunk text, extract URLs/JSON/keywords, sanitize HTML, flatten/merge JSON, dedupe lines, validate schema, PII/secret/injection detect |
|
|
438
|
-
| `@utilix-tech/sdk/media` | Image format & dimension reading from raw bytes
|
|
438
|
+
| `@utilix-tech/sdk/media` | Image format & dimension reading from raw bytes: PNG, JPEG, GIF, WebP, BMP |
|
|
439
439
|
|
|
440
440
|
---
|
|
441
441
|
|
|
442
442
|
## Python SDK
|
|
443
443
|
|
|
444
|
-
`@utilix-tech/sdk` has a Python companion
|
|
444
|
+
`@utilix-tech/sdk` has a Python companion, [`utilix-sdk`](https://pypi.org/project/utilix-sdk/) on PyPI, with the same 140+ tools and identical return shapes.
|
|
445
445
|
|
|
446
446
|
```bash
|
|
447
447
|
pip install utilix-sdk
|
|
@@ -453,9 +453,9 @@ Both SDKs return plain JSON-serializable objects so you can share test fixtures
|
|
|
453
453
|
|
|
454
454
|
## REST API
|
|
455
455
|
|
|
456
|
-
**This package is Surface A
|
|
456
|
+
**This package is Surface A**: everything runs in-process in your Node.js runtime. No outbound requests, no API key, no rate limits.
|
|
457
457
|
|
|
458
|
-
The same
|
|
458
|
+
The same 140+ tools are also available as a hosted **REST API** at `https://api.utilix.tech/v1` for environments where you can't ship a Node.js runtime, or for cross-language teams.
|
|
459
459
|
|
|
460
460
|
```bash
|
|
461
461
|
curl -X POST https://api.utilix.tech/v1/tools/hash \
|
|
@@ -464,17 +464,17 @@ curl -X POST https://api.utilix.tech/v1/tools/hash \
|
|
|
464
464
|
-d '{"input": "hello world", "algorithm": "sha256"}'
|
|
465
465
|
```
|
|
466
466
|
|
|
467
|
-
- **Free**: 1,000 requests/day
|
|
468
|
-
- **Pro**: 10,000 requests/day
|
|
469
|
-
- Try it live at **[utilix.tech/api](https://utilix.tech/api)
|
|
467
|
+
- **Free**: 1,000 requests/day: no credit card required
|
|
468
|
+
- **Pro**: 10,000 requests/day: $9/month
|
|
469
|
+
- Try it live at **[utilix.tech/api](https://utilix.tech/api)**: no signup needed for the first 10 endpoints
|
|
470
470
|
- Get your API key at **[utilix.tech/dashboard](https://utilix.tech/dashboard)**
|
|
471
471
|
|
|
472
472
|
---
|
|
473
473
|
|
|
474
474
|
## Publishing (maintainers)
|
|
475
475
|
|
|
476
|
-
CI publishes automatically via npm Trusted Publishing (OIDC) on every push to `main` that bumps `version`. Requires npm **>=11.5.1
|
|
476
|
+
CI publishes automatically via npm Trusted Publishing (OIDC) on every push to `main` that bumps `version`. Requires npm **>=11.5.1**: older versions (e.g. the npm bundled with Node 20) sign provenance but skip the OIDC auth exchange, so `npm publish` fails with a 404 as if unauthenticated.
|
|
477
477
|
|
|
478
478
|
## License
|
|
479
479
|
|
|
480
|
-
MIT
|
|
480
|
+
MIT: see [LICENSE](./LICENSE) for details.
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Reporting a Vulnerability
|
|
4
|
+
|
|
5
|
+
If you discover a security vulnerability in this package, please report it privately rather than opening a public issue.
|
|
6
|
+
|
|
7
|
+
Email **hello@utilix.tech** with the subject line "Security report" and include:
|
|
8
|
+
- A description of the vulnerability and its potential impact
|
|
9
|
+
- Steps to reproduce, if possible
|
|
10
|
+
- Any suggested fix
|
|
11
|
+
|
|
12
|
+
We aim to acknowledge reports within 3 business days. Please give us a reasonable window to release a fix before disclosing publicly.
|
|
13
|
+
|
|
14
|
+
## Supported Versions
|
|
15
|
+
|
|
16
|
+
Only the latest published version of `@utilix-tech/sdk` receives security fixes. We recommend always running the latest release.
|
|
@@ -570,7 +570,7 @@ function getConversionWarnings(from, to) {
|
|
|
570
570
|
warnings.push("Transparency will be lost if the WebP image has an alpha channel");
|
|
571
571
|
}
|
|
572
572
|
if (to === "image/jpeg") {
|
|
573
|
-
warnings.push("JPEG uses lossy compression
|
|
573
|
+
warnings.push("JPEG uses lossy compression: some quality may be reduced");
|
|
574
574
|
}
|
|
575
575
|
return warnings;
|
|
576
576
|
}
|
|
@@ -451,13 +451,13 @@ function decodeJwt(token) {
|
|
|
451
451
|
try {
|
|
452
452
|
header = decodeSegment(rawHeader);
|
|
453
453
|
} catch {
|
|
454
|
-
return { ok: false, error: "Failed to decode header
|
|
454
|
+
return { ok: false, error: "Failed to decode header: not valid base64url JSON" };
|
|
455
455
|
}
|
|
456
456
|
let payload;
|
|
457
457
|
try {
|
|
458
458
|
payload = decodeSegment(rawPayload);
|
|
459
459
|
} catch {
|
|
460
|
-
return { ok: false, error: "Failed to decode payload
|
|
460
|
+
return { ok: false, error: "Failed to decode payload: not valid base64url JSON" };
|
|
461
461
|
}
|
|
462
462
|
const algorithm = typeof header.alg === "string" ? header.alg : "unknown";
|
|
463
463
|
const now = Math.floor(Date.now() / 1e3);
|
|
@@ -45,7 +45,7 @@ function decodeBase64(input, variant = "standard") {
|
|
|
45
45
|
const output = bytes.toString("utf8");
|
|
46
46
|
return { ok: true, output, outputBytes: bytes.length };
|
|
47
47
|
} catch {
|
|
48
|
-
return { ok: false, error: "Invalid Base64
|
|
48
|
+
return { ok: false, error: "Invalid Base64: check the input and variant setting" };
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
function encodeUrl(input, mode = "component") {
|
|
@@ -64,7 +64,7 @@ function decodeUrl(input, mode = "component") {
|
|
|
64
64
|
const output = mode === "component" ? decodeURIComponent(trimmed) : decodeURI(trimmed);
|
|
65
65
|
return { ok: true, output, changed: output !== trimmed };
|
|
66
66
|
} catch {
|
|
67
|
-
return { ok: false, error: "Invalid percent-encoding
|
|
67
|
+
return { ok: false, error: "Invalid percent-encoding: check the input" };
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
function diffSegments(original, encoded) {
|
|
@@ -128,7 +128,7 @@ function readImageInfo(bytes) {
|
|
|
128
128
|
if (bytes[0] === 255 && bytes[1] === 216) {
|
|
129
129
|
return readJpeg(bytes);
|
|
130
130
|
}
|
|
131
|
-
return { error: "Unrecognized image format
|
|
131
|
+
return { error: "Unrecognized image format. Supported formats: PNG, JPEG, GIF, WebP, BMP" };
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
export { media_exports, readImageInfo };
|
|
@@ -82,16 +82,16 @@ function formatValue(value, unit, decimals = 4) {
|
|
|
82
82
|
return `${value.toFixed(decimals)}${unit}`;
|
|
83
83
|
}
|
|
84
84
|
var COMMON_SIZES = [
|
|
85
|
-
{ px: 8, label: "8px
|
|
86
|
-
{ px: 12, label: "12px
|
|
87
|
-
{ px: 14, label: "14px
|
|
88
|
-
{ px: 16, label: "16px
|
|
89
|
-
{ px: 18, label: "18px
|
|
90
|
-
{ px: 20, label: "20px
|
|
91
|
-
{ px: 24, label: "24px
|
|
92
|
-
{ px: 32, label: "32px
|
|
93
|
-
{ px: 48, label: "48px
|
|
94
|
-
{ px: 64, label: "64px
|
|
85
|
+
{ px: 8, label: "8px: Extra small spacing / icon size" },
|
|
86
|
+
{ px: 12, label: "12px: Small text / caption" },
|
|
87
|
+
{ px: 14, label: "14px: Body small / secondary text" },
|
|
88
|
+
{ px: 16, label: "16px: Base font size / body text" },
|
|
89
|
+
{ px: 18, label: "18px: Body large / lead text" },
|
|
90
|
+
{ px: 20, label: "20px: Subheading / large body" },
|
|
91
|
+
{ px: 24, label: "24px: H4 / section title" },
|
|
92
|
+
{ px: 32, label: "32px: H3 / card heading" },
|
|
93
|
+
{ px: 48, label: "48px: H2 / page section heading" },
|
|
94
|
+
{ px: 64, label: "64px: H1 / hero heading" }
|
|
95
95
|
];
|
|
96
96
|
function pxToViewport(px, viewportWidth = 1440, viewportHeight = 900) {
|
|
97
97
|
const vw = parseFloat((px / viewportWidth * 100).toFixed(4));
|
|
@@ -134,24 +134,24 @@ var CHEATSHEET = [
|
|
|
134
134
|
{ pattern: "{n}", description: "Matches exactly n repetitions", example: "\\d{3} matches exactly 3 digits", category: "Quantifiers" },
|
|
135
135
|
{ pattern: "{n,}", description: "Matches n or more repetitions", example: "\\d{2,} matches 2 or more digits", category: "Quantifiers" },
|
|
136
136
|
{ pattern: "{n,m}", description: "Matches between n and m repetitions", example: "\\d{2,4} matches 2 to 4 digits", category: "Quantifiers" },
|
|
137
|
-
{ pattern: "*?", description: "Lazy match
|
|
137
|
+
{ pattern: "*?", description: "Lazy match: matches as few characters as possible", example: "<.*?> matches the shortest possible HTML tag", category: "Quantifiers" },
|
|
138
138
|
{ pattern: "+?", description: "Lazy version of +", example: "a+? matches as few 'a's as possible", category: "Quantifiers" },
|
|
139
|
-
{ pattern: "(abc)", description: "Capturing group
|
|
140
|
-
{ pattern: "(?:abc)", description: "Non-capturing group
|
|
139
|
+
{ pattern: "(abc)", description: "Capturing group: captures the matched substring", example: "(\\d+) captures digit sequences", category: "Groups" },
|
|
140
|
+
{ pattern: "(?:abc)", description: "Non-capturing group: groups without capturing", example: "(?:foo|bar)baz matches 'foobaz' or 'barbaz'", category: "Groups" },
|
|
141
141
|
{ pattern: "(?<name>abc)", description: "Named capturing group", example: "(?<year>\\d{4}) captures year by name", category: "Groups" },
|
|
142
|
-
{ pattern: "a|b", description: "Alternation
|
|
142
|
+
{ pattern: "a|b", description: "Alternation: matches either a or b", example: "cat|dog matches 'cat' or 'dog'", category: "Groups" },
|
|
143
143
|
{ pattern: "\\1", description: "Backreference to the first capturing group", example: "(\\w+) \\1 matches repeated words like 'the the'", category: "Groups" },
|
|
144
144
|
{ pattern: "\\k<name>", description: "Backreference to a named capturing group", example: "(?<word>\\w+) \\k<word> matches repeated named group", category: "Groups" },
|
|
145
|
-
{ pattern: "(?=abc)", description: "Positive lookahead
|
|
146
|
-
{ pattern: "(?!abc)", description: "Negative lookahead
|
|
147
|
-
{ pattern: "(?<=abc)", description: "Positive lookbehind
|
|
148
|
-
{ pattern: "(?<!abc)", description: "Negative lookbehind
|
|
149
|
-
{ pattern: "g", description: "Global flag
|
|
150
|
-
{ pattern: "i", description: "Case-insensitive flag
|
|
151
|
-
{ pattern: "m", description: "Multiline flag
|
|
152
|
-
{ pattern: "s", description: "Dotall flag
|
|
153
|
-
{ pattern: "u", description: "Unicode flag
|
|
154
|
-
{ pattern: "y", description: "Sticky flag
|
|
145
|
+
{ pattern: "(?=abc)", description: "Positive lookahead: asserts what follows matches", example: "\\d+(?= dollars) matches digits followed by ' dollars'", category: "Lookahead/Lookbehind" },
|
|
146
|
+
{ pattern: "(?!abc)", description: "Negative lookahead: asserts what follows does not match", example: "\\d+(?! dollars) matches digits not followed by ' dollars'", category: "Lookahead/Lookbehind" },
|
|
147
|
+
{ pattern: "(?<=abc)", description: "Positive lookbehind: asserts what precedes matches", example: "(?<=\\$)\\d+ matches digits preceded by '$'", category: "Lookahead/Lookbehind" },
|
|
148
|
+
{ pattern: "(?<!abc)", description: "Negative lookbehind: asserts what precedes does not match", example: "(?<!\\$)\\d+ matches digits not preceded by '$'", category: "Lookahead/Lookbehind" },
|
|
149
|
+
{ pattern: "g", description: "Global flag: finds all matches rather than stopping at the first", example: "/\\d+/g finds all numbers in a string", category: "Flags" },
|
|
150
|
+
{ pattern: "i", description: "Case-insensitive flag: ignores letter case", example: "/hello/i matches 'Hello', 'HELLO', 'hello'", category: "Flags" },
|
|
151
|
+
{ pattern: "m", description: "Multiline flag: ^ and $ match start/end of each line", example: "/^\\w+/m matches the first word of each line", category: "Flags" },
|
|
152
|
+
{ pattern: "s", description: "Dotall flag: makes . match newline characters too", example: "/a.b/s matches 'a\\nb'", category: "Flags" },
|
|
153
|
+
{ pattern: "u", description: "Unicode flag: enables full Unicode matching", example: "/\\u{1F600}/u matches a Unicode emoji", category: "Flags" },
|
|
154
|
+
{ pattern: "y", description: "Sticky flag: matches only from the lastIndex position", example: "/\\d+/y matches digits starting at the current position", category: "Flags" },
|
|
155
155
|
{ pattern: "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}", description: "Matches a basic email address", example: "user@example.com", category: "Common Patterns" },
|
|
156
156
|
{ pattern: "https?://[\\w\\-]+(\\.[\\w\\-]+)+([\\w.,@?^=%&:/~+#\\-]*[\\w@?^=%&/~+#\\-])?", description: "Matches an HTTP or HTTPS URL", example: "https://www.example.com/path?query=value", category: "Common Patterns" },
|
|
157
157
|
{ pattern: "^(?:\\+1)?[-.\\s]?\\(?\\d{3}\\)?[-.\\s]?\\d{3}[-.\\s]?\\d{4}$", description: "Matches a North American phone number in various formats", example: "(555) 123-4567 or 555-123-4567", category: "Common Patterns" },
|
package/dist/index.cjs
CHANGED
|
@@ -1333,7 +1333,7 @@ function decodeBase64(input, variant = "standard") {
|
|
|
1333
1333
|
const output = bytes.toString("utf8");
|
|
1334
1334
|
return { ok: true, output, outputBytes: bytes.length };
|
|
1335
1335
|
} catch {
|
|
1336
|
-
return { ok: false, error: "Invalid Base64
|
|
1336
|
+
return { ok: false, error: "Invalid Base64: check the input and variant setting" };
|
|
1337
1337
|
}
|
|
1338
1338
|
}
|
|
1339
1339
|
function encodeUrl(input, mode = "component") {
|
|
@@ -1352,7 +1352,7 @@ function decodeUrl(input, mode = "component") {
|
|
|
1352
1352
|
const output = mode === "component" ? decodeURIComponent(trimmed) : decodeURI(trimmed);
|
|
1353
1353
|
return { ok: true, output, changed: output !== trimmed };
|
|
1354
1354
|
} catch {
|
|
1355
|
-
return { ok: false, error: "Invalid percent-encoding
|
|
1355
|
+
return { ok: false, error: "Invalid percent-encoding: check the input" };
|
|
1356
1356
|
}
|
|
1357
1357
|
}
|
|
1358
1358
|
function diffSegments(original, encoded) {
|
|
@@ -6544,16 +6544,16 @@ function formatValue(value, unit, decimals = 4) {
|
|
|
6544
6544
|
return `${value.toFixed(decimals)}${unit}`;
|
|
6545
6545
|
}
|
|
6546
6546
|
var COMMON_SIZES = [
|
|
6547
|
-
{ px: 8, label: "8px
|
|
6548
|
-
{ px: 12, label: "12px
|
|
6549
|
-
{ px: 14, label: "14px
|
|
6550
|
-
{ px: 16, label: "16px
|
|
6551
|
-
{ px: 18, label: "18px
|
|
6552
|
-
{ px: 20, label: "20px
|
|
6553
|
-
{ px: 24, label: "24px
|
|
6554
|
-
{ px: 32, label: "32px
|
|
6555
|
-
{ px: 48, label: "48px
|
|
6556
|
-
{ px: 64, label: "64px
|
|
6547
|
+
{ px: 8, label: "8px: Extra small spacing / icon size" },
|
|
6548
|
+
{ px: 12, label: "12px: Small text / caption" },
|
|
6549
|
+
{ px: 14, label: "14px: Body small / secondary text" },
|
|
6550
|
+
{ px: 16, label: "16px: Base font size / body text" },
|
|
6551
|
+
{ px: 18, label: "18px: Body large / lead text" },
|
|
6552
|
+
{ px: 20, label: "20px: Subheading / large body" },
|
|
6553
|
+
{ px: 24, label: "24px: H4 / section title" },
|
|
6554
|
+
{ px: 32, label: "32px: H3 / card heading" },
|
|
6555
|
+
{ px: 48, label: "48px: H2 / page section heading" },
|
|
6556
|
+
{ px: 64, label: "64px: H1 / hero heading" }
|
|
6557
6557
|
];
|
|
6558
6558
|
function pxToViewport(px, viewportWidth = 1440, viewportHeight = 900) {
|
|
6559
6559
|
const vw = parseFloat((px / viewportWidth * 100).toFixed(4));
|
|
@@ -9187,13 +9187,13 @@ function decodeJwt(token) {
|
|
|
9187
9187
|
try {
|
|
9188
9188
|
header = decodeSegment(rawHeader);
|
|
9189
9189
|
} catch {
|
|
9190
|
-
return { ok: false, error: "Failed to decode header
|
|
9190
|
+
return { ok: false, error: "Failed to decode header: not valid base64url JSON" };
|
|
9191
9191
|
}
|
|
9192
9192
|
let payload;
|
|
9193
9193
|
try {
|
|
9194
9194
|
payload = decodeSegment(rawPayload);
|
|
9195
9195
|
} catch {
|
|
9196
|
-
return { ok: false, error: "Failed to decode payload
|
|
9196
|
+
return { ok: false, error: "Failed to decode payload: not valid base64url JSON" };
|
|
9197
9197
|
}
|
|
9198
9198
|
const algorithm = typeof header.alg === "string" ? header.alg : "unknown";
|
|
9199
9199
|
const now = Math.floor(Date.now() / 1e3);
|
|
@@ -10085,24 +10085,24 @@ var CHEATSHEET = [
|
|
|
10085
10085
|
{ pattern: "{n}", description: "Matches exactly n repetitions", example: "\\d{3} matches exactly 3 digits", category: "Quantifiers" },
|
|
10086
10086
|
{ pattern: "{n,}", description: "Matches n or more repetitions", example: "\\d{2,} matches 2 or more digits", category: "Quantifiers" },
|
|
10087
10087
|
{ pattern: "{n,m}", description: "Matches between n and m repetitions", example: "\\d{2,4} matches 2 to 4 digits", category: "Quantifiers" },
|
|
10088
|
-
{ pattern: "*?", description: "Lazy match
|
|
10088
|
+
{ pattern: "*?", description: "Lazy match: matches as few characters as possible", example: "<.*?> matches the shortest possible HTML tag", category: "Quantifiers" },
|
|
10089
10089
|
{ pattern: "+?", description: "Lazy version of +", example: "a+? matches as few 'a's as possible", category: "Quantifiers" },
|
|
10090
|
-
{ pattern: "(abc)", description: "Capturing group
|
|
10091
|
-
{ pattern: "(?:abc)", description: "Non-capturing group
|
|
10090
|
+
{ pattern: "(abc)", description: "Capturing group: captures the matched substring", example: "(\\d+) captures digit sequences", category: "Groups" },
|
|
10091
|
+
{ pattern: "(?:abc)", description: "Non-capturing group: groups without capturing", example: "(?:foo|bar)baz matches 'foobaz' or 'barbaz'", category: "Groups" },
|
|
10092
10092
|
{ pattern: "(?<name>abc)", description: "Named capturing group", example: "(?<year>\\d{4}) captures year by name", category: "Groups" },
|
|
10093
|
-
{ pattern: "a|b", description: "Alternation
|
|
10093
|
+
{ pattern: "a|b", description: "Alternation: matches either a or b", example: "cat|dog matches 'cat' or 'dog'", category: "Groups" },
|
|
10094
10094
|
{ pattern: "\\1", description: "Backreference to the first capturing group", example: "(\\w+) \\1 matches repeated words like 'the the'", category: "Groups" },
|
|
10095
10095
|
{ pattern: "\\k<name>", description: "Backreference to a named capturing group", example: "(?<word>\\w+) \\k<word> matches repeated named group", category: "Groups" },
|
|
10096
|
-
{ pattern: "(?=abc)", description: "Positive lookahead
|
|
10097
|
-
{ pattern: "(?!abc)", description: "Negative lookahead
|
|
10098
|
-
{ pattern: "(?<=abc)", description: "Positive lookbehind
|
|
10099
|
-
{ pattern: "(?<!abc)", description: "Negative lookbehind
|
|
10100
|
-
{ pattern: "g", description: "Global flag
|
|
10101
|
-
{ pattern: "i", description: "Case-insensitive flag
|
|
10102
|
-
{ pattern: "m", description: "Multiline flag
|
|
10103
|
-
{ pattern: "s", description: "Dotall flag
|
|
10104
|
-
{ pattern: "u", description: "Unicode flag
|
|
10105
|
-
{ pattern: "y", description: "Sticky flag
|
|
10096
|
+
{ pattern: "(?=abc)", description: "Positive lookahead: asserts what follows matches", example: "\\d+(?= dollars) matches digits followed by ' dollars'", category: "Lookahead/Lookbehind" },
|
|
10097
|
+
{ pattern: "(?!abc)", description: "Negative lookahead: asserts what follows does not match", example: "\\d+(?! dollars) matches digits not followed by ' dollars'", category: "Lookahead/Lookbehind" },
|
|
10098
|
+
{ pattern: "(?<=abc)", description: "Positive lookbehind: asserts what precedes matches", example: "(?<=\\$)\\d+ matches digits preceded by '$'", category: "Lookahead/Lookbehind" },
|
|
10099
|
+
{ pattern: "(?<!abc)", description: "Negative lookbehind: asserts what precedes does not match", example: "(?<!\\$)\\d+ matches digits not preceded by '$'", category: "Lookahead/Lookbehind" },
|
|
10100
|
+
{ pattern: "g", description: "Global flag: finds all matches rather than stopping at the first", example: "/\\d+/g finds all numbers in a string", category: "Flags" },
|
|
10101
|
+
{ pattern: "i", description: "Case-insensitive flag: ignores letter case", example: "/hello/i matches 'Hello', 'HELLO', 'hello'", category: "Flags" },
|
|
10102
|
+
{ pattern: "m", description: "Multiline flag: ^ and $ match start/end of each line", example: "/^\\w+/m matches the first word of each line", category: "Flags" },
|
|
10103
|
+
{ pattern: "s", description: "Dotall flag: makes . match newline characters too", example: "/a.b/s matches 'a\\nb'", category: "Flags" },
|
|
10104
|
+
{ pattern: "u", description: "Unicode flag: enables full Unicode matching", example: "/\\u{1F600}/u matches a Unicode emoji", category: "Flags" },
|
|
10105
|
+
{ pattern: "y", description: "Sticky flag: matches only from the lastIndex position", example: "/\\d+/y matches digits starting at the current position", category: "Flags" },
|
|
10106
10106
|
{ pattern: "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}", description: "Matches a basic email address", example: "user@example.com", category: "Common Patterns" },
|
|
10107
10107
|
{ pattern: "https?://[\\w\\-]+(\\.[\\w\\-]+)+([\\w.,@?^=%&:/~+#\\-]*[\\w@?^=%&/~+#\\-])?", description: "Matches an HTTP or HTTPS URL", example: "https://www.example.com/path?query=value", category: "Common Patterns" },
|
|
10108
10108
|
{ pattern: "^(?:\\+1)?[-.\\s]?\\(?\\d{3}\\)?[-.\\s]?\\d{3}[-.\\s]?\\d{4}$", description: "Matches a North American phone number in various formats", example: "(555) 123-4567 or 555-123-4567", category: "Common Patterns" },
|
|
@@ -15165,7 +15165,7 @@ function getConversionWarnings(from, to) {
|
|
|
15165
15165
|
warnings.push("Transparency will be lost if the WebP image has an alpha channel");
|
|
15166
15166
|
}
|
|
15167
15167
|
if (to === "image/jpeg") {
|
|
15168
|
-
warnings.push("JPEG uses lossy compression
|
|
15168
|
+
warnings.push("JPEG uses lossy compression: some quality may be reduced");
|
|
15169
15169
|
}
|
|
15170
15170
|
return warnings;
|
|
15171
15171
|
}
|
|
@@ -16887,7 +16887,7 @@ function readImageInfo(bytes) {
|
|
|
16887
16887
|
if (bytes[0] === 255 && bytes[1] === 216) {
|
|
16888
16888
|
return readJpeg(bytes);
|
|
16889
16889
|
}
|
|
16890
|
-
return { error: "Unrecognized image format
|
|
16890
|
+
return { error: "Unrecognized image format. Supported formats: PNG, JPEG, GIF, WebP, BMP" };
|
|
16891
16891
|
}
|
|
16892
16892
|
|
|
16893
16893
|
// src/index.ts
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { media_exports as media } from './chunk-
|
|
2
|
-
export { units_exports as units } from './chunk-
|
|
1
|
+
export { media_exports as media } from './chunk-N7C52YGL.js';
|
|
2
|
+
export { units_exports as units } from './chunk-QJE743LY.js';
|
|
3
3
|
export { network_exports as network } from './chunk-3BAHSW4C.js';
|
|
4
|
-
export { api_exports as api } from './chunk-
|
|
5
|
-
export { code_exports as code } from './chunk-
|
|
4
|
+
export { api_exports as api } from './chunk-HFRTZE7T.js';
|
|
5
|
+
export { code_exports as code } from './chunk-V5S6OJ4A.js';
|
|
6
6
|
export { color_exports as color } from './chunk-BPVAB4P2.js';
|
|
7
7
|
export { css_exports as css } from './chunk-6YPV2AB5.js';
|
|
8
|
-
export { misc_exports as misc } from './chunk-
|
|
8
|
+
export { misc_exports as misc } from './chunk-GX7H6TAX.js';
|
|
9
9
|
export { ai_agent_exports as ai_agent } from './chunk-M35VJETW.js';
|
|
10
10
|
export { json_exports as json } from './chunk-TSAGO3XP.js';
|
|
11
|
-
export { encoding_exports as encoding } from './chunk-
|
|
11
|
+
export { encoding_exports as encoding } from './chunk-IPR7FSX4.js';
|
|
12
12
|
export { hashing_exports as hashing } from './chunk-FL53T24A.js';
|
|
13
13
|
export { text_exports as text } from './chunk-YBBYFAOV.js';
|
|
14
14
|
export { data_exports as data } from './chunk-UC656APA.js';
|
package/dist/tools/api.cjs
CHANGED
|
@@ -410,13 +410,13 @@ function decodeJwt(token) {
|
|
|
410
410
|
try {
|
|
411
411
|
header = decodeSegment(rawHeader);
|
|
412
412
|
} catch {
|
|
413
|
-
return { ok: false, error: "Failed to decode header
|
|
413
|
+
return { ok: false, error: "Failed to decode header: not valid base64url JSON" };
|
|
414
414
|
}
|
|
415
415
|
let payload;
|
|
416
416
|
try {
|
|
417
417
|
payload = decodeSegment(rawPayload);
|
|
418
418
|
} catch {
|
|
419
|
-
return { ok: false, error: "Failed to decode payload
|
|
419
|
+
return { ok: false, error: "Failed to decode payload: not valid base64url JSON" };
|
|
420
420
|
}
|
|
421
421
|
const algorithm = typeof header.alg === "string" ? header.alg : "unknown";
|
|
422
422
|
const now = Math.floor(Date.now() / 1e3);
|
package/dist/tools/api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { COMMON_HEADERS, COMMON_PRESETS, CORS_COMMON_HEADERS, DEFAULT_CORS_CONFIG, DIRECTIVE_DESCRIPTIONS, HTTP_METHODS, SUPPORTED_LANGUAGES, addParam, base64urlDecode, base64urlEncode, buildCurl, buildCurlMultiline, buildUrl, convertToCode, decodeJwt, decodeUrlComponent, detectFormat, encodeUrlComponent, extractJsonPaths, formatJwtJson, formatResponse, generateCors, generateCspHeader, generateFullHeader, generateMetaHtml, getParam, getStats, isValidUrl, normalizeUrl, parseCspHeader, parseCurl, parseCurlCommand, parseMetaTags, parseUrl, removeParam, signJwt, validateCorsConfig, validateCspConfig, validateOgTags } from '../chunk-
|
|
1
|
+
export { COMMON_HEADERS, COMMON_PRESETS, CORS_COMMON_HEADERS, DEFAULT_CORS_CONFIG, DIRECTIVE_DESCRIPTIONS, HTTP_METHODS, SUPPORTED_LANGUAGES, addParam, base64urlDecode, base64urlEncode, buildCurl, buildCurlMultiline, buildUrl, convertToCode, decodeJwt, decodeUrlComponent, detectFormat, encodeUrlComponent, extractJsonPaths, formatJwtJson, formatResponse, generateCors, generateCspHeader, generateFullHeader, generateMetaHtml, getParam, getStats, isValidUrl, normalizeUrl, parseCspHeader, parseCurl, parseCurlCommand, parseMetaTags, parseUrl, removeParam, signJwt, validateCorsConfig, validateCspConfig, validateOgTags } from '../chunk-HFRTZE7T.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/code.cjs
CHANGED
|
@@ -87,24 +87,24 @@ var CHEATSHEET = [
|
|
|
87
87
|
{ pattern: "{n}", description: "Matches exactly n repetitions", example: "\\d{3} matches exactly 3 digits", category: "Quantifiers" },
|
|
88
88
|
{ pattern: "{n,}", description: "Matches n or more repetitions", example: "\\d{2,} matches 2 or more digits", category: "Quantifiers" },
|
|
89
89
|
{ pattern: "{n,m}", description: "Matches between n and m repetitions", example: "\\d{2,4} matches 2 to 4 digits", category: "Quantifiers" },
|
|
90
|
-
{ pattern: "*?", description: "Lazy match
|
|
90
|
+
{ pattern: "*?", description: "Lazy match: matches as few characters as possible", example: "<.*?> matches the shortest possible HTML tag", category: "Quantifiers" },
|
|
91
91
|
{ pattern: "+?", description: "Lazy version of +", example: "a+? matches as few 'a's as possible", category: "Quantifiers" },
|
|
92
|
-
{ pattern: "(abc)", description: "Capturing group
|
|
93
|
-
{ pattern: "(?:abc)", description: "Non-capturing group
|
|
92
|
+
{ pattern: "(abc)", description: "Capturing group: captures the matched substring", example: "(\\d+) captures digit sequences", category: "Groups" },
|
|
93
|
+
{ pattern: "(?:abc)", description: "Non-capturing group: groups without capturing", example: "(?:foo|bar)baz matches 'foobaz' or 'barbaz'", category: "Groups" },
|
|
94
94
|
{ pattern: "(?<name>abc)", description: "Named capturing group", example: "(?<year>\\d{4}) captures year by name", category: "Groups" },
|
|
95
|
-
{ pattern: "a|b", description: "Alternation
|
|
95
|
+
{ pattern: "a|b", description: "Alternation: matches either a or b", example: "cat|dog matches 'cat' or 'dog'", category: "Groups" },
|
|
96
96
|
{ pattern: "\\1", description: "Backreference to the first capturing group", example: "(\\w+) \\1 matches repeated words like 'the the'", category: "Groups" },
|
|
97
97
|
{ pattern: "\\k<name>", description: "Backreference to a named capturing group", example: "(?<word>\\w+) \\k<word> matches repeated named group", category: "Groups" },
|
|
98
|
-
{ pattern: "(?=abc)", description: "Positive lookahead
|
|
99
|
-
{ pattern: "(?!abc)", description: "Negative lookahead
|
|
100
|
-
{ pattern: "(?<=abc)", description: "Positive lookbehind
|
|
101
|
-
{ pattern: "(?<!abc)", description: "Negative lookbehind
|
|
102
|
-
{ pattern: "g", description: "Global flag
|
|
103
|
-
{ pattern: "i", description: "Case-insensitive flag
|
|
104
|
-
{ pattern: "m", description: "Multiline flag
|
|
105
|
-
{ pattern: "s", description: "Dotall flag
|
|
106
|
-
{ pattern: "u", description: "Unicode flag
|
|
107
|
-
{ pattern: "y", description: "Sticky flag
|
|
98
|
+
{ pattern: "(?=abc)", description: "Positive lookahead: asserts what follows matches", example: "\\d+(?= dollars) matches digits followed by ' dollars'", category: "Lookahead/Lookbehind" },
|
|
99
|
+
{ pattern: "(?!abc)", description: "Negative lookahead: asserts what follows does not match", example: "\\d+(?! dollars) matches digits not followed by ' dollars'", category: "Lookahead/Lookbehind" },
|
|
100
|
+
{ pattern: "(?<=abc)", description: "Positive lookbehind: asserts what precedes matches", example: "(?<=\\$)\\d+ matches digits preceded by '$'", category: "Lookahead/Lookbehind" },
|
|
101
|
+
{ pattern: "(?<!abc)", description: "Negative lookbehind: asserts what precedes does not match", example: "(?<!\\$)\\d+ matches digits not preceded by '$'", category: "Lookahead/Lookbehind" },
|
|
102
|
+
{ pattern: "g", description: "Global flag: finds all matches rather than stopping at the first", example: "/\\d+/g finds all numbers in a string", category: "Flags" },
|
|
103
|
+
{ pattern: "i", description: "Case-insensitive flag: ignores letter case", example: "/hello/i matches 'Hello', 'HELLO', 'hello'", category: "Flags" },
|
|
104
|
+
{ pattern: "m", description: "Multiline flag: ^ and $ match start/end of each line", example: "/^\\w+/m matches the first word of each line", category: "Flags" },
|
|
105
|
+
{ pattern: "s", description: "Dotall flag: makes . match newline characters too", example: "/a.b/s matches 'a\\nb'", category: "Flags" },
|
|
106
|
+
{ pattern: "u", description: "Unicode flag: enables full Unicode matching", example: "/\\u{1F600}/u matches a Unicode emoji", category: "Flags" },
|
|
107
|
+
{ pattern: "y", description: "Sticky flag: matches only from the lastIndex position", example: "/\\d+/y matches digits starting at the current position", category: "Flags" },
|
|
108
108
|
{ pattern: "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}", description: "Matches a basic email address", example: "user@example.com", category: "Common Patterns" },
|
|
109
109
|
{ pattern: "https?://[\\w\\-]+(\\.[\\w\\-]+)+([\\w.,@?^=%&:/~+#\\-]*[\\w@?^=%&/~+#\\-])?", description: "Matches an HTTP or HTTPS URL", example: "https://www.example.com/path?query=value", category: "Common Patterns" },
|
|
110
110
|
{ pattern: "^(?:\\+1)?[-.\\s]?\\(?\\d{3}\\)?[-.\\s]?\\d{3}[-.\\s]?\\d{4}$", description: "Matches a North American phone number in various formats", example: "(555) 123-4567 or 555-123-4567", category: "Common Patterns" },
|
package/dist/tools/code.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ALL_FLAGS, CHEATSHEET, OPERATIONS, SQL_DEFAULT_OPTIONS, buildDockerPull, buildDockerRun, buildGitCommand, collapseHtmlWhitespace, collapseJsWhitespace, countProperties, countRules, detectDialect, detectOperationType, envToExport, envToJson, formatCss, formatGql, formatHtml, formatSql, getEndpointsByTag, getHtmlStats, getJsStats, getMethodColor, isValidTag, minifyCss, minifyGql, minifyHtml, minifyJs, minifySql, normalizeRef, parseDockerImage, parseEnv, parseGitCommand, parseSpec, removeConsoleCalls, removeEmptyAttributes, removeHtmlComments, removeJsComments, removeRedundantAttributes, searchCheatsheet, searchEndpoints, splitStatements, testPattern, testRegex, validateEnvKey } from '../chunk-
|
|
1
|
+
export { ALL_FLAGS, CHEATSHEET, OPERATIONS, SQL_DEFAULT_OPTIONS, buildDockerPull, buildDockerRun, buildGitCommand, collapseHtmlWhitespace, collapseJsWhitespace, countProperties, countRules, detectDialect, detectOperationType, envToExport, envToJson, formatCss, formatGql, formatHtml, formatSql, getEndpointsByTag, getHtmlStats, getJsStats, getMethodColor, isValidTag, minifyCss, minifyGql, minifyHtml, minifyJs, minifySql, normalizeRef, parseDockerImage, parseEnv, parseGitCommand, parseSpec, removeConsoleCalls, removeEmptyAttributes, removeHtmlComments, removeJsComments, removeRedundantAttributes, searchCheatsheet, searchEndpoints, splitStatements, testPattern, testRegex, validateEnvKey } from '../chunk-V5S6OJ4A.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/encoding.cjs
CHANGED
|
@@ -28,7 +28,7 @@ function decodeBase64(input, variant = "standard") {
|
|
|
28
28
|
const output = bytes.toString("utf8");
|
|
29
29
|
return { ok: true, output, outputBytes: bytes.length };
|
|
30
30
|
} catch {
|
|
31
|
-
return { ok: false, error: "Invalid Base64
|
|
31
|
+
return { ok: false, error: "Invalid Base64: check the input and variant setting" };
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
function encodeUrl(input, mode = "component") {
|
|
@@ -47,7 +47,7 @@ function decodeUrl(input, mode = "component") {
|
|
|
47
47
|
const output = mode === "component" ? decodeURIComponent(trimmed) : decodeURI(trimmed);
|
|
48
48
|
return { ok: true, output, changed: output !== trimmed };
|
|
49
49
|
} catch {
|
|
50
|
-
return { ok: false, error: "Invalid percent-encoding
|
|
50
|
+
return { ok: false, error: "Invalid percent-encoding: check the input" };
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
function diffSegments(original, encoded) {
|
package/dist/tools/encoding.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ALPHABETS, base32Decode, base32DecodeBytes, base32Encode, base32EncodeBytes, decodeBase64, decodeHtmlEntities, decodeUrl, diffSegments, encodeBase64, encodeHtmlEntities, encodeHtmlEntitiesAll, encodeUrl, isValidBase32 } from '../chunk-
|
|
1
|
+
export { ALPHABETS, base32Decode, base32DecodeBytes, base32Encode, base32EncodeBytes, decodeBase64, decodeHtmlEntities, decodeUrl, diffSegments, encodeBase64, encodeHtmlEntities, encodeHtmlEntitiesAll, encodeUrl, isValidBase32 } from '../chunk-IPR7FSX4.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/media.cjs
CHANGED
|
@@ -124,7 +124,7 @@ function readImageInfo(bytes) {
|
|
|
124
124
|
if (bytes[0] === 255 && bytes[1] === 216) {
|
|
125
125
|
return readJpeg(bytes);
|
|
126
126
|
}
|
|
127
|
-
return { error: "Unrecognized image format
|
|
127
|
+
return { error: "Unrecognized image format. Supported formats: PNG, JPEG, GIF, WebP, BMP" };
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
exports.readImageInfo = readImageInfo;
|
package/dist/tools/media.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { readImageInfo } from '../chunk-
|
|
1
|
+
export { readImageInfo } from '../chunk-N7C52YGL.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/misc.cjs
CHANGED
|
@@ -531,7 +531,7 @@ function getConversionWarnings(from, to) {
|
|
|
531
531
|
warnings.push("Transparency will be lost if the WebP image has an alpha channel");
|
|
532
532
|
}
|
|
533
533
|
if (to === "image/jpeg") {
|
|
534
|
-
warnings.push("JPEG uses lossy compression
|
|
534
|
+
warnings.push("JPEG uses lossy compression: some quality may be reduced");
|
|
535
535
|
}
|
|
536
536
|
return warnings;
|
|
537
537
|
}
|
package/dist/tools/misc.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { COLOR_PRESETS, DATA_TYPES, DEFAULT_CONFIG, DEFAULT_QR_OPTIONS, FORMAT_EXTENSIONS, FORMAT_LABELS, analyzeString, analyzeSvg, calcResizeDimensions, calcSavings, charToCodePoint, codePointToChar, detectFormatFromDataUrl, detectFormatFromFilename, formatBytes, formatLabel, formatSvg, fromUnicodeEscape, generateData, generateMetaHtml, generateQrDataUrl, generateQrSvg, generateSingle, generateSvgFavicon, getConversionWarnings, getDefaultQuality, getDownloadFilename, getSupportedFormats, getSupportedOutputFormats, minifySvg, numberToOrdinal, numberToRoman, numberToWords, optimizeSvg, ordinalWords, parseMetaTags, romanToNumber, sanitizeSvg, svgToDataUrl, toUnicodeEscape, validateOgTags } from '../chunk-
|
|
1
|
+
export { COLOR_PRESETS, DATA_TYPES, DEFAULT_CONFIG, DEFAULT_QR_OPTIONS, FORMAT_EXTENSIONS, FORMAT_LABELS, analyzeString, analyzeSvg, calcResizeDimensions, calcSavings, charToCodePoint, codePointToChar, detectFormatFromDataUrl, detectFormatFromFilename, formatBytes, formatLabel, formatSvg, fromUnicodeEscape, generateData, generateMetaHtml, generateQrDataUrl, generateQrSvg, generateSingle, generateSvgFavicon, getConversionWarnings, getDefaultQuality, getDownloadFilename, getSupportedFormats, getSupportedOutputFormats, minifySvg, numberToOrdinal, numberToRoman, numberToWords, optimizeSvg, ordinalWords, parseMetaTags, romanToNumber, sanitizeSvg, svgToDataUrl, toUnicodeEscape, validateOgTags } from '../chunk-GX7H6TAX.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/units.cjs
CHANGED
|
@@ -21,16 +21,16 @@ function formatValue(value, unit, decimals = 4) {
|
|
|
21
21
|
return `${value.toFixed(decimals)}${unit}`;
|
|
22
22
|
}
|
|
23
23
|
var COMMON_SIZES = [
|
|
24
|
-
{ px: 8, label: "8px
|
|
25
|
-
{ px: 12, label: "12px
|
|
26
|
-
{ px: 14, label: "14px
|
|
27
|
-
{ px: 16, label: "16px
|
|
28
|
-
{ px: 18, label: "18px
|
|
29
|
-
{ px: 20, label: "20px
|
|
30
|
-
{ px: 24, label: "24px
|
|
31
|
-
{ px: 32, label: "32px
|
|
32
|
-
{ px: 48, label: "48px
|
|
33
|
-
{ px: 64, label: "64px
|
|
24
|
+
{ px: 8, label: "8px: Extra small spacing / icon size" },
|
|
25
|
+
{ px: 12, label: "12px: Small text / caption" },
|
|
26
|
+
{ px: 14, label: "14px: Body small / secondary text" },
|
|
27
|
+
{ px: 16, label: "16px: Base font size / body text" },
|
|
28
|
+
{ px: 18, label: "18px: Body large / lead text" },
|
|
29
|
+
{ px: 20, label: "20px: Subheading / large body" },
|
|
30
|
+
{ px: 24, label: "24px: H4 / section title" },
|
|
31
|
+
{ px: 32, label: "32px: H3 / card heading" },
|
|
32
|
+
{ px: 48, label: "48px: H2 / page section heading" },
|
|
33
|
+
{ px: 64, label: "64px: H1 / hero heading" }
|
|
34
34
|
];
|
|
35
35
|
function pxToViewport(px, viewportWidth = 1440, viewportHeight = 900) {
|
|
36
36
|
const vw = parseFloat((px / viewportWidth * 100).toFixed(4));
|
package/dist/tools/units.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_VIEWPORTS, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, compareSemver, convert, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, viewportToPx } from '../chunk-
|
|
1
|
+
export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_VIEWPORTS, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, compareSemver, convert, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, viewportToPx } from '../chunk-QJE743LY.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/package.json
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilix-tech/sdk",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "140+ developer utility tools for Node.js: JSON, encoding, hashing, color, CSS, network and more. Runs locally, no API key required.",
|
|
5
5
|
"author": "Utilix <hello@utilix.tech>",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"homepage": "https://utilix.tech",
|
|
7
|
+
"homepage": "https://www.utilix.tech/docs#node-sdk",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/utilix-tech/utilix-sdk.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/utilix-tech/utilix-sdk/issues"
|
|
14
|
+
},
|
|
8
15
|
"keywords": [
|
|
9
16
|
"developer-tools",
|
|
10
17
|
"utilities",
|
|
@@ -16,6 +23,11 @@
|
|
|
16
23
|
"network",
|
|
17
24
|
"sdk",
|
|
18
25
|
"devtools",
|
|
26
|
+
"typescript",
|
|
27
|
+
"jwt",
|
|
28
|
+
"regex",
|
|
29
|
+
"uuid",
|
|
30
|
+
"api-client",
|
|
19
31
|
"utilix"
|
|
20
32
|
],
|
|
21
33
|
"engines": {
|
|
@@ -115,7 +127,9 @@
|
|
|
115
127
|
"files": [
|
|
116
128
|
"dist",
|
|
117
129
|
"README.md",
|
|
118
|
-
"LICENSE"
|
|
130
|
+
"LICENSE",
|
|
131
|
+
"CHANGELOG.md",
|
|
132
|
+
"SECURITY.md"
|
|
119
133
|
],
|
|
120
134
|
"scripts": {
|
|
121
135
|
"build": "tsup",
|