1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.isNumber = isNumber;
|
7 | exports.isBigNumber = isBigNumber;
|
8 | exports.isComplex = isComplex;
|
9 | exports.isFraction = isFraction;
|
10 | exports.isUnit = isUnit;
|
11 | exports.isString = isString;
|
12 | exports.isMatrix = isMatrix;
|
13 | exports.isCollection = isCollection;
|
14 | exports.isDenseMatrix = isDenseMatrix;
|
15 | exports.isSparseMatrix = isSparseMatrix;
|
16 | exports.isRange = isRange;
|
17 | exports.isIndex = isIndex;
|
18 | exports.isBoolean = isBoolean;
|
19 | exports.isResultSet = isResultSet;
|
20 | exports.isHelp = isHelp;
|
21 | exports.isFunction = isFunction;
|
22 | exports.isDate = isDate;
|
23 | exports.isRegExp = isRegExp;
|
24 | exports.isObject = isObject;
|
25 | exports.isNull = isNull;
|
26 | exports.isUndefined = isUndefined;
|
27 | exports.isAccessorNode = isAccessorNode;
|
28 | exports.isArrayNode = isArrayNode;
|
29 | exports.isAssignmentNode = isAssignmentNode;
|
30 | exports.isBlockNode = isBlockNode;
|
31 | exports.isConditionalNode = isConditionalNode;
|
32 | exports.isConstantNode = isConstantNode;
|
33 | exports.isFunctionAssignmentNode = isFunctionAssignmentNode;
|
34 | exports.isFunctionNode = isFunctionNode;
|
35 | exports.isIndexNode = isIndexNode;
|
36 | exports.isNode = isNode;
|
37 | exports.isObjectNode = isObjectNode;
|
38 | exports.isOperatorNode = isOperatorNode;
|
39 | exports.isParenthesisNode = isParenthesisNode;
|
40 | exports.isRangeNode = isRangeNode;
|
41 | exports.isSymbolNode = isSymbolNode;
|
42 | exports.isChain = isChain;
|
43 | exports.typeOf = typeOf;
|
44 | exports.isArray = void 0;
|
45 |
|
46 | function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 | function isNumber(x) {
|
62 | return typeof x === 'number';
|
63 | }
|
64 |
|
65 | function isBigNumber(x) {
|
66 | return x && x.constructor.prototype.isBigNumber === true || false;
|
67 | }
|
68 |
|
69 | function isComplex(x) {
|
70 | return x && _typeof(x) === 'object' && Object.getPrototypeOf(x).isComplex === true || false;
|
71 | }
|
72 |
|
73 | function isFraction(x) {
|
74 | return x && _typeof(x) === 'object' && Object.getPrototypeOf(x).isFraction === true || false;
|
75 | }
|
76 |
|
77 | function isUnit(x) {
|
78 | return x && x.constructor.prototype.isUnit === true || false;
|
79 | }
|
80 |
|
81 | function isString(x) {
|
82 | return typeof x === 'string';
|
83 | }
|
84 |
|
85 | var isArray = Array.isArray;
|
86 | exports.isArray = isArray;
|
87 |
|
88 | function isMatrix(x) {
|
89 | return x && x.constructor.prototype.isMatrix === true || false;
|
90 | }
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 | function isCollection(x) {
|
99 | return Array.isArray(x) || isMatrix(x);
|
100 | }
|
101 |
|
102 | function isDenseMatrix(x) {
|
103 | return x && x.isDenseMatrix && x.constructor.prototype.isMatrix === true || false;
|
104 | }
|
105 |
|
106 | function isSparseMatrix(x) {
|
107 | return x && x.isSparseMatrix && x.constructor.prototype.isMatrix === true || false;
|
108 | }
|
109 |
|
110 | function isRange(x) {
|
111 | return x && x.constructor.prototype.isRange === true || false;
|
112 | }
|
113 |
|
114 | function isIndex(x) {
|
115 | return x && x.constructor.prototype.isIndex === true || false;
|
116 | }
|
117 |
|
118 | function isBoolean(x) {
|
119 | return typeof x === 'boolean';
|
120 | }
|
121 |
|
122 | function isResultSet(x) {
|
123 | return x && x.constructor.prototype.isResultSet === true || false;
|
124 | }
|
125 |
|
126 | function isHelp(x) {
|
127 | return x && x.constructor.prototype.isHelp === true || false;
|
128 | }
|
129 |
|
130 | function isFunction(x) {
|
131 | return typeof x === 'function';
|
132 | }
|
133 |
|
134 | function isDate(x) {
|
135 | return x instanceof Date;
|
136 | }
|
137 |
|
138 | function isRegExp(x) {
|
139 | return x instanceof RegExp;
|
140 | }
|
141 |
|
142 | function isObject(x) {
|
143 | return !!(x && _typeof(x) === 'object' && x.constructor === Object && !isComplex(x) && !isFraction(x));
|
144 | }
|
145 |
|
146 | function isNull(x) {
|
147 | return x === null;
|
148 | }
|
149 |
|
150 | function isUndefined(x) {
|
151 | return x === undefined;
|
152 | }
|
153 |
|
154 | function isAccessorNode(x) {
|
155 | return x && x.isAccessorNode === true && x.constructor.prototype.isNode === true || false;
|
156 | }
|
157 |
|
158 | function isArrayNode(x) {
|
159 | return x && x.isArrayNode === true && x.constructor.prototype.isNode === true || false;
|
160 | }
|
161 |
|
162 | function isAssignmentNode(x) {
|
163 | return x && x.isAssignmentNode === true && x.constructor.prototype.isNode === true || false;
|
164 | }
|
165 |
|
166 | function isBlockNode(x) {
|
167 | return x && x.isBlockNode === true && x.constructor.prototype.isNode === true || false;
|
168 | }
|
169 |
|
170 | function isConditionalNode(x) {
|
171 | return x && x.isConditionalNode === true && x.constructor.prototype.isNode === true || false;
|
172 | }
|
173 |
|
174 | function isConstantNode(x) {
|
175 | return x && x.isConstantNode === true && x.constructor.prototype.isNode === true || false;
|
176 | }
|
177 |
|
178 | function isFunctionAssignmentNode(x) {
|
179 | return x && x.isFunctionAssignmentNode === true && x.constructor.prototype.isNode === true || false;
|
180 | }
|
181 |
|
182 | function isFunctionNode(x) {
|
183 | return x && x.isFunctionNode === true && x.constructor.prototype.isNode === true || false;
|
184 | }
|
185 |
|
186 | function isIndexNode(x) {
|
187 | return x && x.isIndexNode === true && x.constructor.prototype.isNode === true || false;
|
188 | }
|
189 |
|
190 | function isNode(x) {
|
191 | return x && x.isNode === true && x.constructor.prototype.isNode === true || false;
|
192 | }
|
193 |
|
194 | function isObjectNode(x) {
|
195 | return x && x.isObjectNode === true && x.constructor.prototype.isNode === true || false;
|
196 | }
|
197 |
|
198 | function isOperatorNode(x) {
|
199 | return x && x.isOperatorNode === true && x.constructor.prototype.isNode === true || false;
|
200 | }
|
201 |
|
202 | function isParenthesisNode(x) {
|
203 | return x && x.isParenthesisNode === true && x.constructor.prototype.isNode === true || false;
|
204 | }
|
205 |
|
206 | function isRangeNode(x) {
|
207 | return x && x.isRangeNode === true && x.constructor.prototype.isNode === true || false;
|
208 | }
|
209 |
|
210 | function isSymbolNode(x) {
|
211 | return x && x.isSymbolNode === true && x.constructor.prototype.isNode === true || false;
|
212 | }
|
213 |
|
214 | function isChain(x) {
|
215 | return x && x.constructor.prototype.isChain === true || false;
|
216 | }
|
217 |
|
218 | function typeOf(x) {
|
219 | var t = _typeof(x);
|
220 |
|
221 | if (t === 'object') {
|
222 |
|
223 | if (x === null) return 'null';
|
224 | if (Array.isArray(x)) return 'Array';
|
225 | if (x instanceof Date) return 'Date';
|
226 | if (x instanceof RegExp) return 'RegExp';
|
227 |
|
228 | if (isBigNumber(x)) return 'BigNumber';
|
229 | if (isComplex(x)) return 'Complex';
|
230 | if (isFraction(x)) return 'Fraction';
|
231 | if (isMatrix(x)) return 'Matrix';
|
232 | if (isUnit(x)) return 'Unit';
|
233 | if (isIndex(x)) return 'Index';
|
234 | if (isRange(x)) return 'Range';
|
235 | if (isResultSet(x)) return 'ResultSet';
|
236 | if (isNode(x)) return x.type;
|
237 | if (isChain(x)) return 'Chain';
|
238 | if (isHelp(x)) return 'Help';
|
239 | return 'Object';
|
240 | }
|
241 |
|
242 | if (t === 'function') return 'Function';
|
243 | return t;
|
244 | } |
\ | No newline at end of file |