跳至主要內容

String.dedent

小于 1 分钟featurees-proposal

String.dedentopen in new window

模块

esnext.string.dedentopen in new window

类型

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

示例

示例open in new window:

const message = 42;
console.log(String.dedent`
  print('${message}')
`); // => print('42')
String.dedent(console.log)`
  print('${message}')
`; // => ["print('", "')", raw: Array(2)], 42