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

fix test failure

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