source: node_modules/es-toolkit/dist/compat/util/toString.mjs

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

Added visualizations

  • Property mode set to 100644
File size: 388 bytes
Line 
1function toString(value) {
2 if (value == null) {
3 return '';
4 }
5 if (typeof value === 'string') {
6 return value;
7 }
8 if (Array.isArray(value)) {
9 return value.map(toString).join(',');
10 }
11 const result = String(value);
12 if (result === '0' && Object.is(Number(value), -0)) {
13 return '-0';
14 }
15 return result;
16}
17
18export { toString };
Note: See TracBrowser for help on using the repository browser.