Ignore:
Timestamp:
01/21/25 03:08:24 (3 days ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
0c6b92a
Message:

F4 Finalna Verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/node_modules/is-number-object/index.js

    r0c6b92a r79a0317  
    11'use strict';
    22
    3 var numToStr = Number.prototype.toString;
     3var callBound = require('call-bound');
     4
     5var $numToStr = callBound('Number.prototype.toString');
     6
     7/** @type {import('.')} */
    48var tryNumberObject = function tryNumberObject(value) {
    59        try {
    6                 numToStr.call(value);
     10                $numToStr(value);
    711                return true;
    812        } catch (e) {
     
    1014        }
    1115};
    12 var toStr = Object.prototype.toString;
     16var $toString = callBound('Object.prototype.toString');
    1317var numClass = '[object Number]';
    1418var hasToStringTag = require('has-tostringtag/shams')();
    1519
     20/** @type {import('.')} */
    1621module.exports = function isNumberObject(value) {
    1722        if (typeof value === 'number') {
    1823                return true;
    1924        }
    20         if (typeof value !== 'object') {
     25        if (!value || typeof value !== 'object') {
    2126                return false;
    2227        }
    23         return hasToStringTag ? tryNumberObject(value) : toStr.call(value) === numClass;
     28        return hasToStringTag ? tryNumberObject(value) : $toString(value) === numClass;
    2429};
Note: See TracChangeset for help on using the changeset viewer.