|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
718 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | var isString = require('is-string');
|
|---|
| 4 | var isNumber = require('is-number-object');
|
|---|
| 5 | var isBoolean = require('is-boolean-object');
|
|---|
| 6 | var isSymbol = require('is-symbol');
|
|---|
| 7 | var isBigInt = require('is-bigint');
|
|---|
| 8 |
|
|---|
| 9 | /** @type {import('.')} */
|
|---|
| 10 | // eslint-disable-next-line consistent-return
|
|---|
| 11 | module.exports = function whichBoxedPrimitive(value) {
|
|---|
| 12 | // eslint-disable-next-line eqeqeq
|
|---|
| 13 | if (value == null || (typeof value !== 'object' && typeof value !== 'function')) {
|
|---|
| 14 | return null;
|
|---|
| 15 | }
|
|---|
| 16 | if (isString(value)) {
|
|---|
| 17 | return 'String';
|
|---|
| 18 | }
|
|---|
| 19 | if (isNumber(value)) {
|
|---|
| 20 | return 'Number';
|
|---|
| 21 | }
|
|---|
| 22 | if (isBoolean(value)) {
|
|---|
| 23 | return 'Boolean';
|
|---|
| 24 | }
|
|---|
| 25 | if (isSymbol(value)) {
|
|---|
| 26 | return 'Symbol';
|
|---|
| 27 | }
|
|---|
| 28 | if (isBigInt(value)) {
|
|---|
| 29 | return 'BigInt';
|
|---|
| 30 | }
|
|---|
| 31 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.