@visulima/fmt 2.0.0-alpha.1 → 2.0.0-alpha.10

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 CHANGED
@@ -1,3 +1,105 @@
1
+ ## @visulima/fmt [2.0.0-alpha.10](https://github.com/visulima/visulima/compare/@visulima/fmt@2.0.0-alpha.9...@visulima/fmt@2.0.0-alpha.10) (2026-04-22)
2
+
3
+ ### Bug Fixes
4
+
5
+ * Remove JSR configuration generation script and generated jsr.json files ([#616](https://github.com/visulima/visulima/issues/616)) ([533744b](https://github.com/visulima/visulima/commit/533744b103b74896941db5b727173e617a27a63b))
6
+
7
+ ### Miscellaneous Chores
8
+
9
+ * bump engines.node to ^22.14.0 || >=24.10.0 ([c3d0931](https://github.com/visulima/visulima/commit/c3d0931d1504e4f21ebf50ea680cfa7ce4ba15ce))
10
+ * fixed jsr.json ([5d85e51](https://github.com/visulima/visulima/commit/5d85e5179de38e284ec433b14d77c71a1619c8d6))
11
+ * **fmt:** apply pending changes ([587102a](https://github.com/visulima/visulima/commit/587102a3ebdfe4aaf965f4277c1bf7a9f96f6084))
12
+
13
+ ## @visulima/fmt [2.0.0-alpha.9](https://github.com/visulima/visulima/compare/@visulima/fmt@2.0.0-alpha.8...@visulima/fmt@2.0.0-alpha.9) (2026-04-15)
14
+
15
+ ### Bug Fixes
16
+
17
+ * **fmt:** export CssObject type and type previousCss explicitly ([e1e7e53](https://github.com/visulima/visulima/commit/e1e7e5357c9920945d3cbe49f073291f1f104208))
18
+ * **terminal:** resolve eslint and formatting issues ([8f30389](https://github.com/visulima/visulima/commit/8f30389deb9ff81e7afce0aa064ef11fcb179f23))
19
+
20
+ ## @visulima/fmt [2.0.0-alpha.8](https://github.com/visulima/visulima/compare/@visulima/fmt@2.0.0-alpha.7...@visulima/fmt@2.0.0-alpha.8) (2026-04-08)
21
+
22
+ ### Bug Fixes
23
+
24
+ * **fmt:** resolve eslint errors ([45181b2](https://github.com/visulima/visulima/commit/45181b24520bcb2ee766497e677f7fcd6f8182d8))
25
+
26
+ ### Miscellaneous Chores
27
+
28
+ * **fmt:** add tsconfig.eslint.json for type-aware linting ([d47f7c0](https://github.com/visulima/visulima/commit/d47f7c0068c69d0f9de86c2d6653ba5d3b55ab48))
29
+ * **fmt:** apply prettier formatting ([1e9c241](https://github.com/visulima/visulima/commit/1e9c241d498a92740cb9d6b5ff040d200738669a))
30
+ * **fmt:** migrate .prettierrc.cjs to prettier.config.js ([c699d91](https://github.com/visulima/visulima/commit/c699d916dd5c9a00bcec10f2ae073774d932cb3d))
31
+ * **terminal:** remove empty dependency objects from package.json ([562c704](https://github.com/visulima/visulima/commit/562c704e5d90aa2d13eae942ebbdcfeb787c2b46))
32
+
33
+ ## @visulima/fmt [2.0.0-alpha.7](https://github.com/visulima/visulima/compare/@visulima/fmt@2.0.0-alpha.6...@visulima/fmt@2.0.0-alpha.7) (2026-03-26)
34
+
35
+ ### Features
36
+
37
+ * **web:** auto-generate packages page from workspace metadata ([623e520](https://github.com/visulima/visulima/commit/623e5207693a7fe720f5f2f179593a3654c880e3))
38
+
39
+ ### Miscellaneous Chores
40
+
41
+ * update homepage URLs to visulima.com/packages/ format ([be42968](https://github.com/visulima/visulima/commit/be42968129df85fb074224435e33135ff44cab91))
42
+
43
+ ## @visulima/fmt [2.0.0-alpha.6](https://github.com/visulima/visulima/compare/@visulima/fmt@2.0.0-alpha.5...@visulima/fmt@2.0.0-alpha.6) (2026-03-26)
44
+
45
+ ### Bug Fixes
46
+
47
+ * **web:** improve build setup with incremental stats caching and prod install ([fe33e75](https://github.com/visulima/visulima/commit/fe33e75827586779b4b3a0c6d57b39f889ee6207))
48
+
49
+ ### Miscellaneous Chores
50
+
51
+ * **fmt:** migrate deps to pnpm catalogs ([92bf4f0](https://github.com/visulima/visulima/commit/92bf4f07f6e64923f5739bd4cfe0d84349f17752))
52
+ * **fmt:** update dependencies ([3e7b109](https://github.com/visulima/visulima/commit/3e7b1098a0403211311e49bc9e22c7523c39cfc7))
53
+ * visulima website ([#591](https://github.com/visulima/visulima/issues/591)) ([59ab2e2](https://github.com/visulima/visulima/commit/59ab2e2befb03e51cd2088956f83d9b87de6d033))
54
+
55
+ ### Code Refactoring
56
+
57
+ * **docs:** migrate Nextra components to fumadocs-ui, remove Nextra stripping ([484878f](https://github.com/visulima/visulima/commit/484878f01879363ef5e9a0282904dc4627d6060c))
58
+
59
+ ## @visulima/fmt [2.0.0-alpha.5](https://github.com/visulima/visulima/compare/@visulima/fmt@2.0.0-alpha.4...@visulima/fmt@2.0.0-alpha.5) (2026-03-06)
60
+
61
+ ### Bug Fixes
62
+
63
+ * **fmt:** update packem to 2.0.0-alpha.54 ([78a1680](https://github.com/visulima/visulima/commit/78a1680cde1175bd5867b21bda9b732a9acdc6aa))
64
+
65
+ ### Documentation
66
+
67
+ * **bytes,deep-clone,ansi,fmt,find-cache-dir:** add comprehensive Fumadocs documentation ([dfe0116](https://github.com/visulima/visulima/commit/dfe0116ebd26fe38f94f77b8ed4dadc3ff45ba91))
68
+
69
+ ### Miscellaneous Chores
70
+
71
+ * **fmt:** update dependencies ([4a8264c](https://github.com/visulima/visulima/commit/4a8264c88fb9dbb3c05044a1cb9e739e47b6d179))
72
+ * **fmt:** update dependencies ([17eded3](https://github.com/visulima/visulima/commit/17eded3dc12040ecfb92ad675f99d5eccee74245))
73
+ * **terminal:** update dependencies ([a5bb91a](https://github.com/visulima/visulima/commit/a5bb91a66f2be2ade485d586156a54c347a23cc9))
74
+ * update lock file maintenance ([d83e716](https://github.com/visulima/visulima/commit/d83e71697b75d24704185b66bb521a934d2db02d))
75
+ * year update ([47f4105](https://github.com/visulima/visulima/commit/47f410596ce7190cfea36a073db32e0cec50bbcd))
76
+
77
+ ## @visulima/fmt [2.0.0-alpha.4](https://github.com/visulima/visulima/compare/@visulima/fmt@2.0.0-alpha.3...@visulima/fmt@2.0.0-alpha.4) (2025-12-27)
78
+
79
+ ### Bug Fixes
80
+
81
+ * **fmt:** update package files ([d8a3655](https://github.com/visulima/visulima/commit/d8a36557d4a7ad72645d8ad96118ee0bd09ddd39))
82
+
83
+ ### Miscellaneous Chores
84
+
85
+ * fixed project.json names and schema path ([964722f](https://github.com/visulima/visulima/commit/964722f691db205c7edb9aa6db29e849a647500b))
86
+
87
+ ## @visulima/fmt [2.0.0-alpha.3](https://github.com/visulima/visulima/compare/@visulima/fmt@2.0.0-alpha.2...@visulima/fmt@2.0.0-alpha.3) (2025-12-11)
88
+
89
+ ### Bug Fixes
90
+
91
+ * update package OG images across multiple packages ([f08e4dd](https://github.com/visulima/visulima/commit/f08e4dd2b105ccb29c8412020a9c2be36d6c1e9e))
92
+
93
+ ## @visulima/fmt [2.0.0-alpha.2](https://github.com/visulima/visulima/compare/@visulima/fmt@2.0.0-alpha.1...@visulima/fmt@2.0.0-alpha.2) (2025-12-06)
94
+
95
+ ### Bug Fixes
96
+
97
+ * add new package image, fixed readme rendering on npm, fixed building of packages ([b790ba2](https://github.com/visulima/visulima/commit/b790ba253ea07fef83528fd822a678facf021b5f))
98
+
99
+ ### Miscellaneous Chores
100
+
101
+ * update @anolilab/semantic-release-pnpm and @anolilab/semantic-release-preset to versions 3.2.2 and 12.1.2 across multiple package.json files for improved compatibility ([3921626](https://github.com/visulima/visulima/commit/3921626141fe5da398749bf0ba675f1596f18afb))
102
+
1
103
  ## @visulima/fmt [2.0.0-alpha.1](https://github.com/visulima/visulima/compare/@visulima/fmt@1.1.21...@visulima/fmt@2.0.0-alpha.1) (2025-12-04)
2
104
 
3
105
  ### ⚠ BREAKING CHANGES
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 visulima
3
+ Copyright (c) 2026 visulima
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,15 +1,24 @@
1
- <div align="center">
2
- <h3>Visulima fmt (util.format)</h3>
3
- <p>
4
- Util.format-like unescaped string formatting utility based on <a href="https://github.com/pinojs/quick-format-unescaped">quick-format-unescaped</a>.
5
- </p>
6
- </div>
1
+ <!-- START_PACKAGE_OG_IMAGE_PLACEHOLDER -->
2
+
3
+ <a href="https://www.anolilab.com/open-source" align="center">
4
+
5
+ <img src="__assets__/package-og.svg" alt="fmt" />
6
+
7
+ </a>
8
+
9
+ <h3 align="center">Util.format-like string formatting utility.</h3>
10
+
11
+ <!-- END_PACKAGE_OG_IMAGE_PLACEHOLDER -->
7
12
 
8
13
  <br />
9
14
 
10
15
  <div align="center">
11
16
 
12
- [![typescript-image]][typescript-url] [![npm-image]][npm-url] [![license-image]][license-url]
17
+ [![typescript-image][typescript-badge]][typescript-url]
18
+ [![mit licence][license-badge]][license]
19
+ [![npm downloads][npm-downloads-badge]][npm-downloads]
20
+ [![Chat][chat-badge]][chat]
21
+ [![PRs Welcome][prs-welcome-badge]][prs-welcome]
13
22
 
14
23
  </div>
15
24
 
@@ -127,14 +136,23 @@ If you would like to help take a look at the [list of issues](https://github.com
127
136
  - [Daniel Bannert](https://github.com/prisis)
128
137
  - [All Contributors](https://github.com/visulima/visulima/graphs/contributors)
129
138
 
139
+ ## Made with ❤️ at Anolilab
140
+
141
+ This is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Anolilab](https://www.anolilab.com/open-source) is a Development and AI Studio. Contact us at [hello@anolilab.com](mailto:hello@anolilab.com) if you need any help with these technologies or just want to say hi!
142
+
130
143
  ## License
131
144
 
132
- The visulima fmt is open-sourced software licensed under the [MIT][license-url]
145
+ The visulima fmt is open-sourced software licensed under the [MIT][license]
133
146
 
134
- [typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
147
+ <!-- badges -->
135
148
 
136
- [typescript-url]: https://www.typescriptlang.org/ "TypeScript" "typescript"
137
- [license-image]: https://img.shields.io/npm/l/@visulima/fmt?color=blueviolet&style=for-the-badge
138
- [license-url]: LICENSE.md "license"
139
- [npm-image]: https://img.shields.io/npm/v/@visulima/fmt/latest.svg?style=for-the-badge&logo=npm
140
- [npm-url]: https://www.npmjs.com/package/@visulima/fmt/v/latest "npm"
149
+ [license-badge]: https://img.shields.io/npm/l/@visulima/fmt?style=for-the-badge
150
+ [license]: https://github.com/visulima/visulima/blob/main/LICENSE
151
+ [npm-downloads-badge]: https://img.shields.io/npm/dm/@visulima/fmt?style=for-the-badge
152
+ [npm-downloads]: https://www.npmjs.com/package/@visulima/fmt
153
+ [prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge
154
+ [prs-welcome]: https://github.com/visulima/visulima/blob/main/.github/CONTRIBUTING.md
155
+ [chat-badge]: https://img.shields.io/discord/932323359193186354.svg?style=for-the-badge
156
+ [chat]: https://discord.gg/TtFJY8xkFK
157
+ [typescript-badge]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
158
+ [typescript-url]: https://www.typescriptlang.org/
package/dist/index.cjs CHANGED
@@ -167,7 +167,7 @@ const getDefaultCss = () => {
167
167
  textDecorationLine: []
168
168
  };
169
169
  };
170
- const SPACE_PATTERN = /\s+/g;
170
+ const SPACE_PATTERN = /\s+/;
171
171
  const parseCssColor = (colorString) => {
172
172
  if (colorKeywords.has(colorString)) {
173
173
  colorString = colorKeywords.get(colorString);
@@ -233,10 +233,10 @@ const parseCss = (cssString) => {
233
233
  let currentPart = "";
234
234
  for (const c of cssString) {
235
235
  if (c === "(") {
236
- parenthesesDepth++;
236
+ parenthesesDepth += 1;
237
237
  } else if (parenthesesDepth > 0) {
238
238
  if (c === ")") {
239
- parenthesesDepth--;
239
+ parenthesesDepth -= 1;
240
240
  }
241
241
  } else if (inValue) {
242
242
  if (c === ";") {
@@ -326,7 +326,7 @@ const parseCss = (cssString) => {
326
326
  }
327
327
  return css;
328
328
  };
329
- const cssToAnsi = (css, previousCss = null) => {
329
+ const cssToAnsi = (css, previousCss) => {
330
330
  previousCss = previousCss ?? getDefaultCss();
331
331
  let ansi = "";
332
332
  if (!colorEquals(css.backgroundColor, previousCss.backgroundColor)) {
@@ -369,14 +369,14 @@ const cssToAnsi = (css, previousCss = null) => {
369
369
  default: {
370
370
  if (Array.isArray(css.backgroundColor)) {
371
371
  const { 0: r, 1: g, 2: b } = css.backgroundColor;
372
- ansi += `\x1B[48;2;${r};${g};${b}m`;
372
+ ansi += `\x1B[48;2;${String(r)};${String(g)};${String(b)}m`;
373
373
  } else {
374
374
  const parsed = parseCssColor(css.backgroundColor);
375
375
  if (parsed === null) {
376
376
  ansi += "\x1B[49m";
377
377
  } else {
378
378
  const { 0: r, 1: g, 2: b } = parsed;
379
- ansi += `\x1B[48;2;${r};${g};${b}m`;
379
+ ansi += `\x1B[48;2;${String(r)};${String(g)};${String(b)}m`;
380
380
  }
381
381
  }
382
382
  }
@@ -423,14 +423,14 @@ const cssToAnsi = (css, previousCss = null) => {
423
423
  default: {
424
424
  if (Array.isArray(css.color)) {
425
425
  const { 0: r, 1: g, 2: b } = css.color;
426
- ansi += `\x1B[38;2;${r};${g};${b}m`;
426
+ ansi += `\x1B[38;2;${String(r)};${String(g)};${String(b)}m`;
427
427
  } else {
428
428
  const parsed = parseCssColor(css.color);
429
429
  if (parsed === null) {
430
430
  ansi += "\x1B[39m";
431
431
  } else {
432
432
  const { 0: r, 1: g, 2: b } = parsed;
433
- ansi += `\x1B[38;2;${r};${g};${b}m`;
433
+ ansi += `\x1B[38;2;${String(r)};${String(g)};${String(b)}m`;
434
434
  }
435
435
  }
436
436
  }
@@ -448,7 +448,7 @@ const cssToAnsi = (css, previousCss = null) => {
448
448
  ansi += "\x1B[59m";
449
449
  } else {
450
450
  const { 0: r, 1: g, 2: b } = css.textDecorationColor;
451
- ansi += `\x1B[58;2;${r};${g};${b}m`;
451
+ ansi += `\x1B[58;2;${String(r)};${String(g)};${String(b)}m`;
452
452
  }
453
453
  }
454
454
  if (css.textDecorationLine.includes("line-through") !== previousCss.textDecorationLine.includes("line-through")) {
@@ -492,7 +492,7 @@ const format = (fmt, arguments_ = [], options = {}) => {
492
492
  }
493
493
  const objects = Array.from({ length: argumentsLength });
494
494
  objects[0] = stringify(fmt);
495
- for (let index = 1; index < argumentsLength; index++) {
495
+ for (let index = 1; index < argumentsLength; index += 1) {
496
496
  objects[index] = stringify(arguments_[index - offset]);
497
497
  }
498
498
  return objects.join(" ");
@@ -504,13 +504,13 @@ const format = (fmt, arguments_ = [], options = {}) => {
504
504
  let a = 1 - offset;
505
505
  let lastPosition = -1;
506
506
  let usedStyle = false;
507
- let previousCss = null;
507
+ let previousCss;
508
508
  for (let index = 0; index < fmt.length; ) {
509
509
  if (fmt.codePointAt(index) === CHAR_PERCENT && index + 1 < fmt.length) {
510
510
  lastPosition = lastPosition > -1 ? lastPosition : 0;
511
511
  const c = fmt.codePointAt(index + 1);
512
512
  if (c === void 0) {
513
- ++a;
513
+ a += 1;
514
514
  break;
515
515
  }
516
516
  switch (c) {
@@ -527,7 +527,7 @@ const format = (fmt, arguments_ = [], options = {}) => {
527
527
  }
528
528
  }
529
529
  lastPosition = index + 2;
530
- index++;
530
+ index += 1;
531
531
  break;
532
532
  }
533
533
  case CHAR_d:
@@ -540,7 +540,7 @@ const format = (fmt, arguments_ = [], options = {}) => {
540
540
  }
541
541
  result += Number(arguments_[a]).toString();
542
542
  lastPosition = index + 2;
543
- index++;
543
+ index += 1;
544
544
  break;
545
545
  }
546
546
  case CHAR_i: {
@@ -552,7 +552,7 @@ const format = (fmt, arguments_ = [], options = {}) => {
552
552
  }
553
553
  result += Math.floor(Number(arguments_[a])).toString();
554
554
  lastPosition = index + 2;
555
- index++;
555
+ index += 1;
556
556
  break;
557
557
  }
558
558
  case CHAR_j:
@@ -578,7 +578,7 @@ const format = (fmt, arguments_ = [], options = {}) => {
578
578
  }
579
579
  result += stringify(temporaryArgument);
580
580
  lastPosition = index + 2;
581
- index++;
581
+ index += 1;
582
582
  break;
583
583
  }
584
584
  case CHAR_PERCENT: {
@@ -587,8 +587,8 @@ const format = (fmt, arguments_ = [], options = {}) => {
587
587
  }
588
588
  result += "%";
589
589
  lastPosition = index + 2;
590
- index++;
591
- a--;
590
+ index += 1;
591
+ a -= 1;
592
592
  break;
593
593
  }
594
594
  case CHAR_s: {
@@ -600,7 +600,7 @@ const format = (fmt, arguments_ = [], options = {}) => {
600
600
  }
601
601
  result += typeof arguments_[a] === "object" ? stringify(arguments_[a]) : String(arguments_[a]);
602
602
  lastPosition = index + 2;
603
- index++;
603
+ index += 1;
604
604
  break;
605
605
  }
606
606
  default: {
@@ -610,13 +610,13 @@ const format = (fmt, arguments_ = [], options = {}) => {
610
610
  }
611
611
  result += options.formatters[c](arguments_[a]);
612
612
  lastPosition = index + 2;
613
- index++;
613
+ index += 1;
614
614
  }
615
615
  }
616
616
  }
617
- ++a;
617
+ a += 1;
618
618
  }
619
- ++index;
619
+ index += 1;
620
620
  }
621
621
  if (lastPosition === -1) {
622
622
  return fmt;
package/dist/index.mjs CHANGED
@@ -163,7 +163,7 @@ const getDefaultCss = () => {
163
163
  textDecorationLine: []
164
164
  };
165
165
  };
166
- const SPACE_PATTERN = /\s+/g;
166
+ const SPACE_PATTERN = /\s+/;
167
167
  const parseCssColor = (colorString) => {
168
168
  if (colorKeywords.has(colorString)) {
169
169
  colorString = colorKeywords.get(colorString);
@@ -229,10 +229,10 @@ const parseCss = (cssString) => {
229
229
  let currentPart = "";
230
230
  for (const c of cssString) {
231
231
  if (c === "(") {
232
- parenthesesDepth++;
232
+ parenthesesDepth += 1;
233
233
  } else if (parenthesesDepth > 0) {
234
234
  if (c === ")") {
235
- parenthesesDepth--;
235
+ parenthesesDepth -= 1;
236
236
  }
237
237
  } else if (inValue) {
238
238
  if (c === ";") {
@@ -322,7 +322,7 @@ const parseCss = (cssString) => {
322
322
  }
323
323
  return css;
324
324
  };
325
- const cssToAnsi = (css, previousCss = null) => {
325
+ const cssToAnsi = (css, previousCss) => {
326
326
  previousCss = previousCss ?? getDefaultCss();
327
327
  let ansi = "";
328
328
  if (!colorEquals(css.backgroundColor, previousCss.backgroundColor)) {
@@ -365,14 +365,14 @@ const cssToAnsi = (css, previousCss = null) => {
365
365
  default: {
366
366
  if (Array.isArray(css.backgroundColor)) {
367
367
  const { 0: r, 1: g, 2: b } = css.backgroundColor;
368
- ansi += `\x1B[48;2;${r};${g};${b}m`;
368
+ ansi += `\x1B[48;2;${String(r)};${String(g)};${String(b)}m`;
369
369
  } else {
370
370
  const parsed = parseCssColor(css.backgroundColor);
371
371
  if (parsed === null) {
372
372
  ansi += "\x1B[49m";
373
373
  } else {
374
374
  const { 0: r, 1: g, 2: b } = parsed;
375
- ansi += `\x1B[48;2;${r};${g};${b}m`;
375
+ ansi += `\x1B[48;2;${String(r)};${String(g)};${String(b)}m`;
376
376
  }
377
377
  }
378
378
  }
@@ -419,14 +419,14 @@ const cssToAnsi = (css, previousCss = null) => {
419
419
  default: {
420
420
  if (Array.isArray(css.color)) {
421
421
  const { 0: r, 1: g, 2: b } = css.color;
422
- ansi += `\x1B[38;2;${r};${g};${b}m`;
422
+ ansi += `\x1B[38;2;${String(r)};${String(g)};${String(b)}m`;
423
423
  } else {
424
424
  const parsed = parseCssColor(css.color);
425
425
  if (parsed === null) {
426
426
  ansi += "\x1B[39m";
427
427
  } else {
428
428
  const { 0: r, 1: g, 2: b } = parsed;
429
- ansi += `\x1B[38;2;${r};${g};${b}m`;
429
+ ansi += `\x1B[38;2;${String(r)};${String(g)};${String(b)}m`;
430
430
  }
431
431
  }
432
432
  }
@@ -444,7 +444,7 @@ const cssToAnsi = (css, previousCss = null) => {
444
444
  ansi += "\x1B[59m";
445
445
  } else {
446
446
  const { 0: r, 1: g, 2: b } = css.textDecorationColor;
447
- ansi += `\x1B[58;2;${r};${g};${b}m`;
447
+ ansi += `\x1B[58;2;${String(r)};${String(g)};${String(b)}m`;
448
448
  }
449
449
  }
450
450
  if (css.textDecorationLine.includes("line-through") !== previousCss.textDecorationLine.includes("line-through")) {
@@ -488,7 +488,7 @@ const format = (fmt, arguments_ = [], options = {}) => {
488
488
  }
489
489
  const objects = Array.from({ length: argumentsLength });
490
490
  objects[0] = stringify(fmt);
491
- for (let index = 1; index < argumentsLength; index++) {
491
+ for (let index = 1; index < argumentsLength; index += 1) {
492
492
  objects[index] = stringify(arguments_[index - offset]);
493
493
  }
494
494
  return objects.join(" ");
@@ -500,13 +500,13 @@ const format = (fmt, arguments_ = [], options = {}) => {
500
500
  let a = 1 - offset;
501
501
  let lastPosition = -1;
502
502
  let usedStyle = false;
503
- let previousCss = null;
503
+ let previousCss;
504
504
  for (let index = 0; index < fmt.length; ) {
505
505
  if (fmt.codePointAt(index) === CHAR_PERCENT && index + 1 < fmt.length) {
506
506
  lastPosition = lastPosition > -1 ? lastPosition : 0;
507
507
  const c = fmt.codePointAt(index + 1);
508
508
  if (c === void 0) {
509
- ++a;
509
+ a += 1;
510
510
  break;
511
511
  }
512
512
  switch (c) {
@@ -523,7 +523,7 @@ const format = (fmt, arguments_ = [], options = {}) => {
523
523
  }
524
524
  }
525
525
  lastPosition = index + 2;
526
- index++;
526
+ index += 1;
527
527
  break;
528
528
  }
529
529
  case CHAR_d:
@@ -536,7 +536,7 @@ const format = (fmt, arguments_ = [], options = {}) => {
536
536
  }
537
537
  result += Number(arguments_[a]).toString();
538
538
  lastPosition = index + 2;
539
- index++;
539
+ index += 1;
540
540
  break;
541
541
  }
542
542
  case CHAR_i: {
@@ -548,7 +548,7 @@ const format = (fmt, arguments_ = [], options = {}) => {
548
548
  }
549
549
  result += Math.floor(Number(arguments_[a])).toString();
550
550
  lastPosition = index + 2;
551
- index++;
551
+ index += 1;
552
552
  break;
553
553
  }
554
554
  case CHAR_j:
@@ -574,7 +574,7 @@ const format = (fmt, arguments_ = [], options = {}) => {
574
574
  }
575
575
  result += stringify(temporaryArgument);
576
576
  lastPosition = index + 2;
577
- index++;
577
+ index += 1;
578
578
  break;
579
579
  }
580
580
  case CHAR_PERCENT: {
@@ -583,8 +583,8 @@ const format = (fmt, arguments_ = [], options = {}) => {
583
583
  }
584
584
  result += "%";
585
585
  lastPosition = index + 2;
586
- index++;
587
- a--;
586
+ index += 1;
587
+ a -= 1;
588
588
  break;
589
589
  }
590
590
  case CHAR_s: {
@@ -596,7 +596,7 @@ const format = (fmt, arguments_ = [], options = {}) => {
596
596
  }
597
597
  result += typeof arguments_[a] === "object" ? stringify(arguments_[a]) : String(arguments_[a]);
598
598
  lastPosition = index + 2;
599
- index++;
599
+ index += 1;
600
600
  break;
601
601
  }
602
602
  default: {
@@ -606,13 +606,13 @@ const format = (fmt, arguments_ = [], options = {}) => {
606
606
  }
607
607
  result += options.formatters[c](arguments_[a]);
608
608
  lastPosition = index + 2;
609
- index++;
609
+ index += 1;
610
610
  }
611
611
  }
612
612
  }
613
- ++a;
613
+ a += 1;
614
614
  }
615
- ++index;
615
+ index += 1;
616
616
  }
617
617
  if (lastPosition === -1) {
618
618
  return fmt;
@@ -8,5 +8,5 @@ type CssObject = {
8
8
  textDecorationLine: string[];
9
9
  };
10
10
  export declare const parseCss: (cssString: string) => CssObject;
11
- export declare const cssToAnsi: (css: CssObject, previousCss?: CssObject | null) => string;
12
- export {};
11
+ export declare const cssToAnsi: (css: CssObject, previousCss?: CssObject) => string;
12
+ export type { CssObject };
@@ -8,5 +8,5 @@ type CssObject = {
8
8
  textDecorationLine: string[];
9
9
  };
10
10
  export declare const parseCss: (cssString: string) => CssObject;
11
- export declare const cssToAnsi: (css: CssObject, previousCss?: CssObject | null) => string;
12
- export {};
11
+ export declare const cssToAnsi: (css: CssObject, previousCss?: CssObject) => string;
12
+ export type { CssObject };
@@ -8,5 +8,5 @@ type CssObject = {
8
8
  textDecorationLine: string[];
9
9
  };
10
10
  export declare const parseCss: (cssString: string) => CssObject;
11
- export declare const cssToAnsi: (css: CssObject, previousCss?: CssObject | null) => string;
12
- export {};
11
+ export declare const cssToAnsi: (css: CssObject, previousCss?: CssObject) => string;
12
+ export type { CssObject };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/fmt",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.10",
4
4
  "description": "Util.format-like string formatting utility.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -16,7 +16,7 @@
16
16
  "util.format",
17
17
  "visulima"
18
18
  ],
19
- "homepage": "https://www.visulima.com/docs/package/fmt",
19
+ "homepage": "https://visulima.com/packages/fmt/",
20
20
  "bugs": {
21
21
  "url": "https://github.com/visulima/visulima/issues"
22
22
  },
@@ -71,7 +71,7 @@
71
71
  "LICENSE.md"
72
72
  ],
73
73
  "engines": {
74
- "node": ">=22.13 <=25.x"
74
+ "node": "^22.14.0 || >=24.10.0"
75
75
  },
76
76
  "os": [
77
77
  "darwin",