Skip to content

Instantly share code, notes, and snippets.

View ericdmoore's full-sized avatar

Eric D Moore ericdmoore

View GitHub Profile
// vanilla version of TS (from esbiuild)
const {isArray} = Array;
const isPrim = (i) => {
const types = ["string", "number", "boolean", "function", "undefined", "bigint", "symbol"];
return types.some((tStr) => typeof i === tStr);
};
const isObject = (i) => {
return !isPrim(i) && !isArray(i);
};