Created
July 12, 2019 15:44
-
-
Save Ookami-san/0093cc5b70dcf351c315f380196c6dc4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/juliangarnier/anime/blob/master/src/index.js | |
const is = { | |
arr: a => Array.isArray(a), | |
obj: a => stringContains(Object.prototype.toString.call(a), 'Object'), | |
pth: a => is.obj(a) && a.hasOwnProperty('totalLength'), | |
svg: a => a instanceof SVGElement, | |
inp: a => a instanceof HTMLInputElement, | |
dom: a => a.nodeType || is.svg(a), | |
str: a => typeof a === 'string', | |
fnc: a => typeof a === 'function', | |
und: a => typeof a === 'undefined', | |
hex: a => /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(a), | |
rgb: a => /^rgb/.test(a), | |
hsl: a => /^hsl/.test(a), | |
col: a => (is.hex(a) || is.rgb(a) || is.hsl(a)), | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment