Skip to content

Instantly share code, notes, and snippets.

@hrdtbs
Created March 19, 2018 10:35
Show Gist options
  • Save hrdtbs/308f527b1fb1d99c62bec5468932185a to your computer and use it in GitHub Desktop.
Save hrdtbs/308f527b1fb1d99c62bec5468932185a to your computer and use it in GitHub Desktop.
JavaScriptの型判定のような何か、必要になったものから追加
export const isObject = target =>
value !== null && typeof value !== "undefined" && Object(value) === value;
export const isArray = target => Array.isArray(target);
export const isString = target => typeof target === "string";
// template literalという型は存在しないが
export const isTemplateLiteral = target => !!target.raw;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment