@ember-data-mirror/request-utils 5.4.0-beta.12 → 5.4.0-beta.13

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,7 +1,7 @@
1
1
  import { deprecate } from '@ember/debug';
2
2
  import { macroCondition, getGlobalConfig, dependencySatisfies, importSync } from '@embroider/macros';
3
3
  import { m as defaultRules, b as plural, a as singular, i as irregular, u as uncountable } from "./inflect-8aYUyMN7.js";
4
- if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_EMBER_INFLECTOR)) {
4
+ if (macroCondition(getGlobalConfig().WarpDriveMirror.deprecations.DEPRECATE_EMBER_INFLECTOR)) {
5
5
  if (macroCondition(dependencySatisfies('ember-inflector', '*'))) {
6
6
  const Inflector = importSync('ember-inflector').default;
7
7
  const {
@@ -61,7 +61,7 @@ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_EMBER_INFL
61
61
  for: 'warp-drive',
62
62
  since: {
63
63
  enabled: '5.3.4',
64
- available: '5.3.4'
64
+ available: '4.13'
65
65
  },
66
66
  url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector'
67
67
  });
@@ -79,7 +79,7 @@ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_EMBER_INFL
79
79
  for: 'warp-drive',
80
80
  since: {
81
81
  enabled: '5.3.4',
82
- available: '5.3.4'
82
+ available: '4.13'
83
83
  },
84
84
  url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector'
85
85
  });
@@ -104,7 +104,7 @@ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_EMBER_INFL
104
104
  for: 'warp-drive',
105
105
  since: {
106
106
  enabled: '5.3.4',
107
- available: '5.3.4'
107
+ available: '4.13'
108
108
  },
109
109
  url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector'
110
110
  });
@@ -122,7 +122,7 @@ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_EMBER_INFL
122
122
  for: 'warp-drive',
123
123
  since: {
124
124
  enabled: '5.3.4',
125
- available: '5.3.4'
125
+ available: '4.13'
126
126
  },
127
127
  url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector'
128
128
  });
@@ -135,7 +135,7 @@ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_EMBER_INFL
135
135
  for: 'warp-drive',
136
136
  since: {
137
137
  enabled: '5.3.4',
138
- available: '5.3.4'
138
+ available: '4.13'
139
139
  },
140
140
  url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector'
141
141
  });
@@ -149,7 +149,7 @@ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_EMBER_INFL
149
149
  for: 'warp-drive',
150
150
  since: {
151
151
  enabled: '5.3.4',
152
- available: '5.3.4'
152
+ available: '4.13'
153
153
  },
154
154
  url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector'
155
155
  });
@@ -163,7 +163,7 @@ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_EMBER_INFL
163
163
  for: 'warp-drive',
164
164
  since: {
165
165
  enabled: '5.3.4',
166
- available: '5.3.4'
166
+ available: '4.13'
167
167
  },
168
168
  url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector'
169
169
  });
@@ -177,7 +177,7 @@ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_EMBER_INFL
177
177
  for: 'warp-drive',
178
178
  since: {
179
179
  enabled: '5.3.4',
180
- available: '5.3.4'
180
+ available: '4.13'
181
181
  },
182
182
  url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector'
183
183
  });
@@ -1 +1 @@
1
- {"version":3,"file":"deprecation-support.js","sources":["../src/deprecation-support.ts"],"sourcesContent":["import { deprecate } from '@ember/debug';\n\nimport { dependencySatisfies, importSync, macroCondition } from '@embroider/macros';\n\nimport { DEPRECATE_EMBER_INFLECTOR } from '@warp-drive-mirror/build-config/deprecations';\n\nimport { defaultRules as WarpDriveDefaults } from './-private/string/inflections';\nimport { irregular, plural, singular, uncountable } from './string';\n\nif (DEPRECATE_EMBER_INFLECTOR) {\n if (macroCondition(dependencySatisfies('ember-inflector', '*'))) {\n const Inflector = (importSync('ember-inflector') as { default: typeof import('ember-inflector').default }).default;\n const { inflector } = Inflector;\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalPlural = inflector.plural;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalSingular = inflector.singular;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalIrregular = inflector.irregular;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalUncountable = inflector.uncountable;\n\n // copy over any already registered rules\n type DefaultRules = {\n plurals: [RegExp, string][];\n singular: [RegExp, string][];\n irregularPairs: [string, string][];\n uncountable: string[];\n };\n type InternalRules = {\n plurals: [RegExp, string][];\n singular: [RegExp, string][];\n\n // [str1, str2] =>\n // { [str1.lower]: str2 }\n // { [str2.lower]: str2 }\n irregular: Record<string, string>;\n\n // [str1, str2] =>\n // { [str2.lower]: str1 }\n // { [str1.lower]: str1 }\n irregularInverse: Record<string, string>;\n\n // lower cased string\n uncountable: Record<string, boolean>;\n };\n\n // ember-inflector mutates the default rules arrays\n // with user supplied rules, so we keep track of what\n // is default via our own list.\n const defaultPluralKeys = new Set<string>();\n const defaultSingularKeys = new Set<string>();\n WarpDriveDefaults.plurals.forEach(([regex]) => {\n defaultPluralKeys.add(regex.toString());\n });\n WarpDriveDefaults.singular.forEach(([regex]) => {\n defaultSingularKeys.add(regex.toString());\n });\n\n const { defaultRules } = Inflector as unknown as { defaultRules: DefaultRules };\n const { rules } = inflector as unknown as { rules: InternalRules };\n\n const irregularMap = new Map<string, string>();\n const toIgnore = new Set<string>();\n const uncountableSet = new Set(defaultRules.uncountable);\n\n defaultRules.irregularPairs.forEach(([single, plur]) => {\n irregularMap.set(single.toLowerCase(), plur);\n toIgnore.add(plur.toLowerCase());\n });\n const irregularLookups = new Map<string, string>();\n Object.keys(rules.irregular).forEach((single) => {\n const plur = rules.irregular[single];\n irregularLookups.set(single, plur);\n });\n\n // load plurals\n rules.plurals.forEach(([regex, replacement]) => {\n if (defaultPluralKeys.has(regex.toString())) {\n return;\n }\n\n plural(regex, replacement);\n\n deprecate(\n `WarpDrive/EmberData no longer uses ember-inflector for pluralization.\\nPlease \\`import { plural } from '@ember-data-mirror/request-utils/string';\\` instead to register a custom pluralization rule for use with EmberData.`,\n false,\n {\n id: 'warp-drive.ember-inflector',\n until: '6.0.0',\n for: 'warp-drive',\n since: {\n enabled: '5.3.4',\n available: '5.3.4',\n },\n url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector',\n }\n );\n });\n\n // load singulars\n rules.singular.forEach(([regex, replacement]) => {\n if (defaultSingularKeys.has(regex.toString())) {\n return;\n }\n\n singular(regex, replacement);\n\n deprecate(\n `WarpDrive/EmberData no longer uses ember-inflector for singularization.\\nPlease \\`import { singular } from '@ember-data-mirror/request-utils/string';\\` instead to register a custom singularization rule for use with EmberData.`,\n false,\n {\n id: 'warp-drive.ember-inflector',\n until: '6.0.0',\n for: 'warp-drive',\n since: {\n enabled: '5.3.4',\n available: '5.3.4',\n },\n url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector',\n }\n );\n });\n\n // load irregulars\n Object.keys(rules.irregular).forEach((single) => {\n const plur = rules.irregular[single];\n const defaultPlur = irregularMap.get(single);\n if (defaultPlur && defaultPlur === plur) {\n return;\n }\n\n if (toIgnore.has(single)) {\n return;\n }\n\n const actualSingle = irregularLookups.get(plur.toLowerCase()) || single;\n toIgnore.add(plur.toLowerCase());\n irregular(actualSingle, plur);\n\n deprecate(\n `WarpDrive/EmberData no longer uses ember-inflector for irregular rules.\\nPlease \\`import { irregular } from '@ember-data-mirror/request-utils/string';\\` instead to register a custom irregular rule for use with EmberData for '${actualSingle}' <=> '${plur}'.`,\n false,\n {\n id: 'warp-drive.ember-inflector',\n until: '6.0.0',\n for: 'warp-drive',\n since: {\n enabled: '5.3.4',\n available: '5.3.4',\n },\n url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector',\n }\n );\n });\n\n // load uncountables\n Object.keys(rules.uncountable).forEach((word) => {\n if (uncountableSet.has(word) || rules.uncountable[word] !== true) {\n return;\n }\n\n uncountable(word);\n\n deprecate(\n `WarpDrive/EmberData no longer uses ember-inflector for uncountable rules.\\nPlease \\`import { uncountable } from '@ember-data-mirror/request-utils/string';\\` instead to register a custom uncountable rule for '${word}' for use with EmberData.`,\n false,\n {\n id: 'warp-drive.ember-inflector',\n until: '6.0.0',\n for: 'warp-drive',\n since: {\n enabled: '5.3.4',\n available: '5.3.4',\n },\n url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector',\n }\n );\n });\n\n inflector.plural = function (...args: Parameters<typeof originalPlural>) {\n plural(...args);\n\n deprecate(\n `WarpDrive/EmberData no longer uses ember-inflector for pluralization.\\nPlease \\`import { plural } from '@ember-data-mirror/request-utils/string';\\` instead to register a custom pluralization rule for use with EmberData.`,\n false,\n {\n id: 'warp-drive.ember-inflector',\n until: '6.0.0',\n for: 'warp-drive',\n since: {\n enabled: '5.3.4',\n available: '5.3.4',\n },\n url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector',\n }\n );\n\n return originalPlural.apply(inflector, args);\n };\n\n inflector.singular = function (...args: Parameters<typeof originalSingular>) {\n singular(...args);\n\n deprecate(\n `WarpDrive/EmberData no longer uses ember-inflector for singularization.\\nPlease \\`import { singular } from '@ember-data-mirror/request-utils/string';\\` instead to register a custom singularization rule for use with EmberData.`,\n false,\n {\n id: 'warp-drive.ember-inflector',\n until: '6.0.0',\n for: 'warp-drive',\n since: {\n enabled: '5.3.4',\n available: '5.3.4',\n },\n url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector',\n }\n );\n\n return originalSingular.apply(inflector, args);\n };\n\n inflector.irregular = function (...args: Parameters<typeof originalIrregular>) {\n irregular(...args);\n\n deprecate(\n `WarpDrive/EmberData no longer uses ember-inflector for irregular rules.\\nPlease \\`import { irregular } from '@ember-data-mirror/request-utils/string';\\` instead to register a custom irregular rule for use with EmberData.`,\n false,\n {\n id: 'warp-drive.ember-inflector',\n until: '6.0.0',\n for: 'warp-drive',\n since: {\n enabled: '5.3.4',\n available: '5.3.4',\n },\n url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector',\n }\n );\n\n return originalIrregular.apply(inflector, args);\n };\n\n inflector.uncountable = function (...args: Parameters<typeof originalUncountable>) {\n uncountable(...args);\n\n deprecate(\n `WarpDrive/EmberData no longer uses ember-inflector for uncountable rules.\\nPlease \\`import { uncountable } from '@ember-data-mirror/request-utils/string';\\` instead to register a custom uncountable rule for use with EmberData.`,\n false,\n {\n id: 'warp-drive.ember-inflector',\n until: '6.0.0',\n for: 'warp-drive',\n since: {\n enabled: '5.3.4',\n available: '5.3.4',\n },\n url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector',\n }\n );\n\n return originalUncountable.apply(inflector, args);\n };\n }\n}\n"],"names":["macroCondition","getGlobalConfig","WarpDrive","deprecations","DEPRECATE_EMBER_INFLECTOR","dependencySatisfies","Inflector","importSync","default","inflector","originalPlural","plural","originalSingular","singular","originalIrregular","irregular","originalUncountable","uncountable","defaultPluralKeys","Set","defaultSingularKeys","WarpDriveDefaults","plurals","forEach","regex","add","toString","defaultRules","rules","irregularMap","Map","toIgnore","uncountableSet","irregularPairs","single","plur","set","toLowerCase","irregularLookups","Object","keys","replacement","has","deprecate","id","until","for","since","enabled","available","url","defaultPlur","get","actualSingle","word","args","apply"],"mappings":";;;;AASA,IAAAA,cAAA,CAAAC,eAAA,EAAA,CAAAC,SAAA,CAAAC,YAAA,CAAAC,yBAAA,CAA+B,EAAA;EAC7B,IAAIJ,cAAc,CAACK,mBAAmB,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC,EAAE;AAC/D,IAAA,MAAMC,SAAS,GAAIC,UAAU,CAAC,iBAAiB,CAAC,CAA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C,SAAS,EAAE8C,IAAI,CAAC,CAAA;KAChD,CAAA;AAED9C,IAAAA,SAAS,CAACQ,WAAW,GAAG,UAAU,GAAGsC,IAA4C,EAAE;MACjFtC,WAAW,CAAC,GAAGsC,IAAI,CAAC,CAAA;AAEpBZ,MAAAA,SAAS,CACN,CAAA,2NAAA,CAA4N,EAC7N,KAAK,EACL;AACEC,QAAAA,EAAE,EAAE,4BAA4B;AAChCC,QAAAA,KAAK,EAAE,OAAO;AACdC,QAAAA,GAAG,EAAE,YAAY;AACjBC,QAAAA,KAAK,EAAE;AACLC,UAAAA,OAAO,EAAE,OAAO;AAChBC,UAAAA,SAAS,EAAE,OAAA;SACZ;AACDC,QAAAA,GAAG,EAAE,gEAAA;AACP,OACF,CAAC,CAAA;AAED,MAAA,OAAOlC,mBAAmB,CAACwC,KAAK,CAAC/C,SAAS,EAAE8C,IAAI,CAAC,CAAA;KAClD,CAAA;AACH,GAAA;AACF"}
1
+ {"version":3,"file":"deprecation-support.js","sources":["../src/deprecation-support.ts"],"sourcesContent":["import { deprecate } from '@ember/debug';\n\nimport { dependencySatisfies, importSync, macroCondition } from '@embroider/macros';\n\nimport { DEPRECATE_EMBER_INFLECTOR } from '@warp-drive-mirror/build-config/deprecations';\n\nimport { defaultRules as WarpDriveDefaults } from './-private/string/inflections';\nimport { irregular, plural, singular, uncountable } from './string';\n\nif (DEPRECATE_EMBER_INFLECTOR) {\n if (macroCondition(dependencySatisfies('ember-inflector', '*'))) {\n const Inflector = (importSync('ember-inflector') as { default: typeof import('ember-inflector').default }).default;\n const { inflector } = Inflector;\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalPlural = inflector.plural;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalSingular = inflector.singular;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalIrregular = inflector.irregular;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalUncountable = inflector.uncountable;\n\n // copy over any already registered rules\n type DefaultRules = {\n plurals: [RegExp, string][];\n singular: [RegExp, string][];\n irregularPairs: [string, string][];\n uncountable: string[];\n };\n type InternalRules = {\n plurals: [RegExp, string][];\n singular: [RegExp, string][];\n\n // [str1, str2] =>\n // { [str1.lower]: str2 }\n // { [str2.lower]: str2 }\n irregular: Record<string, string>;\n\n // [str1, str2] =>\n // { [str2.lower]: str1 }\n // { [str1.lower]: str1 }\n irregularInverse: Record<string, string>;\n\n // lower cased string\n uncountable: Record<string, boolean>;\n };\n\n // ember-inflector mutates the default rules arrays\n // with user supplied rules, so we keep track of what\n // is default via our own list.\n const defaultPluralKeys = new Set<string>();\n const defaultSingularKeys = new Set<string>();\n WarpDriveDefaults.plurals.forEach(([regex]) => {\n defaultPluralKeys.add(regex.toString());\n });\n WarpDriveDefaults.singular.forEach(([regex]) => {\n defaultSingularKeys.add(regex.toString());\n });\n\n const { defaultRules } = Inflector as unknown as { defaultRules: DefaultRules };\n const { rules } = inflector as unknown as { rules: InternalRules };\n\n const irregularMap = new Map<string, string>();\n const toIgnore = new Set<string>();\n const uncountableSet = new Set(defaultRules.uncountable);\n\n defaultRules.irregularPairs.forEach(([single, plur]) => {\n irregularMap.set(single.toLowerCase(), plur);\n toIgnore.add(plur.toLowerCase());\n });\n const irregularLookups = new Map<string, string>();\n Object.keys(rules.irregular).forEach((single) => {\n const plur = rules.irregular[single];\n irregularLookups.set(single, plur);\n });\n\n // load plurals\n rules.plurals.forEach(([regex, replacement]) => {\n if (defaultPluralKeys.has(regex.toString())) {\n return;\n }\n\n plural(regex, replacement);\n\n deprecate(\n `WarpDrive/EmberData no longer uses ember-inflector for pluralization.\\nPlease \\`import { plural } from '@ember-data-mirror/request-utils/string';\\` instead to register a custom pluralization rule for use with EmberData.`,\n false,\n {\n id: 'warp-drive.ember-inflector',\n until: '6.0.0',\n for: 'warp-drive',\n since: {\n enabled: '5.3.4',\n available: '4.13',\n },\n url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector',\n }\n );\n });\n\n // load singulars\n rules.singular.forEach(([regex, replacement]) => {\n if (defaultSingularKeys.has(regex.toString())) {\n return;\n }\n\n singular(regex, replacement);\n\n deprecate(\n `WarpDrive/EmberData no longer uses ember-inflector for singularization.\\nPlease \\`import { singular } from '@ember-data-mirror/request-utils/string';\\` instead to register a custom singularization rule for use with EmberData.`,\n false,\n {\n id: 'warp-drive.ember-inflector',\n until: '6.0.0',\n for: 'warp-drive',\n since: {\n enabled: '5.3.4',\n available: '4.13',\n },\n url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector',\n }\n );\n });\n\n // load irregulars\n Object.keys(rules.irregular).forEach((single) => {\n const plur = rules.irregular[single];\n const defaultPlur = irregularMap.get(single);\n if (defaultPlur && defaultPlur === plur) {\n return;\n }\n\n if (toIgnore.has(single)) {\n return;\n }\n\n const actualSingle = irregularLookups.get(plur.toLowerCase()) || single;\n toIgnore.add(plur.toLowerCase());\n irregular(actualSingle, plur);\n\n deprecate(\n `WarpDrive/EmberData no longer uses ember-inflector for irregular rules.\\nPlease \\`import { irregular } from '@ember-data-mirror/request-utils/string';\\` instead to register a custom irregular rule for use with EmberData for '${actualSingle}' <=> '${plur}'.`,\n false,\n {\n id: 'warp-drive.ember-inflector',\n until: '6.0.0',\n for: 'warp-drive',\n since: {\n enabled: '5.3.4',\n available: '4.13',\n },\n url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector',\n }\n );\n });\n\n // load uncountables\n Object.keys(rules.uncountable).forEach((word) => {\n if (uncountableSet.has(word) || rules.uncountable[word] !== true) {\n return;\n }\n\n uncountable(word);\n\n deprecate(\n `WarpDrive/EmberData no longer uses ember-inflector for uncountable rules.\\nPlease \\`import { uncountable } from '@ember-data-mirror/request-utils/string';\\` instead to register a custom uncountable rule for '${word}' for use with EmberData.`,\n false,\n {\n id: 'warp-drive.ember-inflector',\n until: '6.0.0',\n for: 'warp-drive',\n since: {\n enabled: '5.3.4',\n available: '4.13',\n },\n url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector',\n }\n );\n });\n\n inflector.plural = function (...args: Parameters<typeof originalPlural>) {\n plural(...args);\n\n deprecate(\n `WarpDrive/EmberData no longer uses ember-inflector for pluralization.\\nPlease \\`import { plural } from '@ember-data-mirror/request-utils/string';\\` instead to register a custom pluralization rule for use with EmberData.`,\n false,\n {\n id: 'warp-drive.ember-inflector',\n until: '6.0.0',\n for: 'warp-drive',\n since: {\n enabled: '5.3.4',\n available: '4.13',\n },\n url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector',\n }\n );\n\n return originalPlural.apply(inflector, args);\n };\n\n inflector.singular = function (...args: Parameters<typeof originalSingular>) {\n singular(...args);\n\n deprecate(\n `WarpDrive/EmberData no longer uses ember-inflector for singularization.\\nPlease \\`import { singular } from '@ember-data-mirror/request-utils/string';\\` instead to register a custom singularization rule for use with EmberData.`,\n false,\n {\n id: 'warp-drive.ember-inflector',\n until: '6.0.0',\n for: 'warp-drive',\n since: {\n enabled: '5.3.4',\n available: '4.13',\n },\n url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector',\n }\n );\n\n return originalSingular.apply(inflector, args);\n };\n\n inflector.irregular = function (...args: Parameters<typeof originalIrregular>) {\n irregular(...args);\n\n deprecate(\n `WarpDrive/EmberData no longer uses ember-inflector for irregular rules.\\nPlease \\`import { irregular } from '@ember-data-mirror/request-utils/string';\\` instead to register a custom irregular rule for use with EmberData.`,\n false,\n {\n id: 'warp-drive.ember-inflector',\n until: '6.0.0',\n for: 'warp-drive',\n since: {\n enabled: '5.3.4',\n available: '4.13',\n },\n url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector',\n }\n );\n\n return originalIrregular.apply(inflector, args);\n };\n\n inflector.uncountable = function (...args: Parameters<typeof originalUncountable>) {\n uncountable(...args);\n\n deprecate(\n `WarpDrive/EmberData no longer uses ember-inflector for uncountable rules.\\nPlease \\`import { uncountable } from '@ember-data-mirror/request-utils/string';\\` instead to register a custom uncountable rule for use with EmberData.`,\n false,\n {\n id: 'warp-drive.ember-inflector',\n until: '6.0.0',\n for: 'warp-drive',\n since: {\n enabled: '5.3.4',\n available: '4.13',\n },\n url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector',\n }\n );\n\n return originalUncountable.apply(inflector, args);\n };\n }\n}\n"],"names":["macroCondition","getGlobalConfig","WarpDrive","deprecations","DEPRECATE_EMBER_INFLECTOR","dependencySatisfies","Inflector","importSync","default","inflector","originalPlural","plural","originalSingular","singular","originalIrregular","irregular","originalUncountable","uncountable","defaultPluralKeys","Set","defaultSingularKeys","WarpDriveDefaults","plurals","forEach","regex","add","toString","defaultRules","rules","irregularMap","Map","toIgnore","uncountableSet","irregularPairs","single","plur","set","toLowerCase","irregularLookups","Object","keys","replacement","has","deprecate","id","until","for","since","enabled","available","url","defaultPlur","get","actualSingle","word","args","apply"],"mappings":";;;;AASA,IAAAA,cAAA,CAAAC,eAAA,EAAA,CAAAC,SAAA,CAAAC,YAAA,CAAAC,yBAAA,CAA+B,EAAA;EAC7B,IAAIJ,cAAc,CAACK,mBAAmB,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC,EAAE;AAC/D,IAAA,MAAMC,SAAS,GAAIC,UAAU,CAAC,iBAAiB,CAAC,CAA2DC,OAAO,CAAA;IAClH,MAAM;AAAEC,MAAAA,SAAAA;AAAU,KAAC,GAAGH,SAAS,CAAA;;AAE/B;AACA,IAAA,MAAMI,cAAc,GAAGD,SAAS,CAACE,MAAM,CAAA;AACvC;AACA,IAAA,MAAMC,gBAAgB,GAAGH,SAAS,CAACI,QAAQ,CAAA;AAC3C;AACA,IAAA,MAAMC,iBAAiB,GAAGL,SAAS,CAACM,SAAS,CAAA;AAC7C;AACA,IAAA,MAAMC,mBAAmB,GAAGP,SAAS,CAACQ,WAAW,CAAA;;AAEjD;;AAyBA;AACA;AACA;AACA,IAAA,MAAMC,iBAAiB,GAAG,IAAIC,GAAG,EAAU,CAAA;AAC3C,IAAA,MAAMC,mBAAmB,GAAG,IAAID,GAAG,EAAU,CAAA;IA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OAAOlC,mBAAmB,CAACwC,KAAK,CAAC/C,SAAS,EAAE8C,IAAI,CAAC,CAAA;KAClD,CAAA;AACH,GAAA;AACF"}
package/dist/index.js CHANGED
@@ -89,29 +89,29 @@ const CONFIG = {
89
89
  * @return void
90
90
  */
91
91
  function setBuildURLConfig(config) {
92
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
92
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
93
93
  if (!test) {
94
94
  throw new Error(`setBuildURLConfig: You must pass a config object`);
95
95
  }
96
96
  })(config) : {};
