|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
494 bytes
|
| Rev | Line | |
|---|
| [a762898] | 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|---|
| 4 |
|
|---|
| 5 | const toInteger = require('./toInteger.js');
|
|---|
| 6 | const MAX_SAFE_INTEGER = require('../_internal/MAX_SAFE_INTEGER.js');
|
|---|
| 7 | const clamp = require('../math/clamp.js');
|
|---|
| 8 |
|
|---|
| 9 | function toSafeInteger(value) {
|
|---|
| 10 | if (value == null) {
|
|---|
| 11 | return 0;
|
|---|
| 12 | }
|
|---|
| 13 | return clamp.clamp(toInteger.toInteger(value), -MAX_SAFE_INTEGER.MAX_SAFE_INTEGER, MAX_SAFE_INTEGER.MAX_SAFE_INTEGER);
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | exports.toSafeInteger = toSafeInteger;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.