@fibery/pluralize 1.0.2 → 1.1.0

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.
@@ -88,7 +88,14 @@ function replace(word, rule) {
88
88
  */
89
89
  function sanitizeWord(token, word, rules) {
90
90
  // Empty string or doesn't need fixing.
91
- if (!token.length || Object.keys(uncountables).some((key) => token.includes(key))) {
91
+ if (!token.length) {
92
+ return word;
93
+ }
94
+ if (Object.hasOwn(uncountables, token)) {
95
+ return word;
96
+ }
97
+ const words = token.split(/\s+/);
98
+ if (words.length > 1 && words.some((w) => Object.hasOwn(uncountables, w))) {
92
99
  return word;
93
100
  }
94
101
  let len = rules.length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fibery/pluralize",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "files": [
@@ -22,8 +22,8 @@
22
22
  "jest": "30.2.0",
23
23
  "jest-junit": "16.0.0",
24
24
  "typescript": "5.9.3",
25
- "@fibery/babel-preset": "7.4.1",
26
- "@fibery/eslint-config": "8.6.2"
25
+ "@fibery/eslint-config": "9.0.0",
26
+ "@fibery/babel-preset": "7.4.1"
27
27
  },
28
28
  "jest": {
29
29
  "testEnvironment": "jsdom",
@@ -39,8 +39,7 @@
39
39
  "cobertura"
40
40
  ],
41
41
  "moduleNameMapper": {
42
- "\\.(css)$": "<rootDir>/src/__mocks__/styleMock.js",
43
- "createInlineTheme\\.js$": "<rootDir>/src/__mocks__/createInlineTheme.js"
42
+ "\\.(css)$": "<rootDir>/src/__mocks__/styleMock.js"
44
43
  },
45
44
  "transform": {
46
45
  "^.+\\.(js|jsx|ts|tsx)$": [
@@ -66,6 +65,7 @@
66
65
  "scripts": {
67
66
  "build": "rm -rf lib && pnpm exec tsc --project tsconfig.build.json",
68
67
  "test": "jest",
68
+ "test:ci": "pnpm run test --reporters=default --reporters=jest-junit",
69
69
  "lint": "eslint ."
70
70
  }
71
71
  }