object-str-find
Version:
Find substring or match regexp in the object and his inner objects.
12 lines (8 loc) • 327 B
JavaScript
const isRegExp = item => typeof item === 'object' && item.constructor === RegExp
const isObject = item => item instanceof Object && item.constructor === Object
const getOnlyTargetFields = entries => entries.filter(({ value }) => typeof value === 'string')
module.exports = {
isObject,
isRegExp,
getOnlyTargetFields,
}