@qubit-ltd/json 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +219 -0
  3. package/README.zh_CN.md +194 -0
  4. package/dist/json.cjs +623 -0
  5. package/dist/json.cjs.map +1 -0
  6. package/dist/json.min.cjs +1 -0
  7. package/dist/json.min.cjs.map +1 -0
  8. package/dist/json.min.mjs +1 -0
  9. package/dist/json.min.mjs.map +1 -0
  10. package/dist/json.mjs +610 -0
  11. package/dist/json.mjs.map +1 -0
  12. package/doc/api/LosslessNumber.html +610 -0
  13. package/doc/api/fonts/OpenSans-Bold-webfont.eot +0 -0
  14. package/doc/api/fonts/OpenSans-Bold-webfont.svg +1838 -0
  15. package/doc/api/fonts/OpenSans-Bold-webfont.woff +0 -0
  16. package/doc/api/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  17. package/doc/api/fonts/OpenSans-BoldItalic-webfont.svg +1838 -0
  18. package/doc/api/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  19. package/doc/api/fonts/OpenSans-Italic-webfont.eot +0 -0
  20. package/doc/api/fonts/OpenSans-Italic-webfont.svg +1838 -0
  21. package/doc/api/fonts/OpenSans-Italic-webfont.woff +0 -0
  22. package/doc/api/fonts/OpenSans-Light-webfont.eot +0 -0
  23. package/doc/api/fonts/OpenSans-Light-webfont.svg +1839 -0
  24. package/doc/api/fonts/OpenSans-Light-webfont.woff +0 -0
  25. package/doc/api/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  26. package/doc/api/fonts/OpenSans-LightItalic-webfont.svg +1843 -0
  27. package/doc/api/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  28. package/doc/api/fonts/OpenSans-Regular-webfont.eot +0 -0
  29. package/doc/api/fonts/OpenSans-Regular-webfont.svg +1839 -0
  30. package/doc/api/fonts/OpenSans-Regular-webfont.woff +0 -0
  31. package/doc/api/fonts/OpenSans-Semibold-webfont.eot +0 -0
  32. package/doc/api/fonts/OpenSans-Semibold-webfont.svg +1838 -0
  33. package/doc/api/fonts/OpenSans-Semibold-webfont.ttf +0 -0
  34. package/doc/api/fonts/OpenSans-Semibold-webfont.woff +0 -0
  35. package/doc/api/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
  36. package/doc/api/fonts/OpenSans-SemiboldItalic-webfont.svg +1838 -0
  37. package/doc/api/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
  38. package/doc/api/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
  39. package/doc/api/global.html +1274 -0
  40. package/doc/api/index.html +236 -0
  41. package/doc/api/scripts/linenumber.js +34 -0
  42. package/doc/api/scripts/prettify/Apache-License-2.0.txt +202 -0
  43. package/doc/api/scripts/prettify/lang-css.js +2 -0
  44. package/doc/api/scripts/prettify/prettify.js +28 -0
  45. package/doc/api/styles/jsdoc-default.css +699 -0
  46. package/doc/api/styles/prettify-jsdoc.css +120 -0
  47. package/doc/api/styles/prettify-tomorrow.css +141 -0
  48. package/doc/json.min.visualization.html +4949 -0
  49. package/doc/json.visualization.html +4949 -0
  50. package/package.json +87 -0
