vuestic-ui
Version:
Vue 3 UI Framework
1 lines • 963 B
Source Map (JSON)
{"version":3,"file":"isNilValue.mjs","sources":["../../../../src/utils/isNilValue.ts"],"sourcesContent":["const nilValues = [null, undefined, '' as const]\nconst nullOrUndefined = [null, undefined]\n\n/**\n * Checks if provided value not exists.\n *\n * @param value any value to check it.\n */\nexport const isNilValue = (value: any): value is null | undefined | '' => {\n // lodash `isNil` isn't an alternative, because we also want to handle empty string values\n return nilValues.includes(value)\n}\n\nexport const notNil = <T>(value: T): value is NonNullable<T> => !isNilValue(value)\n\nexport const isNil = (value: any): value is null | undefined => {\n return nullOrUndefined.includes(value)\n}\n"],"names":[],"mappings":"AAAA,MAAM,YAAY,CAAC,MAAM,QAAW,EAAW;AAC/C,MAAM,kBAAkB,CAAC,MAAM,MAAS;AAO3B,MAAA,aAAa,CAAC,UAA+C;AAEjE,SAAA,UAAU,SAAS,KAAK;AACjC;AAEO,MAAM,SAAS,CAAI,UAAsC,CAAC,WAAW,KAAK;AAEpE,MAAA,QAAQ,CAAC,UAA0C;AACvD,SAAA,gBAAgB,SAAS,KAAK;AACvC;"}