UNPKG

babel-plugin-typecheck

Version:

Transforms flow type annotations into runtime type checks.

19 lines (14 loc) 276 B
class User { constructor (name) { this._name = name; this._called = false; } set name (name: string) { this._name = name; } } export default function demo (name): string { const user = new User('anonymous'); user.name = null; return user.name; }