source: node_modules/es-toolkit/dist/compat/math/divide.js@ a762898

Last change on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 6 months ago

Added visualizations

  • Property mode set to 100644
File size: 700 bytes
Line 
1'use strict';
2
3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
5const toNumber = require('../util/toNumber.js');
6const toString = require('../util/toString.js');
7
8function divide(value, other) {
9 if (value === undefined && other === undefined) {
10 return 1;
11 }
12 if (value === undefined || other === undefined) {
13 return value ?? other;
14 }
15 if (typeof value === 'string' || typeof other === 'string') {
16 value = toString.toString(value);
17 other = toString.toString(other);
18 }
19 else {
20 value = toNumber.toNumber(value);
21 other = toNumber.toNumber(other);
22 }
23 return value / other;
24}
25
26exports.divide = divide;
Note: See TracBrowser for help on using the repository browser.