97
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
97
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
98
98
  if (!test) {
99
99
  throw new Error(`setBuildURLConfig: You must pass a config object with a 'host' or 'namespace' property`);
100
100
  }
101
101
  })('host' in config || 'namespace' in config) : {};
102
102
  CONFIG.host = config.host || '';
103
103
  CONFIG.namespace = config.namespace || '';
104
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
104
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
105
105
  if (!test) {
106
106
  throw new Error(`buildBaseURL: host must NOT end with '/', received '${CONFIG.host}'`);
107
107
  }
108
108
  })(CONFIG.host === '/' || !CONFIG.host.endsWith('/')) : {};
109
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
109
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
110
110
  if (!test) {
111
111
  throw new Error(`buildBaseURL: namespace must NOT start with '/', received '${CONFIG.namespace}'`);
112
112
  }
113
113
  })(!CONFIG.namespace.startsWith('/')) : {};
114
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
114
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
115
115
  if (!test) {
116
116
  throw new Error(`buildBaseURL: namespace must NOT end with '/', received '${CONFIG.namespace}'`);
117
117
  }
@@ -125,7 +125,7 @@ function hasResourcePath(options) {
125
125
  return 'resourcePath' in options && typeof options.resourcePath === 'string' && options.resourcePath.length > 0;
126
126
  }
127
127
  function resourcePathForType(options) {
128
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
128
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
129
129
  if (!test) {
130
130
  throw new Error(`resourcePathForType: You must pass a valid op as part of options`);
131
131
  }
@@ -179,37 +179,37 @@ function buildBaseURL(urlOptions) {
179
179
  host: CONFIG.host,
180
180
  namespace: CONFIG.namespace
181
181
  }, urlOptions);
182
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
182
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
183
183
  if (!test) {
184
184
  throw new Error(`buildBaseURL: You must pass \`op\` as part of options`);
185
185
  }
186
186
  })(hasResourcePath(options) || typeof options.op === 'string' && options.op.length > 0) : {};
187
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
187
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
188
188
  if (!test) {
189
189
  throw new Error(`buildBaseURL: You must pass \`identifier\` as part of options`);
190
190
  }
191
191
  })(hasResourcePath(options) || options.op === 'findMany' || options.identifier && typeof options.identifier === 'object') : {};
192
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
192
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
193
193
  if (!test) {
194
194
  throw new Error(`buildBaseURL: You must pass \`identifiers\` as part of options`);
195
195
  }
196
196
  })(hasResourcePath(options) || options.op !== 'findMany' || options.identifiers && Array.isArray(options.identifiers) && options.identifiers.length > 0 && options.identifiers.every(i => i && typeof i === 'object')) : {};
197
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
197
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
198
198
  if (!test) {
199
199
  throw new Error(`buildBaseURL: You must pass valid \`identifier\` as part of options, expected 'id'`);
200
200
  }
201
201
  })(hasResourcePath(options) || !isOperationWithPrimaryRecord(options) || typeof options.identifier.id === 'string' && options.identifier.id.length > 0) : {};
202
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
202
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
203
203
  if (!test) {
204
204
  throw new Error(`buildBaseURL: You must pass \`identifiers\` as part of options`);
205
205
  }
206
206
  })(hasResourcePath(options) || options.op !== 'findMany' || options.identifiers.every(i => typeof i.id === 'string' && i.id.length > 0)) : {};
207
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
207
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
208
208
  if (!test) {
209
209
  throw new Error(`buildBaseURL: You must pass valid \`identifier\` as part of options, expected 'type'`);
210
210
  }
211
211
  })(hasResourcePath(options) || options.op === 'findMany' || typeof options.identifier.type === 'string' && options.identifier.type.length > 0) : {};
212
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
212
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
213
213
  if (!test) {
214
214
  throw new Error(`buildBaseURL: You must pass valid \`identifiers\` as part of options, expected 'type'`);
215
215
  }
@@ -223,52 +223,52 @@ function buildBaseURL(urlOptions) {
223
223
  namespace
224
224
  } = options;
225
225
  const fieldPath = 'fieldPath' in options ? options.fieldPath : '';
226
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
226
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
227
227
  if (!test) {
228
228
  throw new Error(`buildBaseURL: You tried to build a url for a ${String('op' in options ? options.op + ' ' : '')}request to ${resourcePath} but resourcePath must be set or op must be one of "${['findRecord', 'findRelatedRecord', 'findRelatedCollection', 'updateRecord', 'deleteRecord', 'createRecord', 'query', 'findMany'].join('","')}".`);
229
229
  }
230
230
  })(hasResourcePath(options) || ['findRecord', 'query', 'findMany', 'findRelatedCollection', 'findRelatedRecord', 'createRecord', 'updateRecord', 'deleteRecord'].includes(options.op)) : {};
231
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
231
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
232
232
  if (!test) {
233
233
  throw new Error(`buildBaseURL: host must NOT end with '/', received '${host}'`);
234
234
  }
235
235
  })(host === '/' || !host.endsWith('/')) : {};
236
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
236
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
237
237
  if (!test) {
238
238
  throw new Error(`buildBaseURL: namespace must NOT start with '/', received '${namespace}'`);
239
239
  }
240
240
  })(!namespace.startsWith('/')) : {};
241
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
241
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
242
242
  if (!test) {
243
243
  throw new Error(`buildBaseURL: namespace must NOT end with '/', received '${namespace}'`);
244
244
  }
245
245
  })(!namespace.endsWith('/')) : {};
246
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
246
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
247
247
  if (!test) {
248
248
  throw new Error(`buildBaseURL: resourcePath must NOT start with '/', received '${resourcePath}'`);
249
249
  }
250
250
  })(!resourcePath.startsWith('/')) : {};
251
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
251
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
252
252
  if (!test) {
253
253
  throw new Error(`buildBaseURL: resourcePath must NOT end with '/', received '${resourcePath}'`);
254
254
  }
255
255
  })(!resourcePath.endsWith('/')) : {};
256
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
256
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
257
257
  if (!test) {
258
258
  throw new Error(`buildBaseURL: fieldPath must NOT start with '/', received '${fieldPath}'`);
259
259
  }
260
260
  })(!fieldPath.startsWith('/')) : {};
261
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
261
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
262
262
  if (!test) {
263
263
  throw new Error(`buildBaseURL: fieldPath must NOT end with '/', received '${fieldPath}'`);
264
264
  }
265
265
  })(!fieldPath.endsWith('/')) : {};
266
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
266
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
267
267
  if (!test) {
268
268
  throw new Error(`buildBaseURL: idPath must NOT start with '/', received '${idPath}'`);
269
269
  }
270
270
  })(!idPath.startsWith('/')) : {};
271
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
271
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
272
272
  if (!test) {
273
273
  throw new Error(`buildBaseURL: idPath must NOT end with '/', received '${idPath}'`);
274
274
  }
@@ -281,7 +281,7 @@ const DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS = {
281
281
  arrayFormat: 'comma'
282
282
  };
