MCPcopy Create free account
hub / github.com/formkit/formkit / empty

Function empty

packages/utils/src/index.ts:168–185  ·  view source on GitHub ↗
(
  value: any // eslint-disable-line
)

Source from the content-addressed store, hash-verified

166 * @public
167 */
168export function empty(
169 value: any // eslint-disable-line
170): boolean {
171 const type = typeof value
172 if (type === 'number') return false
173 if (value === undefined) return true
174 if (type === 'string') {
175 return value === ''
176 }
177 if (type === 'object') {
178 if (value === null) return true
179 for (const _i in value) return false
180 if (value instanceof RegExp) return false
181 if (value instanceof Date) return false
182 return true
183 }
184 return false
185}
186
187/**
188 * Escape a string for use in regular expressions.

Callers 10

reactBindingsFunction · 0.90
recalculateContextStateFunction · 0.90
utils.spec.tsFile · 0.90
resetFunction · 0.90
runFunction · 0.90
requiredFunction · 0.90
requiredFunction · 0.90
require_oneFunction · 0.90
vueBindingsFunction · 0.90

Calls

no outgoing calls

Tested by 1

requiredFunction · 0.72