@@ -0,0 +1,610 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <title>LosslessNumber - Documentation</title>
7
+
8
+ <script src="scripts/prettify/prettify.js"></script>
9
+ <script src="scripts/prettify/lang-css.js"></script>
10
+ <!--[if lt IE 9]>
11
+ <script src="https://cdn.bootcdn.net/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
12
+ <![endif]-->
13
+ <link type="text/css" rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
14
+ <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
15
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
16
+ </head>
17
+ <body>
18
+
19
+ <input type="checkbox" id="nav-trigger" class="nav-trigger" />
20
+ <label for="nav-trigger" class="navicon-button x">
21
+ <div class="navicon"></div>
22
+ </label>
23
+
24
+ <label for="nav-trigger" class="overlay"></label>
25
+
26
+ <nav>
27
+ <li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Classes</li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="LosslessNumber.html">LosslessNumber</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="LosslessNumber.html#toString">toString</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="LosslessNumber.html#valueOf">valueOf</a></span></li><li class="nav-heading"><a href="global.html">Globals</a></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#getUnsafeReason">getUnsafeReason</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#isBigInt">isBigInt</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#isInteger">isInteger</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#isNumber">isNumber</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#isSafeNumber">isSafeNumber</a></span></li><li class="nav-item"><span class="nav-item-type type-member">M</span><span class="nav-item-name"><a href="global.html#json">json</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#toSafeNumberOrThrow">toSafeNumberOrThrow</a></span></li>
28
+ </nav>
29
+
30
+ <div id="main">
31
+
32
+ <h1 class="page-title">LosslessNumber</h1>
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+ <section>
41
+
42
+ <header>
43
+
44
+ <h2>
45
+ LosslessNumber
46
+ </h2>
47
+
48
+ <div class="class-description"><p>The class of lossless numbers, which stores its numeric value as string.</p></div>
49
+
50
+
51
+ </header>
52
+
53
+ <article>
54
+ <div class="container-overview">
55
+
56
+
57
+ <div class="section-method">
58
+
59
+
60
+ <h2>Constructor</h2>
61
+
62
+
63
+
64
+ <h4 class="name" id="LosslessNumber"><span class="type-signature"></span>new LosslessNumber<span class="signature">(value)</span><span class="type-signature"></span></h4>
65
+
66
+
67
+
68
+
69
+
70
+
71
+ <div class="description">
72
+ <p>Constructs a new instance of <code>LosslessNumber</code>.</p>
73
+ </div>
74
+
75
+
76
+
77
+
78
+
79
+ <dl class="details">
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+ </dl>
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+ <h5>Parameters:</h5>
123
+
124
+
125
+ <table class="params">
126
+ <thead>
127
+ <tr>
128
+
129
+ <th>Name</th>
130
+
131
+
132
+ <th>Type</th>
133
+
134
+
135
+
136
+
137
+
138
+ <th class="last">Description</th>
139
+ </tr>
140
+ </thead>
141
+
142
+ <tbody>
143
+
144
+
145
+ <tr>
146
+
147
+ <td class="name"><code>value</code></td>
148
+
149
+
150
+ <td class="type">
151
+
152
+
153
+ <span class="param-type"><code>string</code></span>
154
+
155
+
156
+
157
+ </td>
158
+
159
+
160
+
161
+
162
+
163
+ <td class="description last">
164
+ <p>The string representation of the number.</p>
165
+
166
+ </td>
167
+ </tr>
168
+
169
+
170
+ </tbody>
171
+ </table>
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+ </div>
193
+
194
+ </div>
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+ <h3 class="subsection-title">Members</h3>
208
+
209
+
210
+
211
+ <div class="section-members">
212
+ <h4 class="name" id="isLosslessNumber"><span class="type-signature"></span>isLosslessNumber<span class="type-signature"> :boolean</span></h4>
213
+
214
+
215
+
216
+
217
+ <div class="description">
218
+ <p>Whether the value is a lossless number.</p>
219
+ </div>
220
+
221
+
222
+
223
+
224
+
225
+ <dl class="details">
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+ </dl>
259
+
260
+
261
+
262
+ <h5>Type:</h5>
263
+ <ul>
264
+ <li>
265
+
266
+ <span class="param-type"><code>boolean</code></span>
267
+
268
+
269
+ </li>
270
+ </ul>
271
+
272
+
273
+
274
+
275
+
276
+ </div>
277
+
278
+
279
+
280
+ <div class="section-members">
281
+ <h4 class="name" id="value"><span class="type-signature"></span>value<span class="type-signature"> :string</span></h4>
282
+
283
+
284
+
285
+
286
+ <div class="description">
287
+ <p>The string representation of the number.</p>
288
+ </div>
289
+
290
+
291
+
292
+
293
+
294
+ <dl class="details">
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+
316
+
317
+
318
+
319
+
320
+
321
+
322
+
323
+
324
+
325
+
326
+
327
+ </dl>
328
+
329
+
330
+
331
+ <h5>Type:</h5>
332
+ <ul>
333
+ <li>
334
+
335
+ <span class="param-type"><code>string</code></span>
336
+
337
+
338
+ </li>
339
+ </ul>
340
+
341
+
342
+
343
+
344
+
345
+ </div>
346
+
347
+
348
+
349
+
350
+
351
+ <h3 class="subsection-title">Methods</h3>
352
+
353
+
354
+
355
+ <div class="section-method">
356
+
357
+
358
+
359
+
360
+ <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
361
+
362
+
363
+
364
+
365
+
366
+
367
+ <div class="description">
368
+ <p>Get the value of this <code>LosslessNumber</code> as string.</p>
369
+ </div>
370
+
371
+
372
+
373
+
374
+
375
+ <dl class="details">
376
+
377
+
378
+
379
+
380
+
381
+
382
+
383
+
384
+
385
+
386
+
387
+
388
+
389
+
390
+
391
+
392
+
393
+
394
+
395
+
396
+
397
+
398
+
399
+
400
+
401
+
402
+
403
+
404
+
405
+
406
+
407
+
408
+ </dl>
409
+
410
+
411
+
412
+
413
+
414
+
415
+
416
+
417
+
418
+
419
+
420
+
421
+
422
+
423
+
424
+
425
+
426
+
427
+
428
+
429
+
430
+
431
+
432
+ <div class="section-returns">
433
+ <h5>Returns:</h5>
434
+
435
+
436
+
437
+ <dl class="param-type">
438
+ <dt>
439
+ Type:
440
+ </dt>
441
+ <dd>
442
+
443
+ <span class="param-type"><code>string</code></span>
444
+
445
+
446
+ </dd>
447
+ </dl>
448
+
449
+
450
+ <div class="param-desc">
451
+ <p>the string representation of this <code>LosslessNumber</code>.</p>
452
+ </div>
453
+
454
+
455
+ </div>
456
+
457
+
458
+
459
+
460
+
461
+ </div>
462
+
463
+
464
+ <div class="section-method">
465
+
466
+
467
+
468
+
469
+ <h4 class="name" id="valueOf"><span class="type-signature"></span>valueOf<span class="signature">()</span><span class="type-signature"> &rarr; {number|bigint}</span></h4>
470
+
471
+
472
+
473
+
474
+
475
+
476
+ <div class="description">
477
+ <p>Get the value of the LosslessNumber as number or bigint.</p>
478
+ <ul>
479
+ <li>a number is returned for safe numbers and decimal values that only lose
480
+ some insignificant digits;</li>
481
+ <li>a bigint is returned for big integer numbers;</li>
482
+ <li>an Error is thrown for values that will overflow or underflow;</li>
483
+ </ul>
484
+ <p>Note that you can implement your own strategy for conversion by just
485
+ getting the value as string via <code>.toString()</code>, and using util functions
486
+ like <code>isInteger</code>, <code>isSafeNumber</code>, <code>getUnsafeReason</code>, and <code>toSafeNumberOrThrow</code>
487
+ to convert it to a numeric value.</p>
488
+ </div>
489
+
490
+
491
+
492
+
493
+
494
+ <dl class="details">
495
+
496
+
497
+
498
+
499
+
500
+
501
+
502
+
503
+
504
+
505
+
506
+
507
+
508
+
509
+
510
+
511
+
512
+
513
+
514
+
515
+
516
+
517
+
518
+
519
+
520
+
521
+
522
+
523
+
524
+
525
+
526
+
527
+ </dl>
528
+
529
+
530
+
531
+
532
+
533
+
534
+
535
+
536
+
537
+
538
+
539
+
540
+
541
+
542
+
543
+
544
+
545
+
546
+
547
+
548
+
549
+
550
+
551
+ <div class="section-returns">
552
+ <h5>Returns:</h5>
553
+
554
+
555
+
556
+ <dl class="param-type">
557
+ <dt>
558
+ Type:
559
+ </dt>
560
+ <dd>
561
+
562
+ <span class="param-type"><code>number</code></span>
563
+ |
564
+
565
+ <span class="param-type"><code>bigint</code></span>
566
+
567
+
568
+ </dd>
569
+ </dl>
570
+
571
+
572
+ <div class="param-desc">
573
+ <p>the numeric value of the LosslessNumber, as number or bigint.</p>
574
+ </div>
575
+
576
+
577
+ </div>
578
+
579
+
580
+
581
+
582
+
583
+ </div>
584
+
585
+
586
+
587
+
588
+
589
+
590
+ </article>
591
+
592
+ </section>
593
+
594
+
595
+
596
+
597
+ </div>
598
+
599
+ <br class="clear">
600
+
601
+ <footer>
602
+ Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a>
603
+ on Sun Jan 05 2025 14:35:14 GMT+0800 (China Standard Time)
604
+ using the <a href="https://github.com/Haixing-Hu/jsdoc-minami">customized Minami theme</a>.
605
+ </footer>
606
+
607
+ <script>prettyPrint();</script>
608
+ <script src="scripts/linenumber.js"></script>
609
+ </body>
610
+ </html>