@ember-data-mirror/request-utils 4.13.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +11 -0
- package/README.md +76 -0
- package/addon-main.cjs +5 -0
- package/dist/deprecation-support.js +187 -0
- package/dist/deprecation-support.js.map +1 -0
- package/dist/index.js +775 -0
- package/dist/index.js.map +1 -0
- package/dist/inflect-8aYUyMN7.js +311 -0
- package/dist/inflect-8aYUyMN7.js.map +1 -0
- package/dist/string.js +1 -0
- package/dist/string.js.map +1 -0
- package/package.json +95 -0
- package/unstable-preview-types/-private/string/inflect.d.ts +14 -0
- package/unstable-preview-types/-private/string/inflect.d.ts.map +1 -0
- package/unstable-preview-types/-private/string/inflections.d.ts +12 -0
- package/unstable-preview-types/-private/string/inflections.d.ts.map +1 -0
- package/unstable-preview-types/-private/string/transform.d.ts +81 -0
- package/unstable-preview-types/-private/string/transform.d.ts.map +1 -0
- package/unstable-preview-types/deprecation-support.d.ts +4 -0
- package/unstable-preview-types/deprecation-support.d.ts.map +1 -0
- package/unstable-preview-types/index.d.ts +514 -0
- package/unstable-preview-types/index.d.ts.map +1 -0
- package/unstable-preview-types/string.d.ts +5 -0
- package/unstable-preview-types/string.d.ts.map +1 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (C) 2017-2023 Ember.js contributors
|
|
4
|
+
Portions Copyright (C) 2011-2017 Tilde, Inc. and contributors.
|
|
5
|
+
Portions Copyright (C) 2011 LivingSocial Inc.
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
8
|
+
|
|
9
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
10
|
+
|
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img
|
|
3
|
+
class="project-logo"
|
|
4
|
+
src="./ember-data-logo-dark.svg#gh-dark-mode-only"
|
|
5
|
+
alt="EmberData RequestUtils"
|
|
6
|
+
width="240px"
|
|
7
|
+
title="EmberData RequestUtils"
|
|
8
|
+
/>
|
|
9
|
+
<img
|
|
10
|
+
class="project-logo"
|
|
11
|
+
src="./ember-data-logo-light.svg#gh-light-mode-only"
|
|
12
|
+
alt="EmberData RequestUtils"
|
|
13
|
+
width="240px"
|
|
14
|
+
title="EmberData RequestUtils"
|
|
15
|
+
/>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">Utilities for Requests</p>
|
|
19
|
+
|
|
20
|
+
This package provides Simple utility function to assist in url building, query params, and other common request operations.
|
|
21
|
+
|
|
22
|
+
It's built for [*Ember***Data**](https://github.com/emberjs/data/) but useful more broadly if you're looking for lightweight functions to assist in working with urls and query params.
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
Install using your javascript package manager of choice. For instance with [pnpm](https://pnpm.io/)
|
|
27
|
+
|
|
28
|
+
```no-highlight
|
|
29
|
+
pnpm add @ember-data-mirror/request-utils
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Tagged Releases**
|
|
33
|
+
|
|
34
|
+
- 
|
|
35
|
+
- 
|
|
36
|
+
- 
|
|
37
|
+
- 
|
|
38
|
+
- 
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## Utils
|
|
42
|
+
|
|
43
|
+
- [buildBaseUrl]()
|
|
44
|
+
- [sortQueryParams]()
|
|
45
|
+
- [buildQueryParams]()
|
|
46
|
+
- [filterEmpty]()
|
|
47
|
+
|
|
48
|
+
### As a Library Primitive
|
|
49
|
+
|
|
50
|
+
These primitives may be used directly or composed by request builders to provide a consistent interface for building requests.
|
|
51
|
+
|
|
52
|
+
For instance:
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import { buildBaseURL, buildQueryParams } from '@ember-data-mirror/request-utils';
|
|
56
|
+
|
|
57
|
+
const baseURL = buildBaseURL({
|
|
58
|
+
host: 'https://api.example.com',
|
|
59
|
+
namespace: 'api/v1',
|
|
60
|
+
resourcePath: 'emberDevelopers',
|
|
61
|
+
op: 'query',
|
|
62
|
+
identifier: { type: 'ember-developer' }
|
|
63
|
+
});
|
|
64
|
+
const url = `${baseURL}?${buildQueryParams({ name: 'Chris', include:['pets'] })}`;
|
|
65
|
+
// => 'https://api.example.com/api/v1/emberDevelopers?include=pets&name=Chris'
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
This is useful, but not as useful as the REST request builder for query which is sugar over this (and more!):
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
import { query } from '@ember-data-mirror/rest/request';
|
|
72
|
+
|
|
73
|
+
const options = query('ember-developer', { name: 'Chris', include:['pets'] });
|
|
74
|
+
// => { url: 'https://api.example.com/api/v1/emberDevelopers?include=pets&name=Chris' }
|
|
75
|
+
// Note: options will also include other request options like headers, method, etc.
|
|
76
|
+
```
|
package/addon-main.cjs
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { deprecate } from '@ember/debug';
|
|
2
|
+
import { macroCondition, getGlobalConfig, dependencySatisfies, importSync } from '@embroider/macros';
|
|
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)) {
|
|
5
|
+
if (macroCondition(dependencySatisfies('ember-inflector', '*'))) {
|
|
6
|
+
const Inflector = importSync('ember-inflector').default;
|
|
7
|
+
const {
|
|
8
|
+
inflector
|
|
9
|
+
} = Inflector;
|
|
10
|
+
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
12
|
+
const originalPlural = inflector.plural;
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
14
|
+
const originalSingular = inflector.singular;
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
16
|
+
const originalIrregular = inflector.irregular;
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
18
|
+
const originalUncountable = inflector.uncountable;
|
|
19
|
+
|
|
20
|
+
// copy over any already registered rules
|
|
21
|
+
|
|
22
|
+
// ember-inflector mutates the default rules arrays
|
|
23
|
+
// with user supplied rules, so we keep track of what
|
|
24
|
+
// is default via our own list.
|
|
25
|
+
const defaultPluralKeys = new Set();
|
|
26
|
+
const defaultSingularKeys = new Set();
|
|
27
|
+
defaultRules.plurals.forEach(([regex]) => {
|
|
28
|
+
defaultPluralKeys.add(regex.toString());
|
|
29
|
+
});
|
|
30
|
+
defaultRules.singular.forEach(([regex]) => {
|
|
31
|
+
defaultSingularKeys.add(regex.toString());
|
|
32
|
+
});
|
|
33
|
+
const {
|
|
34
|
+
defaultRules: defaultRules$1
|
|
35
|
+
} = Inflector;
|
|
36
|
+
const {
|
|
37
|
+
rules
|
|
38
|
+
} = inflector;
|
|
39
|
+
const irregularMap = new Map();
|
|
40
|
+
const toIgnore = new Set();
|
|
41
|
+
const uncountableSet = new Set(defaultRules$1.uncountable);
|
|
42
|
+
defaultRules$1.irregularPairs.forEach(([single, plur]) => {
|
|
43
|
+
irregularMap.set(single.toLowerCase(), plur);
|
|
44
|
+
toIgnore.add(plur.toLowerCase());
|
|
45
|
+
});
|
|
46
|
+
const irregularLookups = new Map();
|
|
47
|
+
Object.keys(rules.irregular).forEach(single => {
|
|
48
|
+
const plur = rules.irregular[single];
|
|
49
|
+
irregularLookups.set(single, plur);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// load plurals
|
|
53
|
+
rules.plurals.forEach(([regex, replacement]) => {
|
|
54
|
+
if (defaultPluralKeys.has(regex.toString())) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
plural(regex, replacement);
|
|
58
|
+
deprecate(`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.`, /* inline-macro-config */getGlobalConfig().WarpDrive.deprecations.DISABLE_6X_DEPRECATIONS, {
|
|
59
|
+
id: 'warp-drive.ember-inflector',
|
|
60
|
+
until: '6.0.0',
|
|
61
|
+
for: 'warp-drive',
|
|
62
|
+
since: {
|
|
63
|
+
enabled: '5.3.4',
|
|
64
|
+
available: '4.13'
|
|
65
|
+
},
|
|
66
|
+
url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector'
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// load singulars
|
|
71
|
+
rules.singular.forEach(([regex, replacement]) => {
|
|
72
|
+
if (defaultSingularKeys.has(regex.toString())) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
singular(regex, replacement);
|
|
76
|
+
deprecate(`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.`, /* inline-macro-config */getGlobalConfig().WarpDrive.deprecations.DISABLE_6X_DEPRECATIONS, {
|
|
77
|
+
id: 'warp-drive.ember-inflector',
|
|
78
|
+
until: '6.0.0',
|
|
79
|
+
for: 'warp-drive',
|
|
80
|
+
since: {
|
|
81
|
+
enabled: '5.3.4',
|
|
82
|
+
available: '4.13'
|
|
83
|
+
},
|
|
84
|
+
url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector'
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// load irregulars
|
|
89
|
+
Object.keys(rules.irregular).forEach(single => {
|
|
90
|
+
const plur = rules.irregular[single];
|
|
91
|
+
const defaultPlur = irregularMap.get(single);
|
|
92
|
+
if (defaultPlur && defaultPlur === plur) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (toIgnore.has(single)) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const actualSingle = irregularLookups.get(plur.toLowerCase()) || single;
|
|
99
|
+
toIgnore.add(plur.toLowerCase());
|
|
100
|
+
irregular(actualSingle, plur);
|
|
101
|
+
deprecate(`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}'.`, /* inline-macro-config */getGlobalConfig().WarpDrive.deprecations.DISABLE_6X_DEPRECATIONS, {
|
|
102
|
+
id: 'warp-drive.ember-inflector',
|
|
103
|
+
until: '6.0.0',
|
|
104
|
+
for: 'warp-drive',
|
|
105
|
+
since: {
|
|
106
|
+
enabled: '5.3.4',
|
|
107
|
+
available: '4.13'
|
|
108
|
+
},
|
|
109
|
+
url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector'
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// load uncountables
|
|
114
|
+
Object.keys(rules.uncountable).forEach(word => {
|
|
115
|
+
if (uncountableSet.has(word) || rules.uncountable[word] !== true) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
uncountable(word);
|
|
119
|
+
deprecate(`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.`, /* inline-macro-config */getGlobalConfig().WarpDrive.deprecations.DISABLE_6X_DEPRECATIONS, {
|
|
120
|
+
id: 'warp-drive.ember-inflector',
|
|
121
|
+
until: '6.0.0',
|
|
122
|
+
for: 'warp-drive',
|
|
123
|
+
since: {
|
|
124
|
+
enabled: '5.3.4',
|
|
125
|
+
available: '4.13'
|
|
126
|
+
},
|
|
127
|
+
url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector'
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
inflector.plural = function (...args) {
|
|
131
|
+
plural(...args);
|
|
132
|
+
deprecate(`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.`, /* inline-macro-config */getGlobalConfig().WarpDrive.deprecations.DISABLE_6X_DEPRECATIONS, {
|
|
133
|
+
id: 'warp-drive.ember-inflector',
|
|
134
|
+
until: '6.0.0',
|
|
135
|
+
for: 'warp-drive',
|
|
136
|
+
since: {
|
|
137
|
+
enabled: '5.3.4',
|
|
138
|
+
available: '4.13'
|
|
139
|
+
},
|
|
140
|
+
url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector'
|
|
141
|
+
});
|
|
142
|
+
return originalPlural.apply(inflector, args);
|
|
143
|
+
};
|
|
144
|
+
inflector.singular = function (...args) {
|
|
145
|
+
singular(...args);
|
|
146
|
+
deprecate(`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.`, /* inline-macro-config */getGlobalConfig().WarpDrive.deprecations.DISABLE_6X_DEPRECATIONS, {
|
|
147
|
+
id: 'warp-drive.ember-inflector',
|
|
148
|
+
until: '6.0.0',
|
|
149
|
+
for: 'warp-drive',
|
|
150
|
+
since: {
|
|
151
|
+
enabled: '5.3.4',
|
|
152
|
+
available: '4.13'
|
|
153
|
+
},
|
|
154
|
+
url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector'
|
|
155
|
+
});
|
|
156
|
+
return originalSingular.apply(inflector, args);
|
|
157
|
+
};
|
|
158
|
+
inflector.irregular = function (...args) {
|
|
159
|
+
irregular(...args);
|
|
160
|
+
deprecate(`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.`, /* inline-macro-config */getGlobalConfig().WarpDrive.deprecations.DISABLE_6X_DEPRECATIONS, {
|
|
161
|
+
id: 'warp-drive.ember-inflector',
|
|
162
|
+
until: '6.0.0',
|
|
163
|
+
for: 'warp-drive',
|
|
164
|
+
since: {
|
|
165
|
+
enabled: '5.3.4',
|
|
166
|
+
available: '4.13'
|
|
167
|
+
},
|
|
168
|
+
url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector'
|
|
169
|
+
});
|
|
170
|
+
return originalIrregular.apply(inflector, args);
|
|
171
|
+
};
|
|
172
|
+
inflector.uncountable = function (...args) {
|
|
173
|
+
uncountable(...args);
|
|
174
|
+
deprecate(`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.`, /* inline-macro-config */getGlobalConfig().WarpDrive.deprecations.DISABLE_6X_DEPRECATIONS, {
|
|
175
|
+
id: 'warp-drive.ember-inflector',
|
|
176
|
+
until: '6.0.0',
|
|
177
|
+
for: 'warp-drive',
|
|
178
|
+
since: {
|
|
179
|
+
enabled: '5.3.4',
|
|
180
|
+
available: '4.13'
|
|
181
|
+
},
|
|
182
|
+
url: 'https://deprecations.emberjs.com/id/warp-drive.ember-inflector'
|
|
183
|
+
});
|
|
184
|
+
return originalUncountable.apply(inflector, args);
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}
|
|
@@ -0,0 +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, DISABLE_6X_DEPRECATIONS } 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 /* inline-macro-config */ DISABLE_6X_DEPRECATIONS,\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 /* inline-macro-config */ DISABLE_6X_DEPRECATIONS,\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 /* inline-macro-config */ DISABLE_6X_DEPRECATIONS,\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 /* inline-macro-config */ DISABLE_6X_DEPRECATIONS,\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 /* inline-macro-config */ DISABLE_6X_DEPRECATIONS,\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 /* inline-macro-config */ DISABLE_6X_DEPRECATIONS,\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 /* inline-macro-config */ DISABLE_6X_DEPRECATIONS,\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 /* inline-macro-config */ DISABLE_6X_DEPRECATIONS,\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","DISABLE_6X_DEPRECATIONS","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;IAClH,MAAM;AAAEC,MAAAA;AAAU,KAAC,GAAGH,SAAS;;AAE/B;AACA,IAAA,MAAMI,cAAc,GAAGD,SAAS,CAACE,MAAM;AACvC;AACA,IAAA,MAAMC,gBAAgB,GAAGH,SAAS,CAACI,QAAQ;AAC3C;AACA,IAAA,MAAMC,iBAAiB,GAAGL,SAAS,CAACM,SAAS;AAC7C;AACA,IAAA,MAAMC,mBAAmB,GAAGP,SAAS,CAACQ,WAAW;;AAEjD;;AAyBA;AACA;AACA;AACA,IAAA,MAAMC,iBAAiB,GAAG,IAAIC,GAAG,EAAU;AAC3C,IAAA,MAAMC,mBAAmB,GAAG,IAAID,GAAG,EAAU;IAC7CE,YAAiB,CAACC,OAAO,CAACC,OAAO,CAAC,CAAC,CAACC,KAAK,CAAC,KAAK;MAC7CN,iBAAiB,CAACO,GAAG,CAACD,KAAK,CAACE,QAAQ,EAAE,CAAC;AACzC,KAAC,CAAC;IACFL,YAAiB,CAACR,QAAQ,CAACU,OAAO,CAAC,CAAC,CAACC,KAAK,CAAC,KAAK;MAC9CJ,mBAAmB,CAACK,GAAG,CA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