String.dedent
小于 1 分钟
String.dedent
模块
类型
interface StringConstructor {
dedent(
template: { raw: Array<string> },
...substitutions: Array<any>
): string;
dedent<T>(
tagFunction: (
template: { raw: Array<string> },
...substitutions: Array<any>
) => T
): T;
}
入口点
core-js/proposals/string-dedent
core-js(-pure)/full/string/dedent
示例
示例:
const message = 42;
console.log(String.dedent`
print('${message}')
`); // => print('42')
String.dedent(console.log)`
print('${message}')
`; // => ["print('", "')", raw: Array(2)], 42