You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deprecate @ember/string when used from ember-source; point users to add
the `@ember/string` addon
- Duplicate a portion of @ember/string in @ember/-internals/string for
internal use by ember-source without triggering deprecations
(cherry picked from commit b341648)
@return {Array} array containing the split strings
100
101
@public
102
+
@deprecated Add `@ember/string` to your package.json
101
103
*/
102
104
exportfunctionw(str: string): string[]{
105
+
deprecateImportFromInternalString();
103
106
returnstr.split(/\s+/);
104
107
}
105
108
@@ -119,8 +122,10 @@ export function w(str: string): string[] {
119
122
@param {String} str The string to decamelize.
120
123
@return {String} the decamelized string.
121
124
@public
125
+
@deprecated Add `@ember/string` to your package.json
122
126
*/
123
127
exportfunctiondecamelize(str: string): string{
128
+
deprecateImportFromInternalString();
124
129
returnDECAMELIZE_CACHE.get(str);
125
130
}
126
131
@@ -141,8 +146,10 @@ export function decamelize(str: string): string {
141
146
@param {String} str The string to dasherize.
142
147
@return {String} the dasherized string.
143
148
@public
149
+
@deprecated Add `@ember/string` to your package.json
144
150
*/
145
151
exportfunctiondasherize(str: string): string{
152
+
deprecateImportFromInternalString();
146
153
returnSTRING_DASHERIZE_CACHE.get(str);
147
154
}
148
155
@@ -164,8 +171,10 @@ export function dasherize(str: string): string {
164
171
@param {String} str The string to camelize.
165
172
@return {String} the camelized string.
166
173
@public
174
+
@deprecated Add `@ember/string` to your package.json
167
175
*/
168
176
exportfunctioncamelize(str: string): string{
177
+
deprecateImportFromInternalString();
169
178
returnCAMELIZE_CACHE.get(str);
170
179
}
171
180
@@ -186,8 +195,10 @@ export function camelize(str: string): string {
186
195
@param {String} str the string to classify
187
196
@return {String} the classified string
188
197
@public
198
+
@deprecated Add `@ember/string` to your package.json
189
199
*/
190
200
exportfunctionclassify(str: string): string{
201
+
deprecateImportFromInternalString();
191
202
returnCLASSIFY_CACHE.get(str);
192
203
}
193
204
@@ -209,8 +220,10 @@ export function classify(str: string): string {
209
220
@param {String} str The string to underscore.
210
221
@return {String} the underscored string.
211
222
@public
223
+
@deprecated Add `@ember/string` to your package.json
212
224
*/
213
225
exportfunctionunderscore(str: string): string{
226
+
deprecateImportFromInternalString();
214
227
returnUNDERSCORE_CACHE.get(str);
215
228
}
216
229
@@ -231,11 +244,30 @@ export function underscore(str: string): string {
231
244
@param {String} str The string to capitalize.
232
245
@return {String} The capitalized string.
233
246
@public
247
+
@deprecated Add `@ember/string` to your package.json
234
248
*/
235
249
exportfunctioncapitalize(str: string): string{
250
+
deprecateImportFromInternalString();
236
251
returnCAPITALIZE_CACHE.get(str);
237
252
}
238
253
254
+
functiondeprecateImportFromInternalString(){
255
+
deprecate(
256
+
'Importing from `@ember/string` without having the `@ember/string` package in your project is deprecated. Please add `@ember/string` to your `package.json',
},'Importing from `@ember/string` without having the `@ember/string` package in your project is deprecated. Please add `@ember/string` to your `package.json');
0 commit comments