|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
485 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|---|
| 4 |
|
|---|
| 5 | function toString(value) {
|
|---|
| 6 | if (value == null) {
|
|---|
| 7 | return '';
|
|---|
| 8 | }
|
|---|
| 9 | if (typeof value === 'string') {
|
|---|
| 10 | return value;
|
|---|
| 11 | }
|
|---|
| 12 | if (Array.isArray(value)) {
|
|---|
| 13 | return value.map(toString).join(',');
|
|---|
| 14 | }
|
|---|
| 15 | const result = String(value);
|
|---|
| 16 | if (result === '0' && Object.is(Number(value), -0)) {
|
|---|
| 17 | return '-0';
|
|---|
| 18 | }
|
|---|
| 19 | return result;
|
|---|
| 20 | }
|
|---|
| 21 |
|
|---|
| 22 | exports.toString = toString;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.