提交 465d91db 编写于 作者: J Johannes Rieken

fix test failure

上级 ede348ee
...@@ -346,20 +346,19 @@ export class FormatString extends Marker { ...@@ -346,20 +346,19 @@ export class FormatString extends Marker {
} }
resolve(value: string): string { resolve(value: string): string {
if (value) { if (this.shorthandName === 'upcase') {
if (this.shorthandName === 'upcase') { return !value ? '' : value.toLocaleUpperCase();
return value.toLocaleUpperCase(); } else if (this.shorthandName === 'downcase') {
} else if (this.shorthandName === 'downcase') { return !value ? '' : value.toLocaleLowerCase();
return value.toLocaleLowerCase(); } else if (this.shorthandName === 'capitalize') {
} else if (this.shorthandName === 'capitalize') { return !value ? '' : (value[0].toLocaleUpperCase() + value.substr(1));
return value[0].toLocaleUpperCase() + value.substr(1); } else if (Boolean(value) && typeof this.ifValue === 'string') {
} else if (Boolean(value) && typeof this.ifValue === 'string') { return this.ifValue;
return this.ifValue; } else if (!Boolean(value) && typeof this.elseValue === 'string') {
} else if (!Boolean(value) && typeof this.elseValue === 'string') { return this.elseValue;
return this.elseValue; } else {
} return value || '';
} }
return value || '';
} }
toTextmateString(): string { toTextmateString(): string {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册