mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
DEV: introduces prettier for es6 files
This commit is contained in:
@ -3,11 +3,11 @@ const { get, isNone, guidFor } = Ember;
|
||||
export default Ember.Mixin.create({
|
||||
valueForContentItem(content) {
|
||||
switch (typeof content) {
|
||||
case "string":
|
||||
case "number":
|
||||
return content;
|
||||
default:
|
||||
return get(content, this.get("valueAttribute"));
|
||||
case "string":
|
||||
case "number":
|
||||
return content;
|
||||
default:
|
||||
return get(content, this.get("valueAttribute"));
|
||||
}
|
||||
},
|
||||
|
||||
@ -33,7 +33,11 @@ export default Ember.Mixin.create({
|
||||
},
|
||||
|
||||
_castBoolean(value) {
|
||||
if (this.get("castBoolean") && Ember.isPresent(value) && typeof(value) === "string") {
|
||||
if (
|
||||
this.get("castBoolean") &&
|
||||
Ember.isPresent(value) &&
|
||||
typeof value === "string"
|
||||
) {
|
||||
return value === "true";
|
||||
}
|
||||
|
||||
@ -41,7 +45,11 @@ export default Ember.Mixin.create({
|
||||
},
|
||||
|
||||
_castInteger(value) {
|
||||
if (this.get("castInteger") && Ember.isPresent(value) && this._isNumeric(value)) {
|
||||
if (
|
||||
this.get("castInteger") &&
|
||||
Ember.isPresent(value) &&
|
||||
this._isNumeric(value)
|
||||
) {
|
||||
return parseInt(value, 10);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user