-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutilities.d.ts
More file actions
44 lines (44 loc) · 2.1 KB
/
utilities.d.ts
File metadata and controls
44 lines (44 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { type DifferenceType } from './types.js';
/**
* Get the unknown value type as a string
* @param unknownValue - A value of unknown type
* @returns The unknown value type as a string
*/
export declare function getTypeOfUnknown(unknownValue: unknown): 'array' | 'boolean' | 'date' | 'function' | 'null' | 'number' | 'object' | 'string' | 'symbol' | 'undefined';
/**
* Check if the unknown value is blank, which means its either an empty string, undefined or null
* @param potentialBlank - A value of unknown type
* @returns True if the value is blank, false otherwise
*/
export declare function isBlank(potentialBlank: unknown): boolean;
/**
* Check if the unknown value is a simple value, which means its either a boolean, number or string
* @param potentialValue - A value of unknown type
* @returns True if the value is a simple value, false otherwise
*/
export declare function isValue(potentialValue: unknown): potentialValue is boolean | number | string;
/**
* Check if the unknown value is an array
* @param potentialArray - A value of unknown type
* @returns True if the value is an array, false otherwise
*/
export declare function isArray(potentialArray: unknown): potentialArray is unknown[];
/**
* Check if the unknown value is a function
* @param potentialFunction - A value of unknown type
* @returns True if the value is a function, false otherwise
*/
export declare function isFunction(potentialFunction: unknown): potentialFunction is Function;
/**
* Check if the unknown value is a symbol
* @param potentialSymbol - A value of unknown type
* @returns True if the value is a symbol, false otherwise
*/
export declare function isSymbol(potentialSymbol: unknown): potentialSymbol is symbol;
/**
* Check if the unknown value is an object, which means it's not a simple value, array, date, function or symbol
* @param potentialObject - A value of unknown type
* @returns True if the value is an object, false otherwise
*/
export declare function isObject(potentialObject: unknown): potentialObject is object;
export declare function getDifferenceType(valueFrom: unknown, valueTo: unknown): DifferenceType;