Descripción
Type-based conditional logic using typeof and instanceof
File Template: ❌
Prefix
type:check
Scopes
typescript
Snippet de código
if (${1:obj} === null) return ${2:0};
if (typeof $1 === "string") return ($1 as string).length;
if (typeof $1 === "number") return $1 as number;
return ${3:-1};