nhb-toolbox 4.13.4 → 4.13.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/cjs/pluralize/rules.js +11 -12
- package/dist/dts/pluralize/rules.d.ts.map +1 -1
- package/dist/esm/pluralize/rules.js +11 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,10 @@ All notable changes to the package will be documented here.
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## [4.13.3-6] - 2025-07-22
|
|
10
|
+
|
|
11
|
+
- **Reordered** rules for `pluralizer` and fixed other issues.
|
|
12
|
+
|
|
9
13
|
## [4.13.3] - 2025-07-22
|
|
10
14
|
|
|
11
15
|
- **Updated** pluralization/uncountable rules, case restoration method and fixed other bugs in `pluralizer`.
|
|
@@ -61,6 +61,7 @@ exports.irregularRules =
|
|
|
61
61
|
['pickaxe', 'pickaxes'],
|
|
62
62
|
['passerby', 'passersby'],
|
|
63
63
|
['honey', 'honeys'],
|
|
64
|
+
['virus', 'viruses'],
|
|
64
65
|
// Words ending in with a consonant and `o`.
|
|
65
66
|
['echo', 'echoes'],
|
|
66
67
|
['dingo', 'dingoes'],
|
|
@@ -82,14 +83,11 @@ exports.irregularRules =
|
|
|
82
83
|
/** Plural rules and replacements */
|
|
83
84
|
exports.pluralRules =
|
|
84
85
|
/* @__PURE__ */ Object.freeze([
|
|
86
|
+
[/s$/i, 's'],
|
|
85
87
|
[/(\P{ASCII})$/u, '$1'],
|
|
86
88
|
[/(pe)(rson|ople)$/i, '$1ople'],
|
|
87
89
|
[/(child)(?:ren)?$/i, '$1ren'],
|
|
88
90
|
[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],
|
|
89
|
-
[
|
|
90
|
-
/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,
|
|
91
|
-
'$1i',
|
|
92
|
-
],
|
|
93
91
|
[/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],
|
|
94
92
|
[
|
|
95
93
|
/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,
|
|
@@ -115,8 +113,10 @@ exports.pluralRules =
|
|
|
115
113
|
[/(quiz)$/i, '$1zes'],
|
|
116
114
|
[/m[ae]n$/i, 'men'],
|
|
117
115
|
[/eaux$/i, '$0'],
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
[
|
|
117
|
+
/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,
|
|
118
|
+
'$1i',
|
|
119
|
+
],
|
|
120
120
|
]);
|
|
121
121
|
/** Uncountable constants */
|
|
122
122
|
exports.uncountables = Object.freeze(new Set([
|
|
@@ -376,6 +376,7 @@ exports.uncountables = Object.freeze(new Set([
|
|
|
376
376
|
/** Singular rules and replacements */
|
|
377
377
|
exports.singularRules =
|
|
378
378
|
/* @__PURE__ */ Object.freeze([
|
|
379
|
+
[/s$/i, ''],
|
|
379
380
|
[/(\P{ASCII})$/u, '$1'],
|
|
380
381
|
[/(pe)(rson|ople)$/i, '$1rson'],
|
|
381
382
|
[/(child)ren$/i, '$1'],
|
|
@@ -392,10 +393,6 @@ exports.singularRules =
|
|
|
392
393
|
/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,
|
|
393
394
|
'$1um',
|
|
394
395
|
],
|
|
395
|
-
[
|
|
396
|
-
/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,
|
|
397
|
-
'$1us',
|
|
398
|
-
],
|
|
399
396
|
[/(test)(?:is|es)$/i, '$1is'],
|
|
400
397
|
[/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],
|
|
401
398
|
[
|
|
@@ -438,6 +435,8 @@ exports.singularRules =
|
|
|
438
435
|
[/(^analy)ses$/i, '$1sis'],
|
|
439
436
|
[/([ti])a$/i, '$1um'],
|
|
440
437
|
[/(n)ews$/i, '$1ews'],
|
|
441
|
-
|
|
442
|
-
|
|
438
|
+
[
|
|
439
|
+
/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,
|
|
440
|
+
'$1us',
|
|
441
|
+
],
|
|
443
442
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../src/pluralize/rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,uCAAuC;AACvC,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../src/pluralize/rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,uCAAuC;AACvC,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,EAgFnD,CAAC;AAEJ,oCAAoC;AACpC,eAAO,MAAM,WAAW,EAAE,SAAS,aAAa,EAoC7C,CAAC;AAEJ,4BAA4B;AAC5B,eAAO,MAAM,YAAY,gCAiQxB,CAAC;AAEF,sCAAsC;AACtC,eAAO,MAAM,aAAa,EAAE,SAAS,aAAa,EAiE/C,CAAC"}
|
|
@@ -58,6 +58,7 @@ export const irregularRules =
|
|
|
58
58
|
['pickaxe', 'pickaxes'],
|
|
59
59
|
['passerby', 'passersby'],
|
|
60
60
|
['honey', 'honeys'],
|
|
61
|
+
['virus', 'viruses'],
|
|
61
62
|
// Words ending in with a consonant and `o`.
|
|
62
63
|
['echo', 'echoes'],
|
|
63
64
|
['dingo', 'dingoes'],
|
|
@@ -79,14 +80,11 @@ export const irregularRules =
|
|
|
79
80
|
/** Plural rules and replacements */
|
|
80
81
|
export const pluralRules =
|
|
81
82
|
/* @__PURE__ */ Object.freeze([
|
|
83
|
+
[/s$/i, 's'],
|
|
82
84
|
[/(\P{ASCII})$/u, '$1'],
|
|
83
85
|
[/(pe)(rson|ople)$/i, '$1ople'],
|
|
84
86
|
[/(child)(?:ren)?$/i, '$1ren'],
|
|
85
87
|
[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],
|
|
86
|
-
[
|
|
87
|
-
/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,
|
|
88
|
-
'$1i',
|
|
89
|
-
],
|
|
90
88
|
[/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],
|
|
91
89
|
[
|
|
92
90
|
/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,
|
|
@@ -112,8 +110,10 @@ export const pluralRules =
|
|
|
112
110
|
[/(quiz)$/i, '$1zes'],
|
|
113
111
|
[/m[ae]n$/i, 'men'],
|
|
114
112
|
[/eaux$/i, '$0'],
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
[
|
|
114
|
+
/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,
|
|
115
|
+
'$1i',
|
|
116
|
+
],
|
|
117
117
|
]);
|
|
118
118
|
/** Uncountable constants */
|
|
119
119
|
export const uncountables = /* @__PURE__ */ Object.freeze(new Set([
|
|
@@ -373,6 +373,7 @@ export const uncountables = /* @__PURE__ */ Object.freeze(new Set([
|
|
|
373
373
|
/** Singular rules and replacements */
|
|
374
374
|
export const singularRules =
|
|
375
375
|
/* @__PURE__ */ Object.freeze([
|
|
376
|
+
[/s$/i, ''],
|
|
376
377
|
[/(\P{ASCII})$/u, '$1'],
|
|
377
378
|
[/(pe)(rson|ople)$/i, '$1rson'],
|
|
378
379
|
[/(child)ren$/i, '$1'],
|
|
@@ -389,10 +390,6 @@ export const singularRules =
|
|
|
389
390
|
/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,
|
|
390
391
|
'$1um',
|
|
391
392
|
],
|
|
392
|
-
[
|
|
393
|
-
/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,
|
|
394
|
-
'$1us',
|
|
395
|
-
],
|
|
396
393
|
[/(test)(?:is|es)$/i, '$1is'],
|
|
397
394
|
[/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],
|
|
398
395
|
[
|
|
@@ -435,6 +432,8 @@ export const singularRules =
|
|
|
435
432
|
[/(^analy)ses$/i, '$1sis'],
|
|
436
433
|
[/([ti])a$/i, '$1um'],
|
|
437
434
|
[/(n)ews$/i, '$1ews'],
|
|
438
|
-
|
|
439
|
-
|
|
435
|
+
[
|
|
436
|
+
/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,
|
|
437
|
+
'$1us',
|
|
438
|
+
],
|
|
440
439
|
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nhb-toolbox",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.6",
|
|
4
4
|
"description": "A versatile collection of smart, efficient, and reusable utility functions and classes for everyday development needs.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|