UNPKG

772 BJavaScriptView Raw
1export const isDefined = (val) => {
2 return val !== undefined;
3};
4export const notNull = (val) => {
5 return val !== null;
6};
7export const isJust = notNull;
8export const isValue = (val) => {
9 return isDefined(val) && notNull(val);
10};
11export const isBool = (val) => {
12 return typeof val === 'boolean';
13};
14export const isNum = (val) => {
15 return typeof val === 'number';
16};
17export const isString = (val) => {
18 return typeof val === 'string';
19};
20export const isObject = (val) => {
21 return val !== null && typeof val === 'object';
22};
23export const isBlob = (val) => {
24 if (typeof Blob === 'undefined')
25 return false;
26 return val instanceof Blob || (isObject(val) && val?.constructor?.name === 'Blob');
27};
28//# sourceMappingURL=type-checks.js.map
\No newline at end of file