Skip to content

Instantly share code, notes, and snippets.

@bouzuya
Created May 28, 2020 04:00
Show Gist options
  • Save bouzuya/4dcaef575c1c643eb5e88bcd0189aae2 to your computer and use it in GitHub Desktop.
Save bouzuya/4dcaef575c1c643eb5e88bcd0189aae2 to your computer and use it in GitHub Desktop.
TypeScript re-export bug?
export function f() {}
import { f } from "./f";
export { f };
export { f } from "./f";
export * from "./f";
import assert from "assert";
import * as m1 from "./m1";
import * as m2 from "./m2";
import * as m3 from "./m3";
assert(Object.getOwnPropertyDescriptor(m1, "f")?.configurable === true);
assert(Object.getOwnPropertyDescriptor(m2, "f")?.configurable === false);
assert(Object.getOwnPropertyDescriptor(m3, "f")?.configurable === false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment