-
-
Notifications
You must be signed in to change notification settings - Fork 721
Expand file tree
/
Copy pathindex.js
More file actions
118 lines (88 loc) · 2.66 KB
/
Copy pathindex.js
File metadata and controls
118 lines (88 loc) · 2.66 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*!
* chai
* Copyright(c) 2011 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed
*/
// Dependencies that are used for multiple exports are required here only once
import * as checkError from 'check-error';
// test utility
export {test} from './test.js';
// type utility
import {type} from './type-detect.js';
export {type};
// expectTypes utility
export {expectTypes} from './expectTypes.js';
// message utility
export {getMessage} from './getMessage.js';
// actual utility
export {getActual} from './getActual.js';
// Inspect util
export {inspect} from './inspect.js';
// Object Display util
export {objDisplay} from './objDisplay.js';
// Flag utility
export {flag} from './flag.js';
// Flag transferring utility
export {transferFlags} from './transferFlags.js';
// Deep equal utility
export {default as eql} from 'deep-eql';
// Deep path info
export {getPathInfo, hasProperty} from 'pathval';
/**
* Function name
*
* @param {Function} fn
* @returns {string}
*/
export function getName(fn) {
return fn.name;
}
// add Property
export {addProperty} from './addProperty.js';
// add Method
export {addMethod} from './addMethod.js';
// overwrite Property
export {overwriteProperty} from './overwriteProperty.js';
// overwrite Method
export {overwriteMethod} from './overwriteMethod.js';
// Add a chainable method
export {addChainableMethod} from './addChainableMethod.js';
// Overwrite chainable method
export {overwriteChainableMethod} from './overwriteChainableMethod.js';
// Compare by inspect method
export {compareByInspect} from './compareByInspect.js';
// Get own enumerable property symbols method
export {getOwnEnumerablePropertySymbols} from './getOwnEnumerablePropertySymbols.js';
// Get own enumerable properties method
export {getOwnEnumerableProperties} from './getOwnEnumerableProperties.js';
// Checks error against a given set of criteria
export {checkError};
// Proxify util
export {proxify} from './proxify.js';
// addLengthGuard util
export {addLengthGuard} from './addLengthGuard.js';
// isProxyEnabled helper
export {isProxyEnabled} from './isProxyEnabled.js';
// isNaN method
export {isNaN} from './isNaN.js';
// getOperator method
export {getOperator} from './getOperator.js';
/**
* Determines if an object is a `RegExp`
* This is used since `instanceof` will not work in virtual contexts
*
* @param {*} obj Object to test
* @returns {boolean}
*/
export function isRegExp(obj) {
return Object.prototype.toString.call(obj) === '[object RegExp]';
}
/**
* Determines if an object is numeric or not
*
* @param {unknown} obj Object to test
* @returns {boolean}
*/
export function isNumeric(obj) {
return ['Number', 'BigInt'].includes(type(obj));
}