nv-constexpr-simple-codify 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +12 -12
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -215,6 +215,18 @@ function is_supported(o, rtrn_pair = true, seen = new WeakSet()) {
|
|
|
215
215
|
seen.add(o);
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
+
// 7. 支持的基础类型
|
|
219
|
+
if (
|
|
220
|
+
o === undefined ||
|
|
221
|
+
o === null ||
|
|
222
|
+
typeof o === 'boolean' ||
|
|
223
|
+
typeof o === 'string' ||
|
|
224
|
+
typeof o === 'number' ||
|
|
225
|
+
typeof o === 'bigint'
|
|
226
|
+
) {
|
|
227
|
+
return rtrn_pair ? [true, null] : true;
|
|
228
|
+
}
|
|
229
|
+
|
|
218
230
|
// 2. 排除 Symbol
|
|
219
231
|
if (typeof o === 'symbol') {
|
|
220
232
|
return rtrn_pair ? [false, "Symbol is not supported"] : false;
|
|
@@ -240,18 +252,6 @@ function is_supported(o, rtrn_pair = true, seen = new WeakSet()) {
|
|
|
240
252
|
return rtrn_pair ? [false, "Iterator is not supported"] : false;
|
|
241
253
|
}
|
|
242
254
|
|
|
243
|
-
// 7. 支持的基础类型
|
|
244
|
-
if (
|
|
245
|
-
o === undefined ||
|
|
246
|
-
o === null ||
|
|
247
|
-
typeof o === 'boolean' ||
|
|
248
|
-
typeof o === 'string' ||
|
|
249
|
-
typeof o === 'number' ||
|
|
250
|
-
typeof o === 'bigint'
|
|
251
|
-
) {
|
|
252
|
-
return rtrn_pair ? [true, null] : true;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
255
|
// 8. 支持的特殊对象类型
|
|
256
256
|
if (o instanceof Date) {
|
|
257
257
|
return rtrn_pair ? [true, null] : true;
|