示例工程 31-tsconfig-build-pipeline

31-tsconfig-build-pipeline/03-isolated-verbatim/src/main.ts

typescript · 0.3 KB

运行:31 · isolated-verbatim

点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。

import { describe } from './types.js';
import type { Shape } from './types.js';
 
export function run(log: (msg: string) => void = console.log): string[] {
  const shape: Shape = { name: 'rect' };
  const lines = [describe(shape)];
  for (const line of lines) {
    log(line);
  }
  return lines;
}