inferred-types 0.40.3 → 0.40.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"pluralize.d.ts","sourceRoot":"","sources":["../../../src/runtime/literals/pluralize.ts"],"names":[],"mappings":"AAQA,OAAO,EAAY,SAAS,EAAgB,MAAM,WAAW,CAAC;AAkD9D,eAAO,MAAM,SAAS,6CAUrB,CAAC"}
1
+ {"version":3,"file":"pluralize.d.ts","sourceRoot":"","sources":["../../../src/runtime/literals/pluralize.ts"],"names":[],"mappings":"AAQA,OAAO,EAAY,SAAS,EAAgB,MAAM,WAAW,CAAC;AAuC9D,eAAO,MAAM,SAAS,6CAUrB,CAAC"}
@@ -1,17 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  import { ALPHA_CHARS, CONSONANTS, PLURAL_EXCEPTIONS, SINGULAR_NOUN_ENDINGS } from "src/constants";
3
- import { getEach, split, stripTrailing } from "src/runtime";
4
- const isException = (word) => getEach(PLURAL_EXCEPTIONS, "0").includes(word);
5
- const exceptionLookup = (word) => {
6
- const found = PLURAL_EXCEPTIONS.find(i => i[0] === word);
7
- if (found) {
8
- const plural = found[1];
9
- return plural;
10
- }
11
- else {
12
- throw new Error(`The word "${word}" was supposed to have an exception rule but it couldn't be found!`);
13
- }
14
- };
3
+ import { split, stripTrailing } from "src/runtime";
4
+ const isException = (word) => Object.keys(PLURAL_EXCEPTIONS).includes(word);
15
5
  const END_IN = [
16
6
  "is",
17
7
  "y",
@@ -46,7 +36,7 @@ const endingIn = (word, postfix) => {
46
36
  };
47
37
  export const pluralize = (word) => {
48
38
  return (isException(word)
49
- ? exceptionLookup(word)
39
+ ? PLURAL_EXCEPTIONS[word]
50
40
  : endingIn(word, "is") ||
51
41
  endingIn(word, "singular-noun") ||
52
42
  endingIn(word, "f") ||