UNPKG

frequency-set

Version:

A set that keeps the frequency of occurrences.

16 lines (11 loc) 427 B
function isIterable(object) { return typeof object[Symbol.iterator] === "function"; } function isValidStringPrimitive(value) { const vT = typeof value; return !(vT === "function" || (vT === "object" && value !== null)); } function isKeyValueArray(array) { return Array.isArray(array) && array.length === 2 && typeof array[1] === "number"; } module.exports = { isIterable, isValidStringPrimitive, isKeyValueArray };