@qier-player/danmaku
Version:
Powerful danmaku, support many features.
25 lines • 943 B
JavaScript
var toString = Object.prototype.toString;
export function isString(o) {
return typeof o === 'string' || toString.call(o) === '[object String]';
}
export function isBool(o) {
return o === true || o === false || toString.call(o) === '[object Boolean]';
}
export function isFunction(o) {
return typeof o === 'function' || toString.call(o) === '[object Function]';
}
export function isNumber(o) {
return typeof o === 'number' || toString.call(o) === '[object Number]';
}
export function isHTMLElement(o) {
return typeof HTMLElement === 'object'
? o instanceof HTMLElement
: o && typeof o === 'object' && o.nodeType === 1 && typeof o.nodeName === 'string';
}
export function isEmptyArray(array) {
return array.length === 0;
}
export function isRollingDanmu(o) {
return Object.prototype.hasOwnProperty.call(o, 'speed') && Object.prototype.hasOwnProperty.call(o, 'offset');
}
//# sourceMappingURL=is.js.map