-
-
Notifications
You must be signed in to change notification settings - Fork 80
/
string.js
45 lines (39 loc) · 1.11 KB
/
string.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import Ember from 'ember';
import {
pluralize,
singularize
} from '../system/string';
if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {
/**
See {{#crossLink "Ember.String/pluralize"}}{{/crossLink}}
@method pluralize
@for String
*/
Object.defineProperty(String.prototype, 'pluralize', {
get() {
Ember.deprecate(`String.prototype.pluralize() is deprecated. Please explicitly: import { pluralize } from 'ember-inflector';`, false, {
id: 'ember-inflector.globals',
until: '3.0.0',
});
return function() {
return pluralize(this);
};
},
});
/**
See {{#crossLink "Ember.String/singularize"}}{{/crossLink}}
@method singularize
@for String
*/
Object.defineProperty(String.prototype, 'singularize', {
get() {
Ember.deprecate(`String.prototype.singularize() is deprecated. Please explicitly: import { singularize } from 'ember-inflector';`, false, {
id: 'ember-inflector.globals',
until: '3.0.0',
});
return function() {
return singularize(this);
};
},
});
}