WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Codebase Compiler FAQ

Nathan Shively-Sanders edited this page Sep 2, 2022 · 1 revision

Frequently Asked Questions

How can I find out if a type is number[]?

getElementTypeOfArrayType(t) === numberType

getElementTypeOfArrayType returns undefined if t is not an array type. Use isArrayType or isArrayLikeType if that's all you need to know.

How can I delete nodes in a transformer?

Probably you return undefined instead of a new or existin node, but look at src/compiler/transformers/ts.ts. Deleting type annotations is its main job.

Clone this wiki locally