283
283
  function handleInclude(include) {
284
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
284
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
285
285
  if (!test) {
286
286
  throw new Error(`Expected include to be a string or array, got ${typeof include}`);
287
287
  }
@@ -343,7 +343,7 @@ function sortQueryParams(params, options) {
343
343
  const dictionaryParams = paramsIsObject ? params : {};
344
344
  if (!paramsIsObject) {
345
345
  params.forEach((value, key) => {
346
- const hasExisting = (key in dictionaryParams);
346
+ const hasExisting = key in dictionaryParams;
347
347
  if (!hasExisting) {
348
348
  dictionaryParams[key] = value;
349
349
  } else {
@@ -453,7 +453,7 @@ function parseCacheControl(header) {
453
453
  const cacheControlValue = {};
454
454
  function parseCacheControlValue(stringToParse) {
455
455
  const parsedValue = Number.parseInt(stringToParse);
456
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
456
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
457
457
  if (!test) {
458
458
  throw new Error(`Invalid Cache-Control value, expected a number but got - ${stringToParse}`);
459
459
  }
@@ -463,12 +463,12 @@ function parseCacheControl(header) {
463
463
  for (let i = 0; i < header.length; i++) {
464
464
  const char = header.charAt(i);
465
465
  if (char === ',') {
466
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
466
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
467
467
  if (!test) {
468
468
  throw new Error(`Invalid Cache-Control value, expected a value`);
469
469
  }
470
470
  })(!isParsingKey || !NUMERIC_KEYS.has(key)) : {};
471
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
471
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
472
472
  if (!test) {
473
473
  throw new Error(`Invalid Cache-Control value, expected a value after "=" but got ","`);
474
474
  }
@@ -480,7 +480,7 @@ function parseCacheControl(header) {
480
480
  value = '';
481
481
  continue;
482
482
  } else if (char === '=') {
483
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
483
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
484
484
  if (!test) {
485
485
  throw new Error(`Invalid Cache-Control value, expected a value after "="`);
486
486
  }
@@ -583,22 +583,22 @@ class CachePolicy {
583
583
  id: 'ember-data-mirror:request-utils:lifetimes-service-store-arg',
584
584
  since: {
585
585
  enabled: '5.4',
586
- available: '5.4'
586
+ available: '4.13'
587
587
  },
588
588
  for: '@ember-data-mirror/request-utils',
589
589
  until: '6.0'
590
590
  });
591
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
591
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
592
592
  if (!test) {
593
593
  throw new Error(`You must pass a config to the CachePolicy`);
594
594
  }
595
595
  })(_config) : {};
596
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
596
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
597
597
  if (!test) {
598
598
  throw new Error(`You must pass a apiCacheSoftExpires to the CachePolicy`);
599
599
  }
600
600
  })(typeof _config.apiCacheSoftExpires === 'number') : {};
601
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
601
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
602
602
  if (!test) {
603
603
  throw new Error(`You must pass a apiCacheHardExpires to the CachePolicy`);
604
604
  }
@@ -764,7 +764,7 @@ class LifetimesService extends CachePolicy {
764
764
  id: 'ember-data-mirror:deprecate-lifetimes-service-import',
765
765
  since: {
766
766
  enabled: '5.4',
767
- available: '5.4'
767
+ available: '4.13'
768
768
  },
769
769
  for: 'ember-data-mirror',
770
770
  until: '6.0'
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { deprecate } from '@ember/debug';\n\nimport { assert } from '@warp-drive-mirror/build-config/macros';\nimport type { StableRecordIdentifier } from '@warp-drive-mirror/core-types';\nimport type { Cache } from '@warp-drive-mirror/core-types/cache';\nimport type { StableDocumentIdentifier } from '@warp-drive-mirror/core-types/identifier';\nimport type { QueryParamsSerializationOptions, QueryParamsSource, Serializable } from '@warp-drive-mirror/core-types/params';\nimport type { ImmutableRequestInfo, ResponseInfo } from '@warp-drive-mirror/core-types/request';\n\ntype UnsubscribeToken = object;\ntype CacheOperation = 'added' | 'removed' | 'updated' | 'state';\ntype DocumentCacheOperation = 'invalidated' | 'added' | 'removed' | 'updated' | 'state';\n\nexport interface NotificationCallback {\n (identifier: StableRecordIdentifier, notificationType: 'attributes' | 'relationships', key?: string): void;\n (identifier: StableRecordIdentifier, notificationType: 'errors' | 'meta' | 'identity' | 'state'): void;\n // (identifier: StableRecordIdentifier, notificationType: NotificationType, key?: string): void;\n}\n\ninterface ResourceOperationCallback {\n // resource updates\n (identifier: StableRecordIdentifier, notificationType: CacheOperation): void;\n}\n\ninterface DocumentOperationCallback {\n // document updates\n (identifier: StableDocumentIdentifier, notificationType: DocumentCacheOperation): void;\n}\n\ntype NotificationManager = {\n subscribe(identifier: StableRecordIdentifier, callback: NotificationCallback): UnsubscribeToken;\n subscribe(identifier: 'resource', callback: ResourceOperationCallback): UnsubscribeToken;\n subscribe(identifier: 'document' | StableDocumentIdentifier, callback: DocumentOperationCallback): UnsubscribeToken;\n\n notify(identifier: StableRecordIdentifier, value: 'attributes' | 'relationships', key?: string): boolean;\n notify(identifier: StableRecordIdentifier, value: 'errors' | 'meta' | 'identity' | 'state'): boolean;\n notify(identifier: StableRecordIdentifier, value: CacheOperation): boolean;\n notify(identifier: StableDocumentIdentifier, value: DocumentCacheOperation): boolean;\n};\n\ntype Store = {\n cache: Cache;\n notifications: NotificationManager;\n};\n\n/**\n * Simple utility function to assist in url building,\n * query params, and other common request operations.\n *\n * These primitives may be used directly or composed\n * by request builders to provide a consistent interface\n * for building requests.\n *\n * For instance:\n *\n * ```ts\n * import { buildBaseURL, buildQueryParams } from '@ember-data-mirror/request-utils';\n *\n * const baseURL = buildBaseURL({\n * host: 'https://api.example.com',\n * namespace: 'api/v1',\n * resourcePath: 'emberDevelopers',\n * op: 'query',\n * identifier: { type: 'ember-developer' }\n * });\n * const url = `${baseURL}?${buildQueryParams({ name: 'Chris', include:['pets'] })}`;\n * // => 'https://api.example.com/api/v1/emberDevelopers?include=pets&name=Chris'\n * ```\n *\n * This is useful, but not as useful as the REST request builder for query which is sugar\n * over this (and more!):\n *\n * ```ts\n * import { query } from '@ember-data-mirror/rest/request';\n *\n * const options = query('ember-developer', { name: 'Chris', include:['pets'] });\n * // => { url: 'https://api.example.com/api/v1/emberDevelopers?include=pets&name=Chris' }\n * // Note: options will also include other request options like headers, method, etc.\n * ```\n *\n * @module @ember-data-mirror/request-utils\n * @main @ember-data-mirror/request-utils\n * @public\n */\n\n// prevents the final constructed object from needing to add\n// host and namespace which are provided by the final consuming\n// class to the prototype which can result in overwrite errors\n\nexport interface BuildURLConfig {\n host: string | null;\n namespace: string | null;\n}\n\nconst CONFIG: BuildURLConfig = {\n host: '',\n namespace: '',\n};\n\n/**\n * Sets the global configuration for `buildBaseURL`\n * for host and namespace values for the application.\n *\n * These values may still be overridden by passing\n * them to buildBaseURL directly.\n *\n * This method may be called as many times as needed.\n * host values of `''` or `'/'` are equivalent.\n *\n * Except for the value of `/` as host, host should not\n * end with `/`.\n *\n * namespace should not start or end with a `/`.\n *\n * ```ts\n * type BuildURLConfig = {\n * host: string;\n * namespace: string'\n * }\n * ```\n *\n * Example:\n *\n * ```ts\n * import { setBuildURLConfig } from '@ember-data-mirror/request-utils';\n *\n * setBuildURLConfig({\n * host: 'https://api.example.com',\n * namespace: 'api/v1'\n * });\n * ```\n *\n * @method setBuildURLConfig\n * @static\n * @public\n * @for @ember-data-mirror/request-utils\n * @param {BuildURLConfig} config\n * @return void\n */\nexport function setBuildURLConfig(config: BuildURLConfig) {\n assert(`setBuildURLConfig: You must pass a config object`, config);\n assert(\n `setBuildURLConfig: You must pass a config object with a 'host' or 'namespace' property`,\n 'host' in config || 'namespace' in config\n );\n\n CONFIG.host = config.host || '';\n CONFIG.namespace = config.namespace || '';\n\n assert(\n `buildBaseURL: host must NOT end with '/', received '${CONFIG.host}'`,\n CONFIG.host === '/' || !CONFIG.host.endsWith('/')\n );\n assert(\n `buildBaseURL: namespace must NOT start with '/', received '${CONFIG.namespace}'`,\n !CONFIG.namespace.startsWith('/')\n );\n assert(\n `buildBaseURL: namespace must NOT end with '/', received '${CONFIG.namespace}'`,\n !CONFIG.namespace.endsWith('/')\n );\n}\n\nexport interface FindRecordUrlOptions {\n op: 'findRecord';\n identifier: { type: string; id: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface QueryUrlOptions {\n op: 'query';\n identifier: { type: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface FindManyUrlOptions {\n op: 'findMany';\n identifiers: { type: string; id: string }[];\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\nexport interface FindRelatedCollectionUrlOptions {\n op: 'findRelatedCollection';\n identifier: { type: string; id: string };\n fieldPath: string;\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface FindRelatedResourceUrlOptions {\n op: 'findRelatedRecord';\n identifier: { type: string; id: string };\n fieldPath: string;\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface CreateRecordUrlOptions {\n op: 'createRecord';\n identifier: { type: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface UpdateRecordUrlOptions {\n op: 'updateRecord';\n identifier: { type: string; id: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface DeleteRecordUrlOptions {\n op: 'deleteRecord';\n identifier: { type: string; id: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface GenericUrlOptions {\n resourcePath: string;\n host?: string;\n namespace?: string;\n}\n\nexport type UrlOptions =\n | FindRecordUrlOptions\n | QueryUrlOptions\n | FindManyUrlOptions\n | FindRelatedCollectionUrlOptions\n | FindRelatedResourceUrlOptions\n | CreateRecordUrlOptions\n | UpdateRecordUrlOptions\n | DeleteRecordUrlOptions\n | GenericUrlOptions;\n\nconst OPERATIONS_WITH_PRIMARY_RECORDS = new Set([\n 'findRecord',\n 'findRelatedRecord',\n 'findRelatedCollection',\n 'updateRecord',\n 'deleteRecord',\n]);\n\nfunction isOperationWithPrimaryRecord(\n options: UrlOptions\n): options is\n | FindRecordUrlOptions\n | FindRelatedCollectionUrlOptions\n | FindRelatedResourceUrlOptions\n | UpdateRecordUrlOptions\n | DeleteRecordUrlOptions {\n return 'op' in options && OPERATIONS_WITH_PRIMARY_RECORDS.has(options.op);\n}\n\nfunction hasResourcePath(options: UrlOptions): options is GenericUrlOptions {\n return 'resourcePath' in options && typeof options.resourcePath === 'string' && options.resourcePath.length > 0;\n}\n\nfunction resourcePathForType(options: UrlOptions): string {\n assert(\n `resourcePathForType: You must pass a valid op as part of options`,\n 'op' in options && typeof options.op === 'string'\n );\n return options.op === 'findMany' ? options.identifiers[0].type : options.identifier.type;\n}\n\n/**\n * Builds a URL for a request based on the provided options.\n * Does not include support for building query params (see `buildQueryParams`)\n * so that it may be composed cleanly with other query-params strategies.\n *\n * Usage:\n *\n * ```ts\n * import { buildBaseURL } from '@ember-data-mirror/request-utils';\n *\n * const url = buildBaseURL({\n * host: 'https://api.example.com',\n * namespace: 'api/v1',\n * resourcePath: 'emberDevelopers',\n * op: 'query',\n * identifier: { type: 'ember-developer' }\n * });\n *\n * // => 'https://api.example.com/api/v1/emberDevelopers'\n * ```\n *\n * On the surface this may seem like a lot of work to do something simple, but\n * it is designed to be composable with other utilities and interfaces that the\n * average product engineer will never need to see or use.\n *\n * A few notes:\n *\n * - `resourcePath` is optional, but if it is not provided, `identifier.type` will be used.\n * - `host` and `namespace` are optional, but if they are not provided, the values globally\n * configured via `setBuildURLConfig` will be used.\n * - `op` is required and must be one of the following:\n * - 'findRecord' 'query' 'findMany' 'findRelatedCollection' 'findRelatedRecord'` 'createRecord' 'updateRecord' 'deleteRecord'\n * - Depending on the value of `op`, `identifier` or `identifiers` will be required.\n *\n * @method buildBaseURL\n * @static\n * @public\n * @for @ember-data-mirror/request-utils\n * @param urlOptions\n * @return string\n */\nexport function buildBaseURL(urlOptions: UrlOptions): string {\n const options = Object.assign(\n {\n host: CONFIG.host,\n namespace: CONFIG.namespace,\n },\n urlOptions\n );\n assert(\n `buildBaseURL: You must pass \\`op\\` as part of options`,\n hasResourcePath(options) || (typeof options.op === 'string' && options.op.length > 0)\n );\n assert(\n `buildBaseURL: You must pass \\`identifier\\` as part of options`,\n hasResourcePath(options) ||\n options.op === 'findMany' ||\n (options.identifier && typeof options.identifier === 'object')\n );\n assert(\n `buildBaseURL: You must pass \\`identifiers\\` as part of options`,\n hasResourcePath(options) ||\n options.op !== 'findMany' ||\n (options.identifiers &&\n Array.isArray(options.identifiers) &&\n options.identifiers.length > 0 &&\n options.identifiers.every((i) => i && typeof i === 'object'))\n );\n assert(\n `buildBaseURL: You must pass valid \\`identifier\\` as part of options, expected 'id'`,\n hasResourcePath(options) ||\n !isOperationWithPrimaryRecord(options) ||\n (typeof options.identifier.id === 'string' && options.identifier.id.length > 0)\n );\n assert(\n `buildBaseURL: You must pass \\`identifiers\\` as part of options`,\n hasResourcePath(options) ||\n options.op !== 'findMany' ||\n options.identifiers.every((i) => typeof i.id === 'string' && i.id.length > 0)\n );\n assert(\n `buildBaseURL: You must pass valid \\`identifier\\` as part of options, expected 'type'`,\n hasResourcePath(options) ||\n options.op === 'findMany' ||\n (typeof options.identifier.type === 'string' && options.identifier.type.length > 0)\n );\n assert(\n `buildBaseURL: You must pass valid \\`identifiers\\` as part of options, expected 'type'`,\n hasResourcePath(options) ||\n options.op !== 'findMany' ||\n (typeof options.identifiers[0].type === 'string' && options.identifiers[0].type.length > 0)\n );\n\n // prettier-ignore\n const idPath: string =\n isOperationWithPrimaryRecord(options) ? encodeURIComponent(options.identifier.id)\n : '';\n const resourcePath = options.resourcePath || resourcePathForType(options);\n const { host, namespace } = options;\n const fieldPath = 'fieldPath' in options ? options.fieldPath : '';\n\n assert(\n `buildBaseURL: You tried to build a url for a ${String(\n 'op' in options ? options.op + ' ' : ''\n )}request to ${resourcePath} but resourcePath must be set or op must be one of \"${[\n 'findRecord',\n 'findRelatedRecord',\n 'findRelatedCollection',\n 'updateRecord',\n 'deleteRecord',\n 'createRecord',\n 'query',\n 'findMany',\n ].join('\",\"')}\".`,\n hasResourcePath(options) ||\n [\n 'findRecord',\n 'query',\n 'findMany',\n 'findRelatedCollection',\n 'findRelatedRecord',\n 'createRecord',\n 'updateRecord',\n 'deleteRecord',\n ].includes(options.op)\n );\n\n assert(`buildBaseURL: host must NOT end with '/', received '${host}'`, host === '/' || !host.endsWith('/'));\n assert(`buildBaseURL: namespace must NOT start with '/', received '${namespace}'`, !namespace.startsWith('/'));\n assert(`buildBaseURL: namespace must NOT end with '/', received '${namespace}'`, !namespace.endsWith('/'));\n assert(\n `buildBaseURL: resourcePath must NOT start with '/', received '${resourcePath}'`,\n !resourcePath.startsWith('/')\n );\n assert(`buildBaseURL: resourcePath must NOT end with '/', received '${resourcePath}'`, !resourcePath.endsWith('/'));\n assert(`buildBaseURL: fieldPath must NOT start with '/', received '${fieldPath}'`, !fieldPath.startsWith('/'));\n assert(`buildBaseURL: fieldPath must NOT end with '/', received '${fieldPath}'`, !fieldPath.endsWith('/'));\n assert(`buildBaseURL: idPath must NOT start with '/', received '${idPath}'`, !idPath.startsWith('/'));\n assert(`buildBaseURL: idPath must NOT end with '/', received '${idPath}'`, !idPath.endsWith('/'));\n\n const hasHost = host !== '' && host !== '/';\n const url = [hasHost ? host : '', namespace, resourcePath, idPath, fieldPath].filter(Boolean).join('/');\n return hasHost ? url : `/${url}`;\n}\n\nconst DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS: QueryParamsSerializationOptions = {\n arrayFormat: 'comma',\n};\n\nfunction handleInclude(include: string | string[]): string[] {\n assert(\n `Expected include to be a string or array, got ${typeof include}`,\n typeof include === 'string' || Array.isArray(include)\n );\n return typeof include === 'string' ? include.split(',') : include;\n}\n\n/**\n * filter out keys of an object that have falsy values or point to empty arrays\n * returning a new object with only those keys that have truthy values / non-empty arrays\n *\n * @method filterEmpty\n * @static\n * @public\n * @for @ember-data-mirror/request-utils\n * @param {Record<string, Serializable>} source object to filter keys with empty values from\n * @return {Record<string, Serializable>} A new object with the keys that contained empty values removed\n */\nexport function filterEmpty(source: Record<string, Serializable>): Record<string, Serializable> {\n const result: Record<string, Serializable> = {};\n for (const key in source) {\n const value = source[key];\n // Allow `0` and `false` but filter falsy values that indicate \"empty\"\n if (value !== undefined && value !== null && value !== '') {\n if (!Array.isArray(value) || value.length > 0) {\n result[key] = source[key];\n }\n }\n }\n return result;\n}\n\n/**\n * Sorts query params by both key and value returning a new URLSearchParams\n * object with the keys inserted in sorted order.\n *\n * Treats `included` specially, splicing it into an array if it is a string and sorting the array.\n *\n * Options:\n * - arrayFormat: 'bracket' | 'indices' | 'repeat' | 'comma'\n *\n * 'bracket': appends [] to the key for every value e.g. `&ids[]=1&ids[]=2`\n * 'indices': appends [i] to the key for every value e.g. `&ids[0]=1&ids[1]=2`\n * 'repeat': appends the key for every value e.g. `&ids=1&ids=2`\n * 'comma' (default): appends the key once with a comma separated list of values e.g. `&ids=1,2`\n *\n * @method sortQueryParams\n * @static\n * @public\n * @for @ember-data-mirror/request-utils\n * @param {URLSearchParams | object} params\n * @param {object} options\n * @return {URLSearchParams} A URLSearchParams with keys inserted in sorted order\n */\nexport function sortQueryParams(params: QueryParamsSource, options?: QueryParamsSerializationOptions): URLSearchParams {\n const opts = Object.assign({}, DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS, options);\n const paramsIsObject = !(params instanceof URLSearchParams);\n const urlParams = new URLSearchParams();\n const dictionaryParams: Record<string, Serializable> = paramsIsObject ? params : {};\n\n if (!paramsIsObject) {\n params.forEach((value, key) => {\n const hasExisting = key in dictionaryParams;\n if (!hasExisting) {\n dictionaryParams[key] = value;\n } else {\n const existingValue = dictionaryParams[key];\n if (Array.isArray(existingValue)) {\n existingValue.push(value);\n } else {\n dictionaryParams[key] = [existingValue, value];\n }\n }\n });\n }\n\n if ('include' in dictionaryParams) {\n dictionaryParams.include = handleInclude(dictionaryParams.include as string | string[]);\n }\n\n const sortedKeys = Object.keys(dictionaryParams).sort();\n sortedKeys.forEach((key) => {\n const value = dictionaryParams[key];\n if (Array.isArray(value)) {\n value.sort();\n switch (opts.arrayFormat) {\n case 'indices':\n value.forEach((v, i) => {\n urlParams.append(`${key}[${i}]`, String(v));\n });\n return;\n case 'bracket':\n value.forEach((v) => {\n urlParams.append(`${key}[]`, String(v));\n });\n return;\n case 'repeat':\n value.forEach((v) => {\n urlParams.append(key, String(v));\n });\n return;\n case 'comma':\n default:\n urlParams.append(key, value.join(','));\n return;\n }\n } else {\n urlParams.append(key, String(value));\n }\n });\n\n return urlParams;\n}\n\n/**\n * Sorts query params by both key and value, returning a query params string\n *\n * Treats `included` specially, splicing it into an array if it is a string and sorting the array.\n *\n * Options:\n * - arrayFormat: 'bracket' | 'indices' | 'repeat' | 'comma'\n *\n * 'bracket': appends [] to the key for every value e.g. `ids[]=1&ids[]=2`\n * 'indices': appends [i] to the key for every value e.g. `ids[0]=1&ids[1]=2`\n * 'repeat': appends the key for every value e.g. `ids=1&ids=2`\n * 'comma' (default): appends the key once with a comma separated list of values e.g. `ids=1,2`\n *\n * @method buildQueryParams\n * @static\n * @public\n * @for @ember-data-mirror/request-utils\n * @param {URLSearchParams | object} params\n * @param {object} [options]\n * @return {string} A sorted query params string without the leading `?`\n */\nexport function buildQueryParams(params: QueryParamsSource, options?: QueryParamsSerializationOptions): string {\n return sortQueryParams(params, options).toString();\n}\nexport interface CacheControlValue {\n immutable?: boolean;\n 'max-age'?: number;\n 'must-revalidate'?: boolean;\n 'must-understand'?: boolean;\n 'no-cache'?: boolean;\n 'no-store'?: boolean;\n 'no-transform'?: boolean;\n 'only-if-cached'?: boolean;\n private?: boolean;\n 'proxy-revalidate'?: boolean;\n public?: boolean;\n 's-maxage'?: number;\n 'stale-if-error'?: number;\n 'stale-while-revalidate'?: number;\n}\n\ntype CacheControlKey = keyof CacheControlValue;\n\nconst NUMERIC_KEYS = new Set(['max-age', 's-maxage', 'stale-if-error', 'stale-while-revalidate']);\n\n/**\n * Parses a string Cache-Control header value into an object with the following structure:\n *\n * ```ts\n * interface CacheControlValue {\n * immutable?: boolean;\n * 'max-age'?: number;\n * 'must-revalidate'?: boolean;\n * 'must-understand'?: boolean;\n * 'no-cache'?: boolean;\n * 'no-store'?: boolean;\n * 'no-transform'?: boolean;\n * 'only-if-cached'?: boolean;\n * private?: boolean;\n * 'proxy-revalidate'?: boolean;\n * public?: boolean;\n * 's-maxage'?: number;\n * 'stale-if-error'?: number;\n * 'stale-while-revalidate'?: number;\n * }\n * ```\n * @method parseCacheControl\n * @static\n * @public\n * @for @ember-data-mirror/request-utils\n * @param {string} header\n * @return {CacheControlValue}\n */\nexport function parseCacheControl(header: string): CacheControlValue {\n let key: CacheControlKey = '' as CacheControlKey;\n let value = '';\n let isParsingKey = true;\n const cacheControlValue: CacheControlValue = {};\n\n function parseCacheControlValue(stringToParse: string): number {\n const parsedValue = Number.parseInt(stringToParse);\n assert(`Invalid Cache-Control value, expected a number but got - ${stringToParse}`, !Number.isNaN(parsedValue));\n return parsedValue;\n }\n\n for (let i = 0; i < header.length; i++) {\n const char = header.charAt(i);\n if (char === ',') {\n assert(`Invalid Cache-Control value, expected a value`, !isParsingKey || !NUMERIC_KEYS.has(key));\n assert(\n `Invalid Cache-Control value, expected a value after \"=\" but got \",\"`,\n i === 0 || header.charAt(i - 1) !== '='\n );\n isParsingKey = true;\n // @ts-expect-error TS incorrectly thinks that optional keys must have a type that includes undefined\n cacheControlValue[key] = NUMERIC_KEYS.has(key) ? parseCacheControlValue(value) : true;\n key = '' as CacheControlKey;\n value = '';\n continue;\n } else if (char === '=') {\n assert(`Invalid Cache-Control value, expected a value after \"=\"`, i + 1 !== header.length);\n isParsingKey = false;\n } else if (char === ' ' || char === `\\t` || char === `\\n`) {\n continue;\n } else if (isParsingKey) {\n key += char;\n } else {\n value += char;\n }\n\n if (i === header.length - 1) {\n // @ts-expect-error TS incorrectly thinks that optional keys must have a type that includes undefined\n cacheControlValue[key] = NUMERIC_KEYS.has(key) ? parseCacheControlValue(value) : true;\n }\n }\n\n return cacheControlValue;\n}\n\nfunction isStale(headers: Headers, expirationTime: number): boolean {\n // const age = headers.get('age');\n // const cacheControl = parseCacheControl(headers.get('cache-control') || '');\n // const expires = headers.get('expires');\n // const lastModified = headers.get('last-modified');\n const date = headers.get('date');\n\n if (!date) {\n return true;\n }\n\n const time = new Date(date).getTime();\n const now = Date.now();\n const deadline = time + expirationTime;\n\n const result = now > deadline;\n\n return result;\n}\n\nexport type PolicyConfig = { apiCacheSoftExpires: number; apiCacheHardExpires: number };\n\n/**\n * A basic CachePolicy that can be added to the Store service.\n *\n * Determines staleness based on time since the request was last received from the API\n * using the `date` header.\n *\n * Invalidates any request for which `cacheOptions.types` was provided when a createRecord\n * request for that type is successful.\n *\n * For this to work, the `createRecord` request must include the `cacheOptions.types` array\n * with the types that should be invalidated, or its request should specify the identifiers\n * of the records that are being created via `records`. Providing both is valid.\n *\n * > [!NOTE]\n * > only requests that had specified `cacheOptions.types` and occurred prior to the\n * > createRecord request will be invalidated. This means that a given request should always\n * > specify the types that would invalidate it to opt into this behavior. Abstracting this\n * > behavior via builders is recommended to ensure consistency.\n *\n * This allows the Store's CacheHandler to determine if a request is expired and\n * should be refetched upon next request.\n *\n * The `Fetch` handler provided by `@ember-data-mirror/request/fetch` will automatically\n * add the `date` header to responses if it is not present.\n *\n * > [!NOTE]\n * > Date headers do not have millisecond precision, so expiration times should\n * > generally be larger than 1000ms.\n *\n * Usage:\n *\n * ```ts\n * import { CachePolicy } from '@ember-data-mirror/request-utils';\n * import DataStore from '@ember-data-mirror/store';\n *\n * // ...\n *\n * export class Store extends DataStore {\n * constructor(args) {\n * super(args);\n * this.lifetimes = new CachePolicy({ apiCacheSoftExpires: 30_000, apiCacheHardExpires: 60_000 });\n * }\n * }\n * ```\n *\n * @class CachePolicy\n * @public\n * @module @ember-data-mirror/request-utils\n */\nexport class CachePolicy {\n declare config: PolicyConfig;\n declare _stores: WeakMap<\n Store,\n { invalidated: Set<StableDocumentIdentifier>; types: Map<string, Set<StableDocumentIdentifier>> }\n >;\n\n _getStore(store: Store): {\n invalidated: Set<StableDocumentIdentifier>;\n types: Map<string, Set<StableDocumentIdentifier>>;\n } {\n let set = this._stores.get(store);\n if (!set) {\n set = { invalidated: new Set(), types: new Map() };\n this._stores.set(store, set);\n }\n return set;\n }\n\n constructor(config: PolicyConfig) {\n this._stores = new WeakMap();\n\n const _config = arguments.length === 1 ? config : (arguments[1] as unknown as PolicyConfig);\n deprecate(\n `Passing a Store to the CachePolicy is deprecated, please pass only a config instead.`,\n arguments.length === 1,\n {\n id: 'ember-data-mirror:request-utils:lifetimes-service-store-arg',\n since: {\n enabled: '5.4',\n available: '5.4',\n },\n for: '@ember-data-mirror/request-utils',\n until: '6.0',\n }\n );\n assert(`You must pass a config to the CachePolicy`, _config);\n assert(`You must pass a apiCacheSoftExpires to the CachePolicy`, typeof _config.apiCacheSoftExpires === 'number');\n assert(`You must pass a apiCacheHardExpires to the CachePolicy`, typeof _config.apiCacheHardExpires === 'number');\n this.config = _config;\n }\n\n /**\n * Invalidate a request by its identifier for a given store instance.\n *\n * While the store argument may seem redundant, the CachePolicy\n * is designed to be shared across multiple stores / forks\n * of the store.\n *\n * ```ts\n * store.lifetimes.invalidateRequest(store, identifier);\n * ```\n *\n * @method invalidateRequest\n * @public\n * @param {StableDocumentIdentifier} identifier\n * @param {Store} store\n */\n invalidateRequest(identifier: StableDocumentIdentifier, store: Store): void {\n this._getStore(store).invalidated.add(identifier);\n }\n\n /**\n * Invalidate all requests associated to a specific type\n * for a given store instance.\n *\n * While the store argument may seem redundant, the CachePolicy\n * is designed to be shared across multiple stores / forks\n * of the store.\n *\n * This invalidation is done automatically when using this service\n * for both the CacheHandler and the LegacyNetworkHandler.\n *\n * ```ts\n * store.lifetimes.invalidateRequestsForType(store, 'person');\n * ```\n *\n * @method invalidateRequestsForType\n * @public\n * @param {string} type\n * @param {Store} store\n */\n invalidateRequestsForType(type: string, store: Store): void {\n const storeCache = this._getStore(store);\n const set = storeCache.types.get(type);\n const notifications = store.notifications;\n\n if (set) {\n // TODO batch notifications\n set.forEach((id) => {\n storeCache.invalidated.add(id);\n notifications.notify(id, 'invalidated');\n });\n }\n }\n\n /**\n * Invoked when a request has been fulfilled from the configured request handlers.\n * This is invoked by the CacheHandler for both foreground and background requests\n * once the cache has been updated.\n *\n * Note, this is invoked by the CacheHandler regardless of whether\n * the request has a cache-key.\n *\n * This method should not be invoked directly by consumers.\n *\n * @method didRequest\n * @public\n * @param {ImmutableRequestInfo} request\n * @param {ImmutableResponse} response\n * @param {Store} store\n * @param {StableDocumentIdentifier | null} identifier\n * @return {void}\n */\n didRequest(\n request: ImmutableRequestInfo,\n response: Response | ResponseInfo | null,\n identifier: StableDocumentIdentifier | null,\n store: Store\n ): void {\n // if this is a successful createRecord request, invalidate the cacheKey for the type\n if (request.op === 'createRecord') {\n const statusNumber = response?.status ?? 0;\n if (statusNumber >= 200 && statusNumber < 400) {\n const types = new Set(request.records?.map((r) => r.type));\n const additionalTypes = request.cacheOptions?.types;\n additionalTypes?.forEach((type) => {\n types.add(type);\n });\n\n types.forEach((type) => {\n this.invalidateRequestsForType(type, store);\n });\n }\n\n // add this document's cacheKey to a map for all associated types\n // it is recommended to only use this for queries\n } else if (identifier && request.cacheOptions?.types?.length) {\n const storeCache = this._getStore(store);\n request.cacheOptions?.types.forEach((type) => {\n const set = storeCache.types.get(type);\n if (set) {\n set.add(identifier);\n storeCache.invalidated.delete(identifier);\n } else {\n storeCache.types.set(type, new Set([identifier]));\n }\n });\n }\n }\n\n /**\n * Invoked to determine if the request may be fulfilled from cache\n * if possible.\n *\n * Note, this is only invoked by the CacheHandler if the request has\n * a cache-key.\n *\n * If no cache entry is found or the entry is hard expired,\n * the request will be fulfilled from the configured request handlers\n * and the cache will be updated before returning the response.\n *\n * @method isHardExpired\n * @public\n * @param {StableDocumentIdentifier} identifier\n * @param {Store} store\n * @return {boolean} true if the request is considered hard expired\n */\n isHardExpired(identifier: StableDocumentIdentifier, store: Store): boolean {\n // if we are explicitly invalidated, we are hard expired\n const storeCache = this._getStore(store);\n if (storeCache.invalidated.has(identifier)) {\n return true;\n }\n const cache = store.cache;\n const cached = cache.peekRequest(identifier);\n return !cached || !cached.response || isStale(cached.response.headers, this.config.apiCacheHardExpires);\n }\n\n /**\n * Invoked if `isHardExpired` is false to determine if the request\n * should be update behind the scenes if cache data is already available.\n *\n * Note, this is only invoked by the CacheHandler if the request has\n * a cache-key.\n *\n * If true, the request will be fulfilled from cache while a backgrounded\n * request is made to update the cache via the configured request handlers.\n *\n * @method isSoftExpired\n * @public\n * @param {StableDocumentIdentifier} identifier\n * @param {Store} store\n * @return {boolean} true if the request is considered soft expired\n */\n isSoftExpired(identifier: StableDocumentIdentifier, store: Store): boolean {\n const cache = store.cache;\n const cached = cache.peekRequest(identifier);\n return !cached || !cached.response || isStale(cached.response.headers, this.config.apiCacheSoftExpires);\n }\n}\n\nexport class LifetimesService extends CachePolicy {\n constructor(config: PolicyConfig) {\n deprecate(\n `\\`import { LifetimesService } from '@ember-data-mirror/request-utils';\\` is deprecated, please use \\`import { CachePolicy } from '@ember-data-mirror/request-utils';\\` instead.`,\n false,\n {\n id: 'ember-data-mirror:deprecate-lifetimes-service-import',\n since: {\n enabled: '5.4',\n available: '5.4',\n },\n for: 'ember-data-mirror',\n until: '6.0',\n }\n );\n super(config);\n }\n}\n"],"names":["CONFIG","host","namespace","setBuildURLConfig","config","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","test","Error","endsWith","startsWith","OPERATIONS_WITH_PRIMARY_RECORDS","Set","isOperationWithPrimaryRecord","options","has","op","hasResourcePath","resourcePath","length","resourcePathForType","identifiers","type","identifier","buildBaseURL","urlOptions","Object","assign","Array","isArray","every","i","id","idPath","encodeURIComponent","fieldPath","String","join","includes","hasHost","url","filter","Boolean","DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS","arrayFormat","handleInclude","include","split","filterEmpty","source","result","key","value","undefined","sortQueryParams","params","opts","paramsIsObject","URLSearchParams","urlParams","dictionaryParams","forEach","hasExisting","existingValue","push","sortedKeys","keys","sort","v","append","buildQueryParams","toString","NUMERIC_KEYS","parseCacheControl","header","isParsingKey","cacheControlValue","parseCacheControlValue","stringToParse","parsedValue","Number","parseInt","isNaN","char","charAt","isStale","headers","expirationTime","date","get","time","Date","getTime","now","deadline","CachePolicy","_getStore","store","set","_stores","invalidated","types","Map","constructor","WeakMap","_config","arguments","deprecate","since","enabled","available","for","until","apiCacheSoftExpires","apiCacheHardExpires","invalidateRequest","add","invalidateRequestsForType","storeCache","notifications","notify","didRequest","request","response","statusNumber","status","records","map","r","additionalTypes","cacheOptions","delete","isHardExpired","cache","cached","peekRequest","isSoftExpired","LifetimesService"],"mappings":";;;AA6CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAOA,MAAMA,MAAsB,GAAG;AAC7BC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,SAAS,EAAE,EAAA;AACb,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,iBAAiBA,CAACC,MAAsB,EAAE;EACxDC,cAAA,CAAAC,eAAA,EAAAC,CAAAA,SAAA,CAAAC,GAAA,CAAAC,KAAA,CAAA,GAAA,CAAAC,IAAA,IAAA;AAAA,IAAA,IAAA,CAAAA,IAAA,EAAA;MAAA,MAAAC,IAAAA,KAAA,CAAQ,CAAiD,gDAAA,CAAA,CAAA,CAAA;AAAA,KAAA;AAAA,GAAA,EAAEP,MAAM,CAAA,GAAA,EAAA,CAAA;EACjEC,cAAA,CAAAC,eAAA,EAAAC,CAAAA,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M,GAAGD,KAAK,CAACE,WAAW,CAAChH,UAAU,CAAC,CAAA;IAC5C,OAAO,CAAC+G,MAAM,IAAI,CAACA,MAAM,CAACX,QAAQ,IAAItC,OAAO,CAACiD,MAAM,CAACX,QAAQ,CAACrC,OAAO,EAAE,IAAI,CAACrF,MAAM,CAACiH,mBAAmB,CAAC,CAAA;AACzG,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEsB,EAAAA,aAAaA,CAACjH,UAAoC,EAAE0E,KAAY,EAAW;AACzE,IAAA,MAAMoC,KAAK,GAAGpC,KAAK,CAACoC,KAAK,CAAA;AACzB,IAAA,MAAMC,MAAM,GAAGD,KAAK,CAACE,WAAW,CAAChH,UAAU,CAAC,CAAA;IAC5C,OAAO,CAAC+G,MAAM,IAAI,CAACA,MAAM,CAACX,QAAQ,IAAItC,OAAO,CAACiD,MAAM,CAACX,QAAQ,CAACrC,OAAO,EAAE,IAAI,CAACrF,MAAM,CAACgH,mBAAmB,CAAC,CAAA;AACzG,GAAA;AACF,CAAA;AAEO,MAAMwB,gBAAgB,SAAS1C,WAAW,CAAC;EAChDQ,WAAWA,CAACtG,MAAoB,EAAE;AAChC0G,IAAAA,SAAS,CACN,CAAA,iKAAA,CAAkK,EACnK,KAAK,EACL;AACE3E,MAAAA,EAAE,EAAE,+CAA+C;AACnD4E,MAAAA,KAAK,EAAE;AACLC,QAAAA,OAAO,EAAE,KAAK;AACdC,QAAAA,SAAS,EAAE,KAAA;OACZ;AACDC,MAAAA,GAAG,EAAE,YAAY;AACjBC,MAAAA,KAAK,EAAE,KAAA;AACT,KACF,CAAC,CAAA;IACD,KAAK,CAAC/G,MAAM,CAAC,CAAA;AACf,GAAA;AACF;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { deprecate } from '@ember/debug';\n\nimport { assert } from '@warp-drive-mirror/build-config/macros';\nimport type { StableRecordIdentifier } from '@warp-drive-mirror/core-types';\nimport type { Cache } from '@warp-drive-mirror/core-types/cache';\nimport type { StableDocumentIdentifier } from '@warp-drive-mirror/core-types/identifier';\nimport type { QueryParamsSerializationOptions, QueryParamsSource, Serializable } from '@warp-drive-mirror/core-types/params';\nimport type { ImmutableRequestInfo, ResponseInfo } from '@warp-drive-mirror/core-types/request';\n\ntype UnsubscribeToken = object;\ntype CacheOperation = 'added' | 'removed' | 'updated' | 'state';\ntype DocumentCacheOperation = 'invalidated' | 'added' | 'removed' | 'updated' | 'state';\n\nexport interface NotificationCallback {\n (identifier: StableRecordIdentifier, notificationType: 'attributes' | 'relationships', key?: string): void;\n (identifier: StableRecordIdentifier, notificationType: 'errors' | 'meta' | 'identity' | 'state'): void;\n // (identifier: StableRecordIdentifier, notificationType: NotificationType, key?: string): void;\n}\n\ninterface ResourceOperationCallback {\n // resource updates\n (identifier: StableRecordIdentifier, notificationType: CacheOperation): void;\n}\n\ninterface DocumentOperationCallback {\n // document updates\n (identifier: StableDocumentIdentifier, notificationType: DocumentCacheOperation): void;\n}\n\ntype NotificationManager = {\n subscribe(identifier: StableRecordIdentifier, callback: NotificationCallback): UnsubscribeToken;\n subscribe(identifier: 'resource', callback: ResourceOperationCallback): UnsubscribeToken;\n subscribe(identifier: 'document' | StableDocumentIdentifier, callback: DocumentOperationCallback): UnsubscribeToken;\n\n notify(identifier: StableRecordIdentifier, value: 'attributes' | 'relationships', key?: string): boolean;\n notify(identifier: StableRecordIdentifier, value: 'errors' | 'meta' | 'identity' | 'state'): boolean;\n notify(identifier: StableRecordIdentifier, value: CacheOperation): boolean;\n notify(identifier: StableDocumentIdentifier, value: DocumentCacheOperation): boolean;\n};\n\ntype Store = {\n cache: Cache;\n notifications: NotificationManager;\n};\n\n/**\n * Simple utility function to assist in url building,\n * query params, and other common request operations.\n *\n * These primitives may be used directly or composed\n * by request builders to provide a consistent interface\n * for building requests.\n *\n * For instance:\n *\n * ```ts\n * import { buildBaseURL, buildQueryParams } from '@ember-data-mirror/request-utils';\n *\n * const baseURL = buildBaseURL({\n * host: 'https://api.example.com',\n * namespace: 'api/v1',\n * resourcePath: 'emberDevelopers',\n * op: 'query',\n * identifier: { type: 'ember-developer' }\n * });\n * const url = `${baseURL}?${buildQueryParams({ name: 'Chris', include:['pets'] })}`;\n * // => 'https://api.example.com/api/v1/emberDevelopers?include=pets&name=Chris'\n * ```\n *\n * This is useful, but not as useful as the REST request builder for query which is sugar\n * over this (and more!):\n *\n * ```ts\n * import { query } from '@ember-data-mirror/rest/request';\n *\n * const options = query('ember-developer', { name: 'Chris', include:['pets'] });\n * // => { url: 'https://api.example.com/api/v1/emberDevelopers?include=pets&name=Chris' }\n * // Note: options will also include other request options like headers, method, etc.\n * ```\n *\n * @module @ember-data-mirror/request-utils\n * @main @ember-data-mirror/request-utils\n * @public\n */\n\n// prevents the final constructed object from needing to add\n// host and namespace which are provided by the final consuming\n// class to the prototype which can result in overwrite errors\n\nexport interface BuildURLConfig {\n host: string | null;\n namespace: string | null;\n}\n\nconst CONFIG: BuildURLConfig = {\n host: '',\n namespace: '',\n};\n\n/**\n * Sets the global configuration for `buildBaseURL`\n * for host and namespace values for the application.\n *\n * These values may still be overridden by passing\n * them to buildBaseURL directly.\n *\n * This method may be called as many times as needed.\n * host values of `''` or `'/'` are equivalent.\n *\n * Except for the value of `/` as host, host should not\n * end with `/`.\n *\n * namespace should not start or end with a `/`.\n *\n * ```ts\n * type BuildURLConfig = {\n * host: string;\n * namespace: string'\n * }\n * ```\n *\n * Example:\n *\n * ```ts\n * import { setBuildURLConfig } from '@ember-data-mirror/request-utils';\n *\n * setBuildURLConfig({\n * host: 'https://api.example.com',\n * namespace: 'api/v1'\n * });\n * ```\n *\n * @method setBuildURLConfig\n * @static\n * @public\n * @for @ember-data-mirror/request-utils\n * @param {BuildURLConfig} config\n * @return void\n */\nexport function setBuildURLConfig(config: BuildURLConfig) {\n assert(`setBuildURLConfig: You must pass a config object`, config);\n assert(\n `setBuildURLConfig: You must pass a config object with a 'host' or 'namespace' property`,\n 'host' in config || 'namespace' in config\n );\n\n CONFIG.host = config.host || '';\n CONFIG.namespace = config.namespace || '';\n\n assert(\n `buildBaseURL: host must NOT end with '/', received '${CONFIG.host}'`,\n CONFIG.host === '/' || !CONFIG.host.endsWith('/')\n );\n assert(\n `buildBaseURL: namespace must NOT start with '/', received '${CONFIG.namespace}'`,\n !CONFIG.namespace.startsWith('/')\n );\n assert(\n `buildBaseURL: namespace must NOT end with '/', received '${CONFIG.namespace}'`,\n !CONFIG.namespace.endsWith('/')\n );\n}\n\nexport interface FindRecordUrlOptions {\n op: 'findRecord';\n identifier: { type: string; id: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface QueryUrlOptions {\n op: 'query';\n identifier: { type: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface FindManyUrlOptions {\n op: 'findMany';\n identifiers: { type: string; id: string }[];\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\nexport interface FindRelatedCollectionUrlOptions {\n op: 'findRelatedCollection';\n identifier: { type: string; id: string };\n fieldPath: string;\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface FindRelatedResourceUrlOptions {\n op: 'findRelatedRecord';\n identifier: { type: string; id: string };\n fieldPath: string;\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface CreateRecordUrlOptions {\n op: 'createRecord';\n identifier: { type: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface UpdateRecordUrlOptions {\n op: 'updateRecord';\n identifier: { type: string; id: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface DeleteRecordUrlOptions {\n op: 'deleteRecord';\n identifier: { type: string; id: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface GenericUrlOptions {\n resourcePath: string;\n host?: string;\n namespace?: string;\n}\n\nexport type UrlOptions =\n | FindRecordUrlOptions\n | QueryUrlOptions\n | FindManyUrlOptions\n | FindRelatedCollectionUrlOptions\n | FindRelatedResourceUrlOptions\n | CreateRecordUrlOptions\n | UpdateRecordUrlOptions\n | DeleteRecordUrlOptions\n | GenericUrlOptions;\n\nconst OPERATIONS_WITH_PRIMARY_RECORDS = new Set([\n 'findRecord',\n 'findRelatedRecord',\n 'findRelatedCollection',\n 'updateRecord',\n 'deleteRecord',\n]);\n\nfunction isOperationWithPrimaryRecord(\n options: UrlOptions\n): options is\n | FindRecordUrlOptions\n | FindRelatedCollectionUrlOptions\n | FindRelatedResourceUrlOptions\n | UpdateRecordUrlOptions\n | DeleteRecordUrlOptions {\n return 'op' in options && OPERATIONS_WITH_PRIMARY_RECORDS.has(options.op);\n}\n\nfunction hasResourcePath(options: UrlOptions): options is GenericUrlOptions {\n return 'resourcePath' in options && typeof options.resourcePath === 'string' && options.resourcePath.length > 0;\n}\n\nfunction resourcePathForType(options: UrlOptions): string {\n assert(\n `resourcePathForType: You must pass a valid op as part of options`,\n 'op' in options && typeof options.op === 'string'\n );\n return options.op === 'findMany' ? options.identifiers[0].type : options.identifier.type;\n}\n\n/**\n * Builds a URL for a request based on the provided options.\n * Does not include support for building query params (see `buildQueryParams`)\n * so that it may be composed cleanly with other query-params strategies.\n *\n * Usage:\n *\n * ```ts\n * import { buildBaseURL } from '@ember-data-mirror/request-utils';\n *\n * const url = buildBaseURL({\n * host: 'https://api.example.com',\n * namespace: 'api/v1',\n * resourcePath: 'emberDevelopers',\n * op: 'query',\n * identifier: { type: 'ember-developer' }\n * });\n *\n * // => 'https://api.example.com/api/v1/emberDevelopers'\n * ```\n *\n * On the surface this may seem like a lot of work to do something simple, but\n * it is designed to be composable with other utilities and interfaces that the\n * average product engineer will never need to see or use.\n *\n * A few notes:\n *\n * - `resourcePath` is optional, but if it is not provided, `identifier.type` will be used.\n * - `host` and `namespace` are optional, but if they are not provided, the values globally\n * configured via `setBuildURLConfig` will be used.\n * - `op` is required and must be one of the following:\n * - 'findRecord' 'query' 'findMany' 'findRelatedCollection' 'findRelatedRecord'` 'createRecord' 'updateRecord' 'deleteRecord'\n * - Depending on the value of `op`, `identifier` or `identifiers` will be required.\n *\n * @method buildBaseURL\n * @static\n * @public\n * @for @ember-data-mirror/request-utils\n * @param urlOptions\n * @return string\n */\nexport function buildBaseURL(urlOptions: UrlOptions): string {\n const options = Object.assign(\n {\n host: CONFIG.host,\n namespace: CONFIG.namespace,\n },\n urlOptions\n );\n assert(\n `buildBaseURL: You must pass \\`op\\` as part of options`,\n hasResourcePath(options) || (typeof options.op === 'string' && options.op.length > 0)\n );\n assert(\n `buildBaseURL: You must pass \\`identifier\\` as part of options`,\n hasResourcePath(options) ||\n options.op === 'findMany' ||\n (options.identifier && typeof options.identifier === 'object')\n );\n assert(\n `buildBaseURL: You must pass \\`identifiers\\` as part of options`,\n hasResourcePath(options) ||\n options.op !== 'findMany' ||\n (options.identifiers &&\n Array.isArray(options.identifiers) &&\n options.identifiers.length > 0 &&\n options.identifiers.every((i) => i && typeof i === 'object'))\n );\n assert(\n `buildBaseURL: You must pass valid \\`identifier\\` as part of options, expected 'id'`,\n hasResourcePath(options) ||\n !isOperationWithPrimaryRecord(options) ||\n (typeof options.identifier.id === 'string' && options.identifier.id.length > 0)\n );\n assert(\n `buildBaseURL: You must pass \\`identifiers\\` as part of options`,\n hasResourcePath(options) ||\n options.op !== 'findMany' ||\n options.identifiers.every((i) => typeof i.id === 'string' && i.id.length > 0)\n );\n assert(\n `buildBaseURL: You must pass valid \\`identifier\\` as part of options, expected 'type'`,\n hasResourcePath(options) ||\n options.op === 'findMany' ||\n (typeof options.identifier.type === 'string' && options.identifier.type.length > 0)\n );\n assert(\n `buildBaseURL: You must pass valid \\`identifiers\\` as part of options, expected 'type'`,\n hasResourcePath(options) ||\n options.op !== 'findMany' ||\n (typeof options.identifiers[0].type === 'string' && options.identifiers[0].type.length > 0)\n );\n\n // prettier-ignore\n const idPath: string =\n isOperationWithPrimaryRecord(options) ? encodeURIComponent(options.identifier.id)\n : '';\n const resourcePath = options.resourcePath || resourcePathForType(options);\n const { host, namespace } = options;\n const fieldPath = 'fieldPath' in options ? options.fieldPath : '';\n\n assert(\n `buildBaseURL: You tried to build a url for a ${String(\n 'op' in options ? options.op + ' ' : ''\n )}request to ${resourcePath} but resourcePath must be set or op must be one of \"${[\n 'findRecord',\n 'findRelatedRecord',\n 'findRelatedCollection',\n 'updateRecord',\n 'deleteRecord',\n 'createRecord',\n 'query',\n 'findMany',\n ].join('\",\"')}\".`,\n hasResourcePath(options) ||\n [\n 'findRecord',\n 'query',\n 'findMany',\n 'findRelatedCollection',\n 'findRelatedRecord',\n 'createRecord',\n 'updateRecord',\n 'deleteRecord',\n ].includes(options.op)\n );\n\n assert(`buildBaseURL: host must NOT end with '/', received '${host}'`, host === '/' || !host.endsWith('/'));\n assert(`buildBaseURL: namespace must NOT start with '/', received '${namespace}'`, !namespace.startsWith('/'));\n assert(`buildBaseURL: namespace must NOT end with '/', received '${namespace}'`, !namespace.endsWith('/'));\n assert(\n `buildBaseURL: resourcePath must NOT start with '/', received '${resourcePath}'`,\n !resourcePath.startsWith('/')\n );\n assert(`buildBaseURL: resourcePath must NOT end with '/', received '${resourcePath}'`, !resourcePath.endsWith('/'));\n assert(`buildBaseURL: fieldPath must NOT start with '/', received '${fieldPath}'`, !fieldPath.startsWith('/'));\n assert(`buildBaseURL: fieldPath must NOT end with '/', received '${fieldPath}'`, !fieldPath.endsWith('/'));\n assert(`buildBaseURL: idPath must NOT start with '/', received '${idPath}'`, !idPath.startsWith('/'));\n assert(`buildBaseURL: idPath must NOT end with '/', received '${idPath}'`, !idPath.endsWith('/'));\n\n const hasHost = host !== '' && host !== '/';\n const url = [hasHost ? host : '', namespace, resourcePath, idPath, fieldPath].filter(Boolean).join('/');\n return hasHost ? url : `/${url}`;\n}\n\nconst DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS: QueryParamsSerializationOptions = {\n arrayFormat: 'comma',\n};\n\nfunction handleInclude(include: string | string[]): string[] {\n assert(\n `Expected include to be a string or array, got ${typeof include}`,\n typeof include === 'string' || Array.isArray(include)\n );\n return typeof include === 'string' ? include.split(',') : include;\n}\n\n/**\n * filter out keys of an object that have falsy values or point to empty arrays\n * returning a new object with only those keys that have truthy values / non-empty arrays\n *\n * @method filterEmpty\n * @static\n * @public\n * @for @ember-data-mirror/request-utils\n * @param {Record<string, Serializable>} source object to filter keys with empty values from\n * @return {Record<string, Serializable>} A new object with the keys that contained empty values removed\n */\nexport function filterEmpty(source: Record<string, Serializable>): Record<string, Serializable> {\n const result: Record<string, Serializable> = {};\n for (const key in source) {\n const value = source[key];\n // Allow `0` and `false` but filter falsy values that indicate \"empty\"\n if (value !== undefined && value !== null && value !== '') {\n if (!Array.isArray(value) || value.length > 0) {\n result[key] = source[key];\n }\n }\n }\n return result;\n}\n\n/**\n * Sorts query params by both key and value returning a new URLSearchParams\n * object with the keys inserted in sorted order.\n *\n * Treats `included` specially, splicing it into an array if it is a string and sorting the array.\n *\n * Options:\n * - arrayFormat: 'bracket' | 'indices' | 'repeat' | 'comma'\n *\n * 'bracket': appends [] to the key for every value e.g. `&ids[]=1&ids[]=2`\n * 'indices': appends [i] to the key for every value e.g. `&ids[0]=1&ids[1]=2`\n * 'repeat': appends the key for every value e.g. `&ids=1&ids=2`\n * 'comma' (default): appends the key once with a comma separated list of values e.g. `&ids=1,2`\n *\n * @method sortQueryParams\n * @static\n * @public\n * @for @ember-data-mirror/request-utils\n * @param {URLSearchParams | object} params\n * @param {object} options\n * @return {URLSearchParams} A URLSearchParams with keys inserted in sorted order\n */\nexport function sortQueryParams(params: QueryParamsSource, options?: QueryParamsSerializationOptions): URLSearchParams {\n const opts = Object.assign({}, DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS, options);\n const paramsIsObject = !(params instanceof URLSearchParams);\n const urlParams = new URLSearchParams();\n const dictionaryParams: Record<string, Serializable> = paramsIsObject ? params : {};\n\n if (!paramsIsObject) {\n params.forEach((value, key) => {\n const hasExisting = key in dictionaryParams;\n if (!hasExisting) {\n dictionaryParams[key] = value;\n } else {\n const existingValue = dictionaryParams[key];\n if (Array.isArray(existingValue)) {\n existingValue.push(value);\n } else {\n dictionaryParams[key] = [existingValue, value];\n }\n }\n });\n }\n\n if ('include' in dictionaryParams) {\n dictionaryParams.include = handleInclude(dictionaryParams.include as string | string[]);\n }\n\n const sortedKeys = Object.keys(dictionaryParams).sort();\n sortedKeys.forEach((key) => {\n const value = dictionaryParams[key];\n if (Array.isArray(value)) {\n value.sort();\n switch (opts.arrayFormat) {\n case 'indices':\n value.forEach((v, i) => {\n urlParams.append(`${key}[${i}]`, String(v));\n });\n return;\n case 'bracket':\n value.forEach((v) => {\n urlParams.append(`${key}[]`, String(v));\n });\n return;\n case 'repeat':\n value.forEach((v) => {\n urlParams.append(key, String(v));\n });\n return;\n case 'comma':\n default:\n urlParams.append(key, value.join(','));\n return;\n }\n } else {\n urlParams.append(key, String(value));\n }\n });\n\n return urlParams;\n}\n\n/**\n * Sorts query params by both key and value, returning a query params string\n *\n * Treats `included` specially, splicing it into an array if it is a string and sorting the array.\n *\n * Options:\n * - arrayFormat: 'bracket' | 'indices' | 'repeat' | 'comma'\n *\n * 'bracket': appends [] to the key for every value e.g. `ids[]=1&ids[]=2`\n * 'indices': appends [i] to the key for every value e.g. `ids[0]=1&ids[1]=2`\n * 'repeat': appends the key for every value e.g. `ids=1&ids=2`\n * 'comma' (default): appends the key once with a comma separated list of values e.g. `ids=1,2`\n *\n * @method buildQueryParams\n * @static\n * @public\n * @for @ember-data-mirror/request-utils\n * @param {URLSearchParams | object} params\n * @param {object} [options]\n * @return {string} A sorted query params string without the leading `?`\n */\nexport function buildQueryParams(params: QueryParamsSource, options?: QueryParamsSerializationOptions): string {\n return sortQueryParams(params, options).toString();\n}\nexport interface CacheControlValue {\n immutable?: boolean;\n 'max-age'?: number;\n 'must-revalidate'?: boolean;\n 'must-understand'?: boolean;\n 'no-cache'?: boolean;\n 'no-store'?: boolean;\n 'no-transform'?: boolean;\n 'only-if-cached'?: boolean;\n private?: boolean;\n 'proxy-revalidate'?: boolean;\n public?: boolean;\n 's-maxage'?: number;\n 'stale-if-error'?: number;\n 'stale-while-revalidate'?: number;\n}\n\ntype CacheControlKey = keyof CacheControlValue;\n\nconst NUMERIC_KEYS = new Set(['max-age', 's-maxage', 'stale-if-error', 'stale-while-revalidate']);\n\n/**\n * Parses a string Cache-Control header value into an object with the following structure:\n *\n * ```ts\n * interface CacheControlValue {\n * immutable?: boolean;\n * 'max-age'?: number;\n * 'must-revalidate'?: boolean;\n * 'must-understand'?: boolean;\n * 'no-cache'?: boolean;\n * 'no-store'?: boolean;\n * 'no-transform'?: boolean;\n * 'only-if-cached'?: boolean;\n * private?: boolean;\n * 'proxy-revalidate'?: boolean;\n * public?: boolean;\n * 's-maxage'?: number;\n * 'stale-if-error'?: number;\n * 'stale-while-revalidate'?: number;\n * }\n * ```\n * @method parseCacheControl\n * @static\n * @public\n * @for @ember-data-mirror/request-utils\n * @param {string} header\n * @return {CacheControlValue}\n */\nexport function parseCacheControl(header: string): CacheControlValue {\n let key: CacheControlKey = '' as CacheControlKey;\n let value = '';\n let isParsingKey = true;\n const cacheControlValue: CacheControlValue = {};\n\n function parseCacheControlValue(stringToParse: string): number {\n const parsedValue = Number.parseInt(stringToParse);\n assert(`Invalid Cache-Control value, expected a number but got - ${stringToParse}`, !Number.isNaN(parsedValue));\n return parsedValue;\n }\n\n for (let i = 0; i < header.length; i++) {\n const char = header.charAt(i);\n if (char === ',') {\n assert(`Invalid Cache-Control value, expected a value`, !isParsingKey || !NUMERIC_KEYS.has(key));\n assert(\n `Invalid Cache-Control value, expected a value after \"=\" but got \",\"`,\n i === 0 || header.charAt(i - 1) !== '='\n );\n isParsingKey = true;\n // @ts-expect-error TS incorrectly thinks that optional keys must have a type that includes undefined\n cacheControlValue[key] = NUMERIC_KEYS.has(key) ? parseCacheControlValue(value) : true;\n key = '' as CacheControlKey;\n value = '';\n continue;\n } else if (char === '=') {\n assert(`Invalid Cache-Control value, expected a value after \"=\"`, i + 1 !== header.length);\n isParsingKey = false;\n } else if (char === ' ' || char === `\\t` || char === `\\n`) {\n continue;\n } else if (isParsingKey) {\n key += char;\n } else {\n value += char;\n }\n\n if (i === header.length - 1) {\n // @ts-expect-error TS incorrectly thinks that optional keys must have a type that includes undefined\n cacheControlValue[key] = NUMERIC_KEYS.has(key) ? parseCacheControlValue(value) : true;\n }\n }\n\n return cacheControlValue;\n}\n\nfunction isStale(headers: Headers, expirationTime: number): boolean {\n // const age = headers.get('age');\n // const cacheControl = parseCacheControl(headers.get('cache-control') || '');\n // const expires = headers.get('expires');\n // const lastModified = headers.get('last-modified');\n const date = headers.get('date');\n\n if (!date) {\n return true;\n }\n\n const time = new Date(date).getTime();\n const now = Date.now();\n const deadline = time + expirationTime;\n\n const result = now > deadline;\n\n return result;\n}\n\nexport type PolicyConfig = { apiCacheSoftExpires: number; apiCacheHardExpires: number };\n\n/**\n * A basic CachePolicy that can be added to the Store service.\n *\n * Determines staleness based on time since the request was last received from the API\n * using the `date` header.\n *\n * Invalidates any request for which `cacheOptions.types` was provided when a createRecord\n * request for that type is successful.\n *\n * For this to work, the `createRecord` request must include the `cacheOptions.types` array\n * with the types that should be invalidated, or its request should specify the identifiers\n * of the records that are being created via `records`. Providing both is valid.\n *\n * > [!NOTE]\n * > only requests that had specified `cacheOptions.types` and occurred prior to the\n * > createRecord request will be invalidated. This means that a given request should always\n * > specify the types that would invalidate it to opt into this behavior. Abstracting this\n * > behavior via builders is recommended to ensure consistency.\n *\n * This allows the Store's CacheHandler to determine if a request is expired and\n * should be refetched upon next request.\n *\n * The `Fetch` handler provided by `@ember-data-mirror/request/fetch` will automatically\n * add the `date` header to responses if it is not present.\n *\n * > [!NOTE]\n * > Date headers do not have millisecond precision, so expiration times should\n * > generally be larger than 1000ms.\n *\n * Usage:\n *\n * ```ts\n * import { CachePolicy } from '@ember-data-mirror/request-utils';\n * import DataStore from '@ember-data-mirror/store';\n *\n * // ...\n *\n * export class Store extends DataStore {\n * constructor(args) {\n * super(args);\n * this.lifetimes = new CachePolicy({ apiCacheSoftExpires: 30_000, apiCacheHardExpires: 60_000 });\n * }\n * }\n * ```\n *\n * @class CachePolicy\n * @public\n * @module @ember-data-mirror/request-utils\n */\nexport class CachePolicy {\n declare config: PolicyConfig;\n declare _stores: WeakMap<\n Store,\n { invalidated: Set<StableDocumentIdentifier>; types: Map<string, Set<StableDocumentIdentifier>> }\n >;\n\n _getStore(store: Store): {\n invalidated: Set<StableDocumentIdentifier>;\n types: Map<string, Set<StableDocumentIdentifier>>;\n } {\n let set = this._stores.get(store);\n if (!set) {\n set = { invalidated: new Set(), types: new Map() };\n this._stores.set(store, set);\n }\n return set;\n }\n\n constructor(config: PolicyConfig) {\n this._stores = new WeakMap();\n\n const _config = arguments.length === 1 ? config : (arguments[1] as unknown as PolicyConfig);\n deprecate(\n `Passing a Store to the CachePolicy is deprecated, please pass only a config instead.`,\n arguments.length === 1,\n {\n id: 'ember-data-mirror:request-utils:lifetimes-service-store-arg',\n since: {\n enabled: '5.4',\n available: '4.13',\n },\n for: '@ember-data-mirror/request-utils',\n until: '6.0',\n }\n );\n assert(`You must pass a config to the CachePolicy`, _config);\n assert(`You must pass a apiCacheSoftExpires to the CachePolicy`, typeof _config.apiCacheSoftExpires === 'number');\n assert(`You must pass a apiCacheHardExpires to the CachePolicy`, typeof _config.apiCacheHardExpires === 'number');\n this.config = _config;\n }\n\n /**\n * Invalidate a request by its identifier for a given store instance.\n *\n * While the store argument may seem redundant, the CachePolicy\n * is designed to be shared across multiple stores / forks\n * of the store.\n *\n * ```ts\n * store.lifetimes.invalidateRequest(store, identifier);\n * ```\n *\n * @method invalidateRequest\n * @public\n * @param {StableDocumentIdentifier} identifier\n * @param {Store} store\n */\n invalidateRequest(identifier: StableDocumentIdentifier, store: Store): void {\n this._getStore(store).invalidated.add(identifier);\n }\n\n /**\n * Invalidate all requests associated to a specific type\n * for a given store instance.\n *\n * While the store argument may seem redundant, the CachePolicy\n * is designed to be shared across multiple stores / forks\n * of the store.\n *\n * This invalidation is done automatically when using this service\n * for both the CacheHandler and the LegacyNetworkHandler.\n *\n * ```ts\n * store.lifetimes.invalidateRequestsForType(store, 'person');\n * ```\n *\n * @method invalidateRequestsForType\n * @public\n * @param {string} type\n * @param {Store} store\n */\n invalidateRequestsForType(type: string, store: Store): void {\n const storeCache = this._getStore(store);\n const set = storeCache.types.get(type);\n const notifications = store.notifications;\n\n if (set) {\n // TODO batch notifications\n set.forEach((id) => {\n storeCache.invalidated.add(id);\n notifications.notify(id, 'invalidated');\n });\n }\n }\n\n /**\n * Invoked when a request has been fulfilled from the configured request handlers.\n * This is invoked by the CacheHandler for both foreground and background requests\n * once the cache has been updated.\n *\n * Note, this is invoked by the CacheHandler regardless of whether\n * the request has a cache-key.\n *\n * This method should not be invoked directly by consumers.\n *\n * @method didRequest\n * @public\n * @param {ImmutableRequestInfo} request\n * @param {ImmutableResponse} response\n * @param {Store} store\n * @param {StableDocumentIdentifier | null} identifier\n * @return {void}\n */\n didRequest(\n request: ImmutableRequestInfo,\n response: Response | ResponseInfo | null,\n identifier: StableDocumentIdentifier | null,\n store: Store\n ): void {\n // if this is a successful createRecord request, invalidate the cacheKey for the type\n if (request.op === 'createRecord') {\n const statusNumber = response?.status ?? 0;\n if (statusNumber >= 200 && statusNumber < 400) {\n const types = new Set(request.records?.map((r) => r.type));\n const additionalTypes = request.cacheOptions?.types;\n additionalTypes?.forEach((type) => {\n types.add(type);\n });\n\n types.forEach((type) => {\n this.invalidateRequestsForType(type, store);\n });\n }\n\n // add this document's cacheKey to a map for all associated types\n // it is recommended to only use this for queries\n } else if (identifier && request.cacheOptions?.types?.length) {\n const storeCache = this._getStore(store);\n request.cacheOptions?.types.forEach((type) => {\n const set = storeCache.types.get(type);\n if (set) {\n set.add(identifier);\n storeCache.invalidated.delete(identifier);\n } else {\n storeCache.types.set(type, new Set([identifier]));\n }\n });\n }\n }\n\n /**\n * Invoked to determine if the request may be fulfilled from cache\n * if possible.\n *\n * Note, this is only invoked by the CacheHandler if the request has\n * a cache-key.\n *\n * If no cache entry is found or the entry is hard expired,\n * the request will be fulfilled from the configured request handlers\n * and the cache will be updated before returning the response.\n *\n * @method isHardExpired\n * @public\n * @param {StableDocumentIdentifier} identifier\n * @param {Store} store\n * @return {boolean} true if the request is considered hard expired\n */\n isHardExpired(identifier: StableDocumentIdentifier, store: Store): boolean {\n // if we are explicitly invalidated, we are hard expired\n const storeCache = this._getStore(store);\n if (storeCache.invalidated.has(identifier)) {\n return true;\n }\n const cache = store.cache;\n const cached = cache.peekRequest(identifier);\n return !cached || !cached.response || isStale(cached.response.headers, this.config.apiCacheHardExpires);\n }\n\n /**\n * Invoked if `isHardExpired` is false to determine if the request\n * should be update behind the scenes if cache data is already available.\n *\n * Note, this is only invoked by the CacheHandler if the request has\n * a cache-key.\n *\n * If true, the request will be fulfilled from cache while a backgrounded\n * request is made to update the cache via the configured request handlers.\n *\n * @method isSoftExpired\n * @public\n * @param {StableDocumentIdentifier} identifier\n * @param {Store} store\n * @return {boolean} true if the request is considered soft expired\n */\n isSoftExpired(identifier: StableDocumentIdentifier, store: Store): boolean {\n const cache = store.cache;\n const cached = cache.peekRequest(identifier);\n return !cached || !cached.response || isStale(cached.response.headers, this.config.apiCacheSoftExpires);\n }\n}\n\nexport class LifetimesService extends CachePolicy {\n constructor(config: PolicyConfig) {\n deprecate(\n `\\`import { LifetimesService } from '@ember-data-mirror/request-utils';\\` is deprecated, please use \\`import { CachePolicy } from '@ember-data-mirror/request-utils';\\` instead.`,\n false,\n {\n id: 'ember-data-mirror:deprecate-lifetimes-service-import',\n since: {\n enabled: '5.4',\n available: '4.13',\n },\n for: 'ember-data-mirror',\n until: '6.0',\n }\n );\n super(config);\n }\n}\n"],"names":["CONFIG","host","namespace","setBuildURLConfig","config","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","test","Error","endsWith","startsWith","OPERATIONS_WITH_PRIMARY_RECORDS","Set","isOperationWithPrimaryRecord","options","has","op","hasResourcePath","resourcePath","length","resourcePathForType","identifiers","type","identifier","buildBaseURL","urlOptions","Object","assign","Array","isArray","every","i","id","idPath","encodeURIComponent","fieldPath","String","join","includes","hasHost","url","filter","Boolean","DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS","arrayFormat","handleInclude","include","split","filterEmpty","source","result","key","value","undefined","sortQueryParams","params","opts","paramsIsObject","URLSearchParams","urlParams","dictionaryParams","forEach","hasExisting","existingValue","push","sortedKeys","keys","sort","v","append","buildQueryParams","toString","NUMERIC_KEYS","parseCacheControl","header","isParsingKey","cacheControlValue","parseCacheControlValue","stringToParse","parsedValue","Number","parseInt","isNaN","char","charAt","isStale","headers","expirationTime","date","get","time","Date","getTime","now","deadline","CachePolicy","_getStore","store","set","_stores","invalidated","types","Map","constructor","WeakMap","_config","arguments","deprecate","since","enabled","available","for","until","apiCacheSoftExpires","apiCacheHardExpires","invalidateRequest","add","invalidateRequestsForType","storeCache","notifications","notify","didRequest","request","response","statusNumber","status","records","map","r","additionalTypes","cacheOptions","delete","isHardExpired","cache","cached","peekRequest","isSoftExpired","LifetimesService"],"mappings":";;;AA6CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAOA,MAAMA,MAAsB,GAAG;AAC7BC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,SAAS,EAAE,EAAA;AACb,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,iBAAiB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AK;AACdC,QAAAA,SAAS,EAAE,MAAA;OACZ;AACDC,MAAAA,GAAG,EAAE,YAAY;AACjBC,MAAAA,KAAK,EAAE,KAAA;AACT,KACF,CAAC,CAAA;IACD,KAAK,CAAC/G,MAAM,CAAC,CAAA;AACf,GAAA;AACF;;;;"}
@@ -13,7 +13,7 @@ class LRUCache {
13
13
  this.size = size || DEFAULT_MAX_CACHE_SIZE;
14
14
  this.state = new Map();
15
15
  this.doWork = doWork;
16
- if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
16
+ if (macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG)) {
17
17
  this._hits = 0;
18
18
  this._misses = 0;
19
19
  this._ejected = 0;
@@ -22,14 +22,14 @@ class LRUCache {
22
22
  get(key) {
23
23
  const value = this.state.get(key);
24
24
  if (value) {
25
- if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
25
+ if (macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG)) {
26
26
  this._hits++;
27
27
  }
28
28
  this.state.delete(key);
29
29
  this.state.set(key, value);
30
30
  return value;
31
31
  }
32
- if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
32
+ if (macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG)) {
33
33
  this._misses++;
34
34
  }
35
35
  const newValue = this.doWork(key);
@@ -39,7 +39,7 @@ class LRUCache {
39
39
  set(key, value) {
40
40
  if (this.state.size === this.size) {
41
41
  for (const [k] of this.state) {
42
- if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
42
+ if (macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG)) {
43
43
  this._ejected++;
44
44
  }
45
45
  this.state.delete(k);
@@ -50,7 +50,7 @@ class LRUCache {
50
50
  }
51
51
  clear() {
52
52
  this.state.clear();
53
- if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
53
+ if (macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG)) {
54
54
  this._hits = 0;
55
55
  this._misses = 0;
56
56
  this._ejected = 0;
@@ -219,7 +219,7 @@ function clearRules() {
219
219
  PLURAL_RULES.clear();
220
220
  }
221
221
  function singularize(word) {
222
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
222
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
223
223
  if (!test) {
224
224
  throw new Error(`singularize expects to receive a non-empty string`);
225
225
  }
@@ -228,7 +228,7 @@ function singularize(word) {
228
228
  return SINGULARS.get(word);
229
229
  }
230
230
  function pluralize(word) {
231
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
231
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
232
232
  if (!test) {
233
233
  throw new Error(`pluralize expects to receive a non-empty string`);
234
234
  }
@@ -1 +1 @@
1
- {"version":3,"file":"inflect-8aYUyMN7.js","sources":["../src/-private/string/inflections.ts","../src/-private/string/transform.ts","../src/-private/string/inflect.ts"],"sourcesContent":["export type RulesArray = Array<[RegExp, string]>;\ntype DefaultRulesType = {\n plurals: RulesArray;\n singular: RulesArray;\n irregularPairs: Array<[string, string]>;\n uncountable: string[];\n};\n\nexport const defaultRules: DefaultRulesType = {\n plurals: [\n [/$/, 's'],\n [/s$/i, 's'],\n [/^(ax|test)is$/i, '$1es'],\n [/(octop|vir)us$/i, '$1i'],\n [/(octop|vir)i$/i, '$1i'],\n [/(alias|status|bonus)$/i, '$1es'],\n [/(bu)s$/i, '$1ses'],\n [/(buffal|tomat)o$/i, '$1oes'],\n [/([ti])um$/i, '$1a'],\n [/([ti])a$/i, '$1a'],\n [/sis$/i, 'ses'],\n [/(?:([^f])fe|([lr])f)$/i, '$1$2ves'],\n [/(hive)$/i, '$1s'],\n [/([^aeiouy]|qu)y$/i, '$1ies'],\n [/(x|ch|ss|sh)$/i, '$1es'],\n [/(matr|vert|ind)(?:ix|ex)$/i, '$1ices'],\n [/^(m|l)ouse$/i, '$1ice'],\n [/^(m|l)ice$/i, '$1ice'],\n [/^(ox)$/i, '$1en'],\n [/^(oxen)$/i, '$1'],\n [/(quiz)$/i, '$1zes'],\n ],\n\n singular: [\n [/s$/i, ''],\n [/(ss)$/i, '$1'],\n [/(n)ews$/i, '$1ews'],\n [/([ti])a$/i, '$1um'],\n [/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i, '$1sis'],\n [/(^analy)(sis|ses)$/i, '$1sis'],\n [/([^f])ves$/i, '$1fe'],\n [/(hive)s$/i, '$1'],\n [/(tive)s$/i, '$1'],\n [/([lr])ves$/i, '$1f'],\n [/([^aeiouy]|qu)ies$/i, '$1y'],\n [/(s)eries$/i, '$1eries'],\n [/(m)ovies$/i, '$1ovie'],\n [/(x|ch|ss|sh)es$/i, '$1'],\n [/^(m|l)ice$/i, '$1ouse'],\n [/(bus)(es)?$/i, '$1'],\n [/(o)es$/i, '$1'],\n [/(shoe)s$/i, '$1'],\n [/(cris|test)(is|es)$/i, '$1is'],\n [/^(a)x[ie]s$/i, '$1xis'],\n [/(octop|vir)(us|i)$/i, '$1us'],\n [/(alias|status|bonus)(es)?$/i, '$1'],\n [/^(ox)en/i, '$1'],\n [/(vert|ind)ices$/i, '$1ex'],\n [/(matr)ices$/i, '$1ix'],\n [/(quiz)zes$/i, '$1'],\n [/(database)s$/i, '$1'],\n ],\n\n irregularPairs: [\n ['person', 'people'],\n ['man', 'men'],\n ['child', 'children'],\n ['sex', 'sexes'],\n ['move', 'moves'],\n ['cow', 'kine'],\n ['zombie', 'zombies'],\n ],\n\n uncountable: ['equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep', 'jeans', 'police'],\n};\n","import { DEBUG } from '@warp-drive-mirror/build-config/env';\n\nconst DEFAULT_MAX_CACHE_SIZE = 10_000;\nexport class LRUCache<T, V> {\n declare size: number;\n declare state: Map<T, V>;\n declare doWork: (k: T) => V;\n\n // debug stats\n declare _hits: number;\n declare _misses: number;\n declare _ejected: number;\n\n constructor(doWork: (k: T) => V, size?: number) {\n this.size = size || DEFAULT_MAX_CACHE_SIZE;\n this.state = new Map();\n this.doWork = doWork;\n\n if (DEBUG) {\n this._hits = 0;\n this._misses = 0;\n this._ejected = 0;\n }\n }\n get(key: T) {\n const value = this.state.get(key);\n if (value) {\n if (DEBUG) {\n this._hits++;\n }\n this.state.delete(key);\n this.state.set(key, value);\n return value;\n }\n if (DEBUG) {\n this._misses++;\n }\n\n const newValue = this.doWork(key);\n this.set(key, newValue);\n return newValue;\n }\n\n set(key: T, value: V) {\n if (this.state.size === this.size) {\n for (const [k] of this.state) {\n if (DEBUG) {\n this._ejected++;\n }\n this.state.delete(k);\n break;\n }\n }\n this.state.set(key, value);\n }\n\n clear() {\n this.state.clear();\n if (DEBUG) {\n this._hits = 0;\n this._misses = 0;\n this._ejected = 0;\n }\n }\n}\n\nconst STRING_DASHERIZE_REGEXP = /[ _]/g;\nconst STRING_DECAMELIZE_REGEXP = /([a-z\\d])([A-Z])/g;\nconst STRING_DASHERIZE_CACHE = new LRUCache<string, string>((key: string) =>\n key.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase().replace(STRING_DASHERIZE_REGEXP, '-')\n);\n\n// eslint-disable-next-line no-useless-escape\nconst STRING_CAMELIZE_REGEXP_1 = /(\\-|\\_|\\.|\\s)+(.)?/g;\nconst STRING_CAMELIZE_REGEXP_2 = /(^|\\/)([A-Z])/g;\nconst CAMELIZE_CACHE = new LRUCache<string, string>((key: string) =>\n key\n .replace(STRING_CAMELIZE_REGEXP_1, (_match, _separator, chr: string | null) => (chr ? chr.toUpperCase() : ''))\n .replace(STRING_CAMELIZE_REGEXP_2, (match /*, separator, chr */) => match.toLowerCase())\n);\n\nconst STRING_UNDERSCORE_REGEXP_1 = /([a-z\\d])([A-Z]+)/g;\n// eslint-disable-next-line no-useless-escape\nconst STRING_UNDERSCORE_REGEXP_2 = /\\-|\\s+/g;\nconst UNDERSCORE_CACHE = new LRUCache<string, string>((str: string) =>\n str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase()\n);\n\nconst STRING_CAPITALIZE_REGEXP = /(^|\\/)([a-z\\u00C0-\\u024F])/g;\nconst CAPITALIZE_CACHE = new LRUCache<string, string>((str: string) =>\n str.replace(STRING_CAPITALIZE_REGEXP, (match /*, separator, chr */) => match.toUpperCase())\n);\n\n/**\n Replaces underscores, spaces, or camelCase with dashes.\n\n ```js\n import { dasherize } from '@ember-data-mirror/request-utils/string';\n\n dasherize('innerHTML'); // 'inner-html'\n dasherize('action_name'); // 'action-name'\n dasherize('css-class-name'); // 'css-class-name'\n dasherize('my favorite items'); // 'my-favorite-items'\n dasherize('privateDocs/ownerInvoice'; // 'private-docs/owner-invoice'\n ```\n\n @typedoc\n*/\nexport function dasherize(str: string): string {\n return STRING_DASHERIZE_CACHE.get(str);\n}\n\n/**\n Returns the lowerCamelCase form of a string.\n\n ```js\n import { camelize } from '@ember-data-mirror/request-utils/string';\n\n camelize('innerHTML'); // 'innerHTML'\n camelize('action_name'); // 'actionName'\n camelize('css-class-name'); // 'cssClassName'\n camelize('my favorite items'); // 'myFavoriteItems'\n camelize('My Favorite Items'); // 'myFavoriteItems'\n camelize('private-docs/owner-invoice'); // 'privateDocs/ownerInvoice'\n```\n\n @typedoc\n*/\nexport function camelize(str: string): string {\n return CAMELIZE_CACHE.get(str);\n}\n\n/**\n Returns the lower\\_case\\_and\\_underscored form of a string.\n\n ```js\n import { underscore } from '@ember-data-mirror/request-utils/string';\n\n underscore('innerHTML'); // 'inner_html'\n underscore('action_name'); // 'action_name'\n underscore('css-class-name'); // 'css_class_name'\n underscore('my favorite items'); // 'my_favorite_items'\n underscore('privateDocs/ownerInvoice'); // 'private_docs/owner_invoice'\n ```\n\n @typedoc\n*/\nexport function underscore(str: string): string {\n return UNDERSCORE_CACHE.get(str);\n}\n\n/**\n Returns the Capitalized form of a string\n\n ```js\n import { capitalize } from '@ember-data-mirror/request-utils/string';\n\n capitalize('innerHTML') // 'InnerHTML'\n capitalize('action_name') // 'Action_name'\n capitalize('css-class-name') // 'Css-class-name'\n capitalize('my favorite items') // 'My favorite items'\n capitalize('privateDocs/ownerInvoice'); // 'PrivateDocs/ownerInvoice'\n ```\n\n @typedoc\n*/\nexport function capitalize(str: string): string {\n return CAPITALIZE_CACHE.get(str);\n}\n\nexport function setMaxLRUCacheSize(size: number) {\n CAMELIZE_CACHE.size = size;\n UNDERSCORE_CACHE.size = size;\n CAPITALIZE_CACHE.size = size;\n STRING_DASHERIZE_CACHE.size = size;\n}\n","import { assert } from '@warp-drive-mirror/build-config/macros';\n\nimport { defaultRules } from './inflections';\nimport { capitalize, LRUCache } from './transform';\n\nconst BLANK_REGEX = /^\\s*$/;\nconst LAST_WORD_DASHED_REGEX = /([\\w/-]+[_/\\s-])([a-z\\d]+$)/;\nconst LAST_WORD_CAMELIZED_REGEX = /([\\w/\\s-]+)([A-Z][a-z\\d]*$)/;\nconst CAMELIZED_REGEX = /[A-Z][a-z\\d]*$/;\n\nconst SINGULARS = new LRUCache<string, string>((word: string) => {\n return _singularize(word);\n});\nconst PLURALS = new LRUCache<string, string>((word: string) => {\n return _pluralize(word);\n});\nconst UNCOUNTABLE = new Set(defaultRules.uncountable);\nconst IRREGULAR: Map<string, string> = new Map();\nconst INVERSE_IRREGULAR: Map<string, string> = new Map();\nconst SINGULAR_RULES = new Map(defaultRules.singular.reverse());\nconst PLURAL_RULES = new Map(defaultRules.plurals.reverse());\n\nexport function uncountable(word: string) {\n UNCOUNTABLE.add(word.toLowerCase());\n}\n\nexport function loadUncountable(uncountables: string[]) {\n uncountables.forEach((word) => {\n uncountable(word);\n });\n}\n\nexport function irregular(single: string, plur: string) {\n //pluralizing\n IRREGULAR.set(single.toLowerCase(), plur);\n IRREGULAR.set(plur.toLowerCase(), plur);\n\n //singularizing\n INVERSE_IRREGULAR.set(plur.toLowerCase(), single);\n INVERSE_IRREGULAR.set(single.toLowerCase(), single);\n}\n\nexport function loadIrregular(irregularPairs: Array<[string, string]>) {\n irregularPairs.forEach((pair) => {\n //pluralizing\n IRREGULAR.set(pair[0].toLowerCase(), pair[1]);\n IRREGULAR.set(pair[1].toLowerCase(), pair[1]);\n\n //singularizing\n INVERSE_IRREGULAR.set(pair[1].toLowerCase(), pair[0]);\n INVERSE_IRREGULAR.set(pair[0].toLowerCase(), pair[0]);\n });\n}\nloadIrregular(defaultRules.irregularPairs);\n\nexport function clear() {\n SINGULARS.clear();\n PLURALS.clear();\n}\n\nexport function resetToDefaults() {\n clearRules();\n defaultRules.uncountable.forEach((v) => UNCOUNTABLE.add(v));\n defaultRules.singular.forEach((v) => SINGULAR_RULES.set(v[0], v[1]));\n defaultRules.plurals.forEach((v) => PLURAL_RULES.set(v[0], v[1]));\n loadIrregular(defaultRules.irregularPairs);\n}\n\nexport function clearRules() {\n SINGULARS.clear();\n PLURALS.clear();\n UNCOUNTABLE.clear();\n IRREGULAR.clear();\n INVERSE_IRREGULAR.clear();\n SINGULAR_RULES.clear();\n PLURAL_RULES.clear();\n}\n\nexport function singularize(word: string) {\n assert(`singularize expects to receive a non-empty string`, typeof word === 'string' && word.length > 0);\n if (!word) return '';\n return SINGULARS.get(word);\n}\n\nexport function pluralize(word: string) {\n assert(`pluralize expects to receive a non-empty string`, typeof word === 'string' && word.length > 0);\n if (!word) return '';\n return PLURALS.get(word);\n}\n\nfunction unshiftMap<K, V>(v: [K, V], map: Map<K, V>) {\n // reorder\n const rules = [v, ...map.entries()];\n map.clear();\n rules.forEach((rule) => {\n map.set(rule[0], rule[1]);\n });\n}\n\nexport function plural(regex: RegExp, string: string) {\n // rule requires reordering if exists, so remove it first\n if (PLURAL_RULES.has(regex)) {\n PLURAL_RULES.delete(regex);\n }\n\n // reorder\n unshiftMap([regex, string], PLURAL_RULES);\n}\n\nexport function singular(regex: RegExp, string: string) {\n // rule requires reordering if exists, so remove it first\n if (SINGULAR_RULES.has(regex)) {\n SINGULAR_RULES.delete(regex);\n }\n\n // reorder\n unshiftMap([regex, string], SINGULAR_RULES);\n}\n\nfunction _pluralize(word: string) {\n return inflect(word, PLURAL_RULES, IRREGULAR);\n}\n\nfunction _singularize(word: string) {\n return inflect(word, SINGULAR_RULES, INVERSE_IRREGULAR);\n}\n\nfunction inflect(word: string, typeRules: Map<RegExp, string>, irregulars: Map<string, string>) {\n // empty strings\n const isBlank = !word || BLANK_REGEX.test(word);\n if (isBlank) {\n return word;\n }\n\n // basic uncountables\n const lowercase = word.toLowerCase();\n if (UNCOUNTABLE.has(lowercase)) {\n return word;\n }\n\n // adv uncountables\n const wordSplit = LAST_WORD_DASHED_REGEX.exec(word) || LAST_WORD_CAMELIZED_REGEX.exec(word);\n const lastWord = wordSplit ? wordSplit[2].toLowerCase() : null;\n if (lastWord && UNCOUNTABLE.has(lastWord)) {\n return word;\n }\n\n // handle irregulars\n const isCamelized = CAMELIZED_REGEX.test(word);\n for (let [rule, substitution] of irregulars) {\n if (lowercase.match(rule + '$')) {\n if (isCamelized && lastWord && irregulars.has(lastWord)) {\n substitution = capitalize(substitution);\n rule = capitalize(rule);\n }\n\n return word.replace(new RegExp(rule, 'i'), substitution);\n }\n }\n\n // do the actual inflection\n for (const [rule, substitution] of typeRules) {\n if (rule.test(word)) {\n return word.replace(rule, substitution);\n }\n }\n\n return word;\n}\n"],"names":["defaultRules","plurals","singular","irregularPairs","uncountable","DEFAULT_MAX_CACHE_SIZE","LRUCache","constructor","doWork","size","state","Map","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","_hits","_misses","_ejected","get","key","value","delete","set","newValue","k","clear","STRING_DASHERIZE_REGEXP","STRING_DECAMELIZE_REGEXP","STRING_DASHERIZE_CACHE","replace","toLowerCase","STRING_CAMELIZE_REGEXP_1","STRING_CAMELIZE_REGEXP_2","CAMELIZE_CACHE","_match","_separator","chr","toUpperCase","match","STRING_UNDERSCORE_REGEXP_1","STRING_UNDERSCORE_REGEXP_2","UNDERSCORE_CACHE","str","STRING_CAPITALIZE_REGEXP","CAPITALIZE_CACHE","dasherize","camelize","underscore","capitalize","setMaxLRUCacheSize","BLANK_REGEX","LAST_WORD_DASHED_REGEX","LAST_WORD_CAMELIZED_REGEX","CAMELIZED_REGEX","SINGULARS","word","_singularize","PLURALS","_pluralize","UNCOUNTABLE","Set","IRREGULAR","INVERSE_IRREGULAR","SINGULAR_RULES","reverse","PLURAL_RULES","add","loadUncountable","uncountables","forEach","irregular","single","plur","loadIrregular","pair","resetToDefaults","clearRules","v","singularize","test","Error","length","pluralize","unshiftMap","map","rules","entries","rule","plural","regex","string","has","inflect","typeRules","irregulars","isBlank","lowercase","wordSplit","exec","lastWord","isCamelized","substitution","RegExp"],"mappings":";;AAQO,MAAMA,YAA8B,GAAG;AAC5CC,EAAAA,OAAO,EAAE,CACP,CAAC,GAAG,EAAE,GAAG,CAAC,EACV,CAAC,KAAK,EAAE,GAAG,CAAC,EACZ,CAAC,gBAAgB,EAAE,MAAM,CAAC,EAC1B,CAAC,iBAAiB,EAAE,KAAK,CAAC,EAC1B,CAAC,gBAAgB,EAAE,KAAK,CAAC,EACzB,CAAC,wBAAwB,EAAE,MAAM,CAAC,EAClC,CAAC,SAAS,EAAE,OAAO,CAAC,EACpB,CAAC,mBAAmB,EAAE,OAAO,CAAC,EAC9B,CAAC,YAAY,EAAE,KAAK,CAAC,EACrB,CAAC,WAAW,EAAE,KAAK,CAAC,EACpB,CAAC,OAAO,EAAE,KAAK,CAAC,EAChB,CAAC,wBAAwB,EAAE,SAAS,CAAC,EACrC,CAAC,UAAU,EAAE,KAAK,CAAC,EACnB,CAAC,mBAAmB,EAAE,OAAO,CAAC,EAC9B,CAAC,gBAAgB,EAAE,MAAM,CAAC,EAC1B,CAAC,4BAA4B,EAAE,QAAQ,CAAC,EACxC,CAAC,cAAc,EAAE,OAAO,CAAC,EACzB,CAAC,aAAa,EAAE,OAAO,CAAC,EACxB,CAAC,SAAS,EAAE,MAAM,CAAC,EACnB,CAAC,WAAW,E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AAU,EAAE;IAC3C,IAAIE,SAAS,CAAC1D,KAAK,CAACiD,IAAI,GAAG,GAAG,CAAC,EAAE;MAC/B,IAAIa,WAAW,IAAID,QAAQ,IAAIL,UAAU,CAACH,GAAG,CAACQ,QAAQ,CAAC,EAAE;AACvDE,QAAAA,YAAY,GAAGrD,UAAU,CAACqD,YAAY,CAAC,CAAA;AACvCd,QAAAA,IAAI,GAAGvC,UAAU,CAACuC,IAAI,CAAC,CAAA;AACzB,OAAA;AAEA,MAAA,OAAOhC,IAAI,CAAC1B,OAAO,CAAC,IAAIyE,MAAM,CAACf,IAAI,EAAE,GAAG,CAAC,EAAEc,YAAY,CAAC,CAAA;AAC1D,KAAA;AACF,GAAA;;AAEA;EACA,KAAK,MAAM,CAACd,IAAI,EAAEc,YAAY,CAAC,IAAIR,SAAS,EAAE;AAC5C,IAAA,IAAIN,IAAI,CAACR,IAAI,CAACxB,IAAI,CAAC,EAAE;AACnB,MAAA,OAAOA,IAAI,CAAC1B,OAAO,CAAC0D,IAAI,EAAEc,YAAY,CAAC,CAAA;AACzC,KAAA;AACF,GAAA;AAEA,EAAA,OAAO9C,IAAI,CAAA;AACb;;;;"}
1
+ {"version":3,"file":"inflect-8aYUyMN7.js","sources":["../src/-private/string/inflections.ts","../src/-private/string/transform.ts","../src/-private/string/inflect.ts"],"sourcesContent":["export type RulesArray = Array<[RegExp, string]>;\ntype DefaultRulesType = {\n plurals: RulesArray;\n singular: RulesArray;\n irregularPairs: Array<[string, string]>;\n uncountable: string[];\n};\n\nexport const defaultRules: DefaultRulesType = {\n plurals: [\n [/$/, 's'],\n [/s$/i, 's'],\n [/^(ax|test)is$/i, '$1es'],\n [/(octop|vir)us$/i, '$1i'],\n [/(octop|vir)i$/i, '$1i'],\n [/(alias|status|bonus)$/i, '$1es'],\n [/(bu)s$/i, '$1ses'],\n [/(buffal|tomat)o$/i, '$1oes'],\n [/([ti])um$/i, '$1a'],\n [/([ti])a$/i, '$1a'],\n [/sis$/i, 'ses'],\n [/(?:([^f])fe|([lr])f)$/i, '$1$2ves'],\n [/(hive)$/i, '$1s'],\n [/([^aeiouy]|qu)y$/i, '$1ies'],\n [/(x|ch|ss|sh)$/i, '$1es'],\n [/(matr|vert|ind)(?:ix|ex)$/i, '$1ices'],\n [/^(m|l)ouse$/i, '$1ice'],\n [/^(m|l)ice$/i, '$1ice'],\n [/^(ox)$/i, '$1en'],\n [/^(oxen)$/i, '$1'],\n [/(quiz)$/i, '$1zes'],\n ],\n\n singular: [\n [/s$/i, ''],\n [/(ss)$/i, '$1'],\n [/(n)ews$/i, '$1ews'],\n [/([ti])a$/i, '$1um'],\n [/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i, '$1sis'],\n [/(^analy)(sis|ses)$/i, '$1sis'],\n [/([^f])ves$/i, '$1fe'],\n [/(hive)s$/i, '$1'],\n [/(tive)s$/i, '$1'],\n [/([lr])ves$/i, '$1f'],\n [/([^aeiouy]|qu)ies$/i, '$1y'],\n [/(s)eries$/i, '$1eries'],\n [/(m)ovies$/i, '$1ovie'],\n [/(x|ch|ss|sh)es$/i, '$1'],\n [/^(m|l)ice$/i, '$1ouse'],\n [/(bus)(es)?$/i, '$1'],\n [/(o)es$/i, '$1'],\n [/(shoe)s$/i, '$1'],\n [/(cris|test)(is|es)$/i, '$1is'],\n [/^(a)x[ie]s$/i, '$1xis'],\n [/(octop|vir)(us|i)$/i, '$1us'],\n [/(alias|status|bonus)(es)?$/i, '$1'],\n [/^(ox)en/i, '$1'],\n [/(vert|ind)ices$/i, '$1ex'],\n [/(matr)ices$/i, '$1ix'],\n [/(quiz)zes$/i, '$1'],\n [/(database)s$/i, '$1'],\n ],\n\n irregularPairs: [\n ['person', 'people'],\n ['man', 'men'],\n ['child', 'children'],\n ['sex', 'sexes'],\n ['move', 'moves'],\n ['cow', 'kine'],\n ['zombie', 'zombies'],\n ],\n\n uncountable: ['equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep', 'jeans', 'police'],\n};\n","import { DEBUG } from '@warp-drive-mirror/build-config/env';\n\nconst DEFAULT_MAX_CACHE_SIZE = 10_000;\nexport class LRUCache<T, V> {\n declare size: number;\n declare state: Map<T, V>;\n declare doWork: (k: T) => V;\n\n // debug stats\n declare _hits: number;\n declare _misses: number;\n declare _ejected: number;\n\n constructor(doWork: (k: T) => V, size?: number) {\n this.size = size || DEFAULT_MAX_CACHE_SIZE;\n this.state = new Map();\n this.doWork = doWork;\n\n if (DEBUG) {\n this._hits = 0;\n this._misses = 0;\n this._ejected = 0;\n }\n }\n get(key: T) {\n const value = this.state.get(key);\n if (value) {\n if (DEBUG) {\n this._hits++;\n }\n this.state.delete(key);\n this.state.set(key, value);\n return value;\n }\n if (DEBUG) {\n this._misses++;\n }\n\n const newValue = this.doWork(key);\n this.set(key, newValue);\n return newValue;\n }\n\n set(key: T, value: V) {\n if (this.state.size === this.size) {\n for (const [k] of this.state) {\n if (DEBUG) {\n this._ejected++;\n }\n this.state.delete(k);\n break;\n }\n }\n this.state.set(key, value);\n }\n\n clear() {\n this.state.clear();\n if (DEBUG) {\n this._hits = 0;\n this._misses = 0;\n this._ejected = 0;\n }\n }\n}\n\nconst STRING_DASHERIZE_REGEXP = /[ _]/g;\nconst STRING_DECAMELIZE_REGEXP = /([a-z\\d])([A-Z])/g;\nconst STRING_DASHERIZE_CACHE = new LRUCache<string, string>((key: string) =>\n key.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase().replace(STRING_DASHERIZE_REGEXP, '-')\n);\n\n// eslint-disable-next-line no-useless-escape\nconst STRING_CAMELIZE_REGEXP_1 = /(\\-|\\_|\\.|\\s)+(.)?/g;\nconst STRING_CAMELIZE_REGEXP_2 = /(^|\\/)([A-Z])/g;\nconst CAMELIZE_CACHE = new LRUCache<string, string>((key: string) =>\n key\n .replace(STRING_CAMELIZE_REGEXP_1, (_match, _separator, chr: string | null) => (chr ? chr.toUpperCase() : ''))\n .replace(STRING_CAMELIZE_REGEXP_2, (match /*, separator, chr */) => match.toLowerCase())\n);\n\nconst STRING_UNDERSCORE_REGEXP_1 = /([a-z\\d])([A-Z]+)/g;\n// eslint-disable-next-line no-useless-escape\nconst STRING_UNDERSCORE_REGEXP_2 = /\\-|\\s+/g;\nconst UNDERSCORE_CACHE = new LRUCache<string, string>((str: string) =>\n str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase()\n);\n\nconst STRING_CAPITALIZE_REGEXP = /(^|\\/)([a-z\\u00C0-\\u024F])/g;\nconst CAPITALIZE_CACHE = new LRUCache<string, string>((str: string) =>\n str.replace(STRING_CAPITALIZE_REGEXP, (match /*, separator, chr */) => match.toUpperCase())\n);\n\n/**\n Replaces underscores, spaces, or camelCase with dashes.\n\n ```js\n import { dasherize } from '@ember-data-mirror/request-utils/string';\n\n dasherize('innerHTML'); // 'inner-html'\n dasherize('action_name'); // 'action-name'\n dasherize('css-class-name'); // 'css-class-name'\n dasherize('my favorite items'); // 'my-favorite-items'\n dasherize('privateDocs/ownerInvoice'; // 'private-docs/owner-invoice'\n ```\n\n @typedoc\n*/\nexport function dasherize(str: string): string {\n return STRING_DASHERIZE_CACHE.get(str);\n}\n\n/**\n Returns the lowerCamelCase form of a string.\n\n ```js\n import { camelize } from '@ember-data-mirror/request-utils/string';\n\n camelize('innerHTML'); // 'innerHTML'\n camelize('action_name'); // 'actionName'\n camelize('css-class-name'); // 'cssClassName'\n camelize('my favorite items'); // 'myFavoriteItems'\n camelize('My Favorite Items'); // 'myFavoriteItems'\n camelize('private-docs/owner-invoice'); // 'privateDocs/ownerInvoice'\n```\n\n @typedoc\n*/\nexport function camelize(str: string): string {\n return CAMELIZE_CACHE.get(str);\n}\n\n/**\n Returns the lower\\_case\\_and\\_underscored form of a string.\n\n ```js\n import { underscore } from '@ember-data-mirror/request-utils/string';\n\n underscore('innerHTML'); // 'inner_html'\n underscore('action_name'); // 'action_name'\n underscore('css-class-name'); // 'css_class_name'\n underscore('my favorite items'); // 'my_favorite_items'\n underscore('privateDocs/ownerInvoice'); // 'private_docs/owner_invoice'\n ```\n\n @typedoc\n*/\nexport function underscore(str: string): string {\n return UNDERSCORE_CACHE.get(str);\n}\n\n/**\n Returns the Capitalized form of a string\n\n ```js\n import { capitalize } from '@ember-data-mirror/request-utils/string';\n\n capitalize('innerHTML') // 'InnerHTML'\n capitalize('action_name') // 'Action_name'\n capitalize('css-class-name') // 'Css-class-name'\n capitalize('my favorite items') // 'My favorite items'\n capitalize('privateDocs/ownerInvoice'); // 'PrivateDocs/ownerInvoice'\n ```\n\n @typedoc\n*/\nexport function capitalize(str: string): string {\n return CAPITALIZE_CACHE.get(str);\n}\n\nexport function setMaxLRUCacheSize(size: number) {\n CAMELIZE_CACHE.size = size;\n UNDERSCORE_CACHE.size = size;\n CAPITALIZE_CACHE.size = size;\n STRING_DASHERIZE_CACHE.size = size;\n}\n","import { assert } from '@warp-drive-mirror/build-config/macros';\n\nimport { defaultRules } from './inflections';\nimport { capitalize, LRUCache } from './transform';\n\nconst BLANK_REGEX = /^\\s*$/;\nconst LAST_WORD_DASHED_REGEX = /([\\w/-]+[_/\\s-])([a-z\\d]+$)/;\nconst LAST_WORD_CAMELIZED_REGEX = /([\\w/\\s-]+)([A-Z][a-z\\d]*$)/;\nconst CAMELIZED_REGEX = /[A-Z][a-z\\d]*$/;\n\nconst SINGULARS = new LRUCache<string, string>((word: string) => {\n return _singularize(word);\n});\nconst PLURALS = new LRUCache<string, string>((word: string) => {\n return _pluralize(word);\n});\nconst UNCOUNTABLE = new Set(defaultRules.uncountable);\nconst IRREGULAR: Map<string, string> = new Map();\nconst INVERSE_IRREGULAR: Map<string, string> = new Map();\nconst SINGULAR_RULES = new Map(defaultRules.singular.reverse());\nconst PLURAL_RULES = new Map(defaultRules.plurals.reverse());\n\nexport function uncountable(word: string) {\n UNCOUNTABLE.add(word.toLowerCase());\n}\n\nexport function loadUncountable(uncountables: string[]) {\n uncountables.forEach((word) => {\n uncountable(word);\n });\n}\n\nexport function irregular(single: string, plur: string) {\n //pluralizing\n IRREGULAR.set(single.toLowerCase(), plur);\n IRREGULAR.set(plur.toLowerCase(), plur);\n\n //singularizing\n INVERSE_IRREGULAR.set(plur.toLowerCase(), single);\n INVERSE_IRREGULAR.set(single.toLowerCase(), single);\n}\n\nexport function loadIrregular(irregularPairs: Array<[string, string]>) {\n irregularPairs.forEach((pair) => {\n //pluralizing\n IRREGULAR.set(pair[0].toLowerCase(), pair[1]);\n IRREGULAR.set(pair[1].toLowerCase(), pair[1]);\n\n //singularizing\n INVERSE_IRREGULAR.set(pair[1].toLowerCase(), pair[0]);\n INVERSE_IRREGULAR.set(pair[0].toLowerCase(), pair[0]);\n });\n}\nloadIrregular(defaultRules.irregularPairs);\n\nexport function clear() {\n SINGULARS.clear();\n PLURALS.clear();\n}\n\nexport function resetToDefaults() {\n clearRules();\n defaultRules.uncountable.forEach((v) => UNCOUNTABLE.add(v));\n defaultRules.singular.forEach((v) => SINGULAR_RULES.set(v[0], v[1]));\n defaultRules.plurals.forEach((v) => PLURAL_RULES.set(v[0], v[1]));\n loadIrregular(defaultRules.irregularPairs);\n}\n\nexport function clearRules() {\n SINGULARS.clear();\n PLURALS.clear();\n UNCOUNTABLE.clear();\n IRREGULAR.clear();\n INVERSE_IRREGULAR.clear();\n SINGULAR_RULES.clear();\n PLURAL_RULES.clear();\n}\n\nexport function singularize(word: string) {\n assert(`singularize expects to receive a non-empty string`, typeof word === 'string' && word.length > 0);\n if (!word) return '';\n return SINGULARS.get(word);\n}\n\nexport function pluralize(word: string) {\n assert(`pluralize expects to receive a non-empty string`, typeof word === 'string' && word.length > 0);\n if (!word) return '';\n return PLURALS.get(word);\n}\n\nfunction unshiftMap<K, V>(v: [K, V], map: Map<K, V>) {\n // reorder\n const rules = [v, ...map.entries()];\n map.clear();\n rules.forEach((rule) => {\n map.set(rule[0], rule[1]);\n });\n}\n\nexport function plural(regex: RegExp, string: string) {\n // rule requires reordering if exists, so remove it first\n if (PLURAL_RULES.has(regex)) {\n PLURAL_RULES.delete(regex);\n }\n\n // reorder\n unshiftMap([regex, string], PLURAL_RULES);\n}\n\nexport function singular(regex: RegExp, string: string) {\n // rule requires reordering if exists, so remove it first\n if (SINGULAR_RULES.has(regex)) {\n SINGULAR_RULES.delete(regex);\n }\n\n // reorder\n unshiftMap([regex, string], SINGULAR_RULES);\n}\n\nfunction _pluralize(word: string) {\n return inflect(word, PLURAL_RULES, IRREGULAR);\n}\n\nfunction _singularize(word: string) {\n return inflect(word, SINGULAR_RULES, INVERSE_IRREGULAR);\n}\n\nfunction inflect(word: string, typeRules: Map<RegExp, string>, irregulars: Map<string, string>) {\n // empty strings\n const isBlank = !word || BLANK_REGEX.test(word);\n if (isBlank) {\n return word;\n }\n\n // basic uncountables\n const lowercase = word.toLowerCase();\n if (UNCOUNTABLE.has(lowercase)) {\n return word;\n }\n\n // adv uncountables\n const wordSplit = LAST_WORD_DASHED_REGEX.exec(word) || LAST_WORD_CAMELIZED_REGEX.exec(word);\n const lastWord = wordSplit ? wordSplit[2].toLowerCase() : null;\n if (lastWord && UNCOUNTABLE.has(lastWord)) {\n return word;\n }\n\n // handle irregulars\n const isCamelized = CAMELIZED_REGEX.test(word);\n for (let [rule, substitution] of irregulars) {\n if (lowercase.match(rule + '$')) {\n if (isCamelized && lastWord && irregulars.has(lastWord)) {\n substitution = capitalize(substitution);\n rule = capitalize(rule);\n }\n\n return word.replace(new RegExp(rule, 'i'), substitution);\n }\n }\n\n // do the actual inflection\n for (const [rule, substitution] of typeRules) {\n if (rule.test(word)) {\n return word.replace(rule, substitution);\n }\n }\n\n return word;\n}\n"],"names":["defaultRules","plurals","singular","irregularPairs","uncountable","DEFAULT_MAX_CACHE_SIZE","LRUCache","constructor","doWork","size","state","Map","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","_hits","_misses","_ejected","get","key","value","delete","set","newValue","k","clear","STRING_DASHERIZE_REGEXP","STRING_DECAMELIZE_REGEXP","STRING_DASHERIZE_CACHE","replace","toLowerCase","STRING_CAMELIZE_REGEXP_1","STRING_CAMELIZE_REGEXP_2","CAMELIZE_CACHE","_match","_separator","chr","toUpperCase","match","STRING_UNDERSCORE_REGEXP_1","STRING_UNDERSCORE_REGEXP_2","UNDERSCORE_CACHE","str","STRING_CAPITALIZE_REGEXP","CAPITALIZE_CACHE","dasherize","camelize","underscore","capitalize","setMaxLRUCacheSize","BLANK_REGEX","LAST_WORD_DASHED_REGEX","LAST_WORD_CAMELIZED_REGEX","CAMELIZED_REGEX","SINGULARS","word","_singularize","PLURALS","_pluralize","UNCOUNTABLE","Set","IRREGULAR","INVERSE_IRREGULAR","SINGULAR_RULES","reverse","PLURAL_RULES","add","loadUncountable","uncountables","forEach","irregular","single","plur","loadIrregular","pair","resetToDefaults","clearRules","v","singularize","test","Error","length","pluralize","unshiftMap","map","rules","entries","rule","plural","regex","string","has","inflect","typeRules","irregulars","isBlank","lowercase","wordSplit","exec","lastWord","isCamelized","substitution","RegExp"],"mappings":";;AAQO,MAAMA,YAA8B,GAAG;AAC5CC,EAAAA,OAAO,EAAE,CACP,CAAC,GAAG,EAAE,GAAG,CAAC,EACV,CAAC,KAAK,EAAE,GAAG,CAAC,EACZ,CAAC,gBAAgB,EAAE,MAAM,CAAC,EAC1B,CAAC,iBAAiB,EAAE,KAAK,CAAC,EAC1B,CAAC,gBAAgB,EAAE,KAAK,CAAC,EACzB,CAAC,wBAAwB,EAAE,MAAM,CAAC,EAClC,CAAC,SAAS,EAAE,OAAO,CAAC,EACpB,CAAC,mBAAmB,EAAE,OAAO,CAAC,EAC9B,CAAC,YAAY,EAAE,KAAK,CAAC,EACrB,CAAC,WAAW,EAAE,KAAK,CAAC,EACpB,CAAC,OAAO,EAAE,KAAK,CAAC,EAChB,CAAC,wBAAwB,EAAE,SAAS,CAAC,EACrC,CAAC,UAAU,EAAE,KAAK,CAAC,EACnB,CAAC,mBAAmB,EAAE,OAAO,CAAC,EAC9B,CA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EAAE;AACzC,IAAA,OAAO5C,IAAI,CAAA;AACb,GAAA;;AAEA;AACA,EAAA,MAAM6C,WAAW,GAAG/C,eAAe,CAAC0B,IAAI,CAACxB,IAAI,CAAC,CAAA;EAC9C,KAAK,IAAI,CAACgC,IAAI,EAAEc,YAAY,CAAC,IAAIP,UAAU,EAAE;IAC3C,IAAIE,SAAS,CAAC1D,KAAK,CAACiD,IAAI,GAAG,GAAG,CAAC,EAAE;MAC/B,IAAIa,WAAW,IAAID,QAAQ,IAAIL,UAAU,CAACH,GAAG,CAACQ,QAAQ,CAAC,EAAE;AACvDE,QAAAA,YAAY,GAAGrD,UAAU,CAACqD,YAAY,CAAC,CAAA;AACvCd,QAAAA,IAAI,GAAGvC,UAAU,CAACuC,IAAI,CAAC,CAAA;AACzB,OAAA;AAEA,MAAA,OAAOhC,IAAI,CAAC1B,OAAO,CAAC,IAAIyE,MAAM,CAACf,IAAI,EAAE,GAAG,CAAC,EAAEc,YAAY,CAAC,CAAA;AAC1D,KAAA;AACF,GAAA;;AAEA;EACA,KAAK,MAAM,CAACd,IAAI,EAAEc,YAAY,CAAC,IAAIR,SAAS,EAAE;AAC5C,IAAA,IAAIN,IAAI,CAACR,IAAI,CAACxB,IAAI,CAAC,EAAE;AACnB,MAAA,OAAOA,IAAI,CAAC1B,OAAO,CAAC0D,IAAI,EAAEc,YAAY,CAAC,CAAA;AACzC,KAAA;AACF,GAAA;AAEA,EAAA,OAAO9C,IAAI,CAAA;AACb;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ember-data-mirror/request-utils",
3
3
  "description": "Request Building Utilities for use with EmberData",
4
- "version": "5.4.0-beta.12",
4
+ "version": "5.4.0-beta.13",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "author": "Chris Thoburn <runspired@users.noreply.github.com>",
@@ -36,21 +36,20 @@
36
36
  },
37
37
  "./*": {
38
38
  "default": "./dist/*.js"
39
+ },
40
+ "./unstable-preview-types": {
41
+ "types": "./unstable-preview-types/index.d.ts"
39
42
  }
40
43
  },
41
- "scripts": {
42
- "lint": "eslint . --quiet --cache --cache-strategy=content --report-unused-disable-directives",
43
- "build:pkg": "vite build;",
44
- "sync-hardlinks": "bun run sync-dependencies-meta-injected"
45
- },
46
44
  "ember-addon": {
47
45
  "main": "addon-main.cjs",
48
46
  "type": "addon",
49
47
  "version": 2
50
48
  },
51
49
  "peerDependencies": {
50
+ "ember-source": "3.28.12 || ^4.0.4 || ^5.0.0 || ^6.0.0",
52
51
  "@ember/string": "^3.1.1 || ^4.0.0",
53
- "@warp-drive-mirror/core-types": "0.0.0-beta.12",
52
+ "@warp-drive-mirror/core-types": "0.0.0-beta.13",
54
53
  "ember-inflector": "^4.0.2 || ^5.0.0"
55
54
  },
56
55
  "peerDependenciesMeta": {
@@ -63,7 +62,7 @@
63
62
  },
64
63
  "dependencies": {
65
64
  "@embroider/macros": "^1.16.6",
66
- "@warp-drive-mirror/build-config": "0.0.0-beta.7"
65
+ "@warp-drive-mirror/build-config": "0.0.0-beta.8"
67
66
  },
68
67
  "devDependencies": {
69
68
  "@babel/core": "^7.24.5",
@@ -72,12 +71,12 @@
72
71
  "@babel/preset-typescript": "^7.24.1",
73
72
  "@glimmer/component": "^1.1.2",
74
73
  "@ember/string": "3.1.1",
75
- "@warp-drive-mirror/core-types": "0.0.0-beta.12",
76
- "@warp-drive/internal-config": "5.4.0-beta.12",
74
+ "@warp-drive-mirror/core-types": "0.0.0-beta.13",
75
+ "@warp-drive/internal-config": "5.4.0-beta.13",
77
76
  "ember-source": "~5.12.0",
78
77
  "ember-inflector": "4.0.3",
79
78
  "pnpm-sync-dependencies-meta-injected": "0.0.14",
80
- "typescript": "^5.4.5",
79
+ "typescript": "^5.7.2",
81
80
  "vite": "^5.2.11"
82
81
  },
83
82
  "ember": {
@@ -90,5 +89,17 @@
90
89
  "@warp-drive-mirror/build-config": {
91
90
  "injected": true
92
91
  }
92
+ },
93
+ "typesVersions": {
94
+ "*": {
95
+ "unstable-preview-types": [
96
+ "./unstable-preview-types"
97
+ ]
98
+ }
99
+ },
100
+ "scripts": {
101
+ "lint": "eslint . --quiet --cache --cache-strategy=content",
102
+ "build:pkg": "vite build;",
103
+ "sync-hardlinks": "bun run sync-dependencies-meta-injected"
93
104
  }
94
105
  }
@@ -1,8 +1,8 @@
1
1
  /// <reference path="./deprecation-support.d.ts" />
2
2
  /// <reference path="./string.d.ts" />
3
3
  /// <reference path="./-private/string/inflect.d.ts" />
4
- /// <reference path="./-private/string/inflections.d.ts" />
5
4
  /// <reference path="./-private/string/transform.d.ts" />
5
+ /// <reference path="./-private/string/inflections.d.ts" />
6
6
  declare module '@ember-data-mirror/request-utils' {
7
7
  import type { StableRecordIdentifier } from '@warp-drive-mirror/core-types';
8
8
  import type { Cache } from '@warp-drive-mirror/core-types/cache';