Index

shiki


We’re using Shiki Twoslash to add compiler information to TypeScript and JavaScript code snippets.

// @filename: maths.ts
export function absolute(num: number) {
  if (num < 0) return num * -1;
  return num;
}

// @filename: index.ts
import { absolute } from "./maths.js";
const value = absolute(-1);

Pretty neat, isn’t it?

// @errors: 2339
const welcome = "Cześć";
const words = welcome.contains(" ");