@procedures/quantity 0.0.0-stage → 0.62.0

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.
@@ -0,0 +1,1220 @@
1
+ export const manifest = {
2
+ "format": "procedures-exports/1",
3
+ "package": "@mark1russell7/quantity",
4
+ "version": "0.4.1",
5
+ "entry": ".",
6
+ "namespace": [
7
+ "quantity"
8
+ ],
9
+ "$defs": {
10
+ "Extent": {
11
+ "anyOf": [
12
+ {
13
+ "$ref": "#/$defs/Quantity"
14
+ },
15
+ {
16
+ "$ref": "#/$defs/Unbounded"
17
+ }
18
+ ]
19
+ },
20
+ "FormatOptions": {
21
+ "type": "object",
22
+ "properties": {
23
+ "digits": {
24
+ "type": "number",
25
+ "description": "This number is the most decimal places to show (the default is 2). Money shows exactly this many when it is given. Otherwise money shows its cents only when it has cents: $400, $42.49."
26
+ },
27
+ "signed": {
28
+ "type": "boolean",
29
+ "description": "This option shows a + on a positive amount, for changes."
30
+ }
31
+ }
32
+ },
33
+ "MeasuredOn": {
34
+ "type": "object",
35
+ "properties": {
36
+ "hz": {
37
+ "type": "number",
38
+ "description": "The timer frequency of the kernel converts jiffies: at 250, one jiffy is 4 ms."
39
+ }
40
+ }
41
+ },
42
+ "Quantity": {
43
+ "type": "object",
44
+ "properties": {
45
+ "value": {
46
+ "type": "number"
47
+ },
48
+ "unit": {
49
+ "type": "string"
50
+ }
51
+ },
52
+ "required": [
53
+ "value",
54
+ "unit"
55
+ ]
56
+ },
57
+ "Scale": {
58
+ "type": "object",
59
+ "properties": {
60
+ "steps": {
61
+ "type": "array",
62
+ "items": {
63
+ "$ref": "#/$defs/ScaleStep"
64
+ }
65
+ },
66
+ "compound": {
67
+ "$ref": "#/$defs/ScaleCompound"
68
+ }
69
+ },
70
+ "required": [
71
+ "steps"
72
+ ]
73
+ },
74
+ "ScaleCompound": {
75
+ "type": "object",
76
+ "properties": {
77
+ "units": {
78
+ "type": "array",
79
+ "items": {
80
+ "type": "string"
81
+ },
82
+ "description": "The units of the compound, from the largest to the smallest."
83
+ },
84
+ "parts": {
85
+ "type": "number",
86
+ "description": "This number is the most units that the text names (the default is all). The smallest of them is rounded."
87
+ }
88
+ },
89
+ "required": [
90
+ "units"
91
+ ]
92
+ },
93
+ "ScaleStep": {
94
+ "type": "object",
95
+ "properties": {
96
+ "unit": {
97
+ "type": "string",
98
+ "description": "The unit of the step. The text shows its symbol, so the text reads back as the same amount."
99
+ },
100
+ "digits": {
101
+ "type": "number",
102
+ "description": "This number is the most decimal places (the default is 2)."
103
+ },
104
+ "significant": {
105
+ "type": "number",
106
+ "description": "This number is the significant digits. The decimal places then shrink as the number grows, but stay at most `digits`: with 2, the text is \"0.42\", \"3.5\" and \"120\"."
107
+ },
108
+ "fixed": {
109
+ "type": "boolean",
110
+ "description": "This option always shows `digits` decimal places: \"1.0\", not \"1\"."
111
+ }
112
+ },
113
+ "required": [
114
+ "unit"
115
+ ]
116
+ },
117
+ "Unbounded": {
118
+ "type": "object",
119
+ "properties": {
120
+ "value": {
121
+ "const": "infinite"
122
+ },
123
+ "unit": {
124
+ "type": "string"
125
+ }
126
+ },
127
+ "required": [
128
+ "value",
129
+ "unit"
130
+ ]
131
+ },
132
+ "Unknown": {
133
+ "type": "object",
134
+ "properties": {
135
+ "unknown": {
136
+ "type": "string"
137
+ },
138
+ "unit": {
139
+ "type": "string"
140
+ }
141
+ },
142
+ "required": [
143
+ "unknown"
144
+ ]
145
+ }
146
+ },
147
+ "procedures": [
148
+ {
149
+ "name": "add",
150
+ "path": [
151
+ "quantity",
152
+ "add"
153
+ ],
154
+ "description": "This function gives a + b in the unit of a. It is exact for decimal inputs, thus money adds to the cent.",
155
+ "params": [
156
+ "a",
157
+ "b"
158
+ ],
159
+ "input": {
160
+ "type": "object",
161
+ "properties": {
162
+ "a": {
163
+ "$ref": "#/$defs/Quantity"
164
+ },
165
+ "b": {
166
+ "$ref": "#/$defs/Quantity"
167
+ }
168
+ },
169
+ "required": [
170
+ "a",
171
+ "b"
172
+ ],
173
+ "additionalProperties": false
174
+ },
175
+ "output": {
176
+ "$ref": "#/$defs/Quantity"
177
+ },
178
+ "effects": {
179
+ "reads": [],
180
+ "writes": []
181
+ }
182
+ },
183
+ {
184
+ "name": "canonicalUnit",
185
+ "path": [
186
+ "quantity",
187
+ "canonicalUnit"
188
+ ],
189
+ "description": "This function gives the canonical spelling of a unit, for data from another system: \"hr\" is \"h\".",
190
+ "params": [
191
+ "spelling"
192
+ ],
193
+ "input": {
194
+ "type": "object",
195
+ "properties": {
196
+ "spelling": {
197
+ "type": "string"
198
+ }
199
+ },
200
+ "required": [
201
+ "spelling"
202
+ ],
203
+ "additionalProperties": false
204
+ },
205
+ "output": {
206
+ "type": "string"
207
+ },
208
+ "effects": {
209
+ "reads": [],
210
+ "writes": []
211
+ }
212
+ },
213
+ {
214
+ "name": "compare",
215
+ "path": [
216
+ "quantity",
217
+ "compare"
218
+ ],
219
+ "description": "This function gives -1, 0 or 1. Infinity is larger than all amounts, and equal to itself.",
220
+ "params": [
221
+ "a",
222
+ "b"
223
+ ],
224
+ "input": {
225
+ "type": "object",
226
+ "properties": {
227
+ "a": {
228
+ "$ref": "#/$defs/Extent"
229
+ },
230
+ "b": {
231
+ "$ref": "#/$defs/Extent"
232
+ }
233
+ },
234
+ "required": [
235
+ "a",
236
+ "b"
237
+ ],
238
+ "additionalProperties": false
239
+ },
240
+ "output": {
241
+ "type": "number"
242
+ },
243
+ "effects": {
244
+ "reads": [],
245
+ "writes": []
246
+ }
247
+ },
248
+ {
249
+ "name": "convert",
250
+ "path": [
251
+ "quantity",
252
+ "convert"
253
+ ],
254
+ "params": [
255
+ "amount",
256
+ "to",
257
+ "on"
258
+ ],
259
+ "input": {
260
+ "type": "object",
261
+ "properties": {
262
+ "amount": {
263
+ "$ref": "#/$defs/Quantity"
264
+ },
265
+ "to": {
266
+ "type": "string"
267
+ },
268
+ "on": {
269
+ "$ref": "#/$defs/MeasuredOn"
270
+ }
271
+ },
272
+ "required": [
273
+ "amount",
274
+ "to"
275
+ ],
276
+ "additionalProperties": false
277
+ },
278
+ "output": {
279
+ "$ref": "#/$defs/Quantity"
280
+ },
281
+ "effects": {
282
+ "reads": [],
283
+ "writes": []
284
+ }
285
+ },
286
+ {
287
+ "name": "convertible",
288
+ "path": [
289
+ "quantity",
290
+ "convertible"
291
+ ],
292
+ "params": [
293
+ "from",
294
+ "to"
295
+ ],
296
+ "input": {
297
+ "type": "object",
298
+ "properties": {
299
+ "from": {
300
+ "type": "string"
301
+ },
302
+ "to": {
303
+ "type": "string"
304
+ }
305
+ },
306
+ "required": [
307
+ "from",
308
+ "to"
309
+ ],
310
+ "additionalProperties": false
311
+ },
312
+ "output": {
313
+ "type": "boolean"
314
+ },
315
+ "effects": {
316
+ "reads": [],
317
+ "writes": []
318
+ }
319
+ },
320
+ {
321
+ "name": "format",
322
+ "path": [
323
+ "quantity",
324
+ "format"
325
+ ],
326
+ "description": "This function prints an amount: \"$1,234.56\", \"$500/mo\", \"7,875 s\", \"34.5%\", \"72°F\", \"12 reps\", \"∞ s\".",
327
+ "params": [
328
+ "amount",
329
+ "options"
330
+ ],
331
+ "input": {
332
+ "type": "object",
333
+ "properties": {
334
+ "amount": {
335
+ "anyOf": [
336
+ {
337
+ "$ref": "#/$defs/Quantity"
338
+ },
339
+ {
340
+ "$ref": "#/$defs/Unbounded"
341
+ },
342
+ {
343
+ "$ref": "#/$defs/Unknown"
344
+ }
345
+ ]
346
+ },
347
+ "options": {
348
+ "$ref": "#/$defs/FormatOptions"
349
+ }
350
+ },
351
+ "required": [
352
+ "amount"
353
+ ],
354
+ "additionalProperties": false
355
+ },
356
+ "output": {
357
+ "type": "string"
358
+ },
359
+ "effects": {
360
+ "reads": [],
361
+ "writes": []
362
+ }
363
+ },
364
+ {
365
+ "name": "formatDuration",
366
+ "path": [
367
+ "quantity",
368
+ "formatDuration"
369
+ ],
370
+ "description": "This function prints a time as people say it: \"2 h 11 min 15 s\", \"45 min\", \"2 days 3 h\". A time of less than a second keeps its own unit (\"250 ms\"). The `parts` option sets the most units that it names, and it rounds the smallest. It is `formatOnScale` with a compound of days, hours, minutes and seconds.",
371
+ "params": [
372
+ "amount",
373
+ "parts"
374
+ ],
375
+ "input": {
376
+ "type": "object",
377
+ "properties": {
378
+ "amount": {
379
+ "$ref": "#/$defs/Quantity"
380
+ },
381
+ "parts": {
382
+ "type": "number"
383
+ }
384
+ },
385
+ "required": [
386
+ "amount"
387
+ ],
388
+ "additionalProperties": false
389
+ },
390
+ "output": {
391
+ "type": "string"
392
+ },
393
+ "effects": {
394
+ "reads": [],
395
+ "writes": []
396
+ }
397
+ },
398
+ {
399
+ "name": "formatOnScale",
400
+ "path": [
401
+ "quantity",
402
+ "formatOnScale"
403
+ ],
404
+ "description": "This function prints an amount on a scale: \"512 B\", \"1.5 KiB\", \"3.5 ms\", \"1.25 s\", \"2 min 5 s\". It rounds the amount in a step before it compares the amount with the next step. Thus 1,048,575 B gives \"1 MiB\", not \"1,024 KiB\".",
405
+ "params": [
406
+ "amount",
407
+ "scale"
408
+ ],
409
+ "input": {
410
+ "type": "object",
411
+ "properties": {
412
+ "amount": {
413
+ "$ref": "#/$defs/Quantity"
414
+ },
415
+ "scale": {
416
+ "$ref": "#/$defs/Scale"
417
+ }
418
+ },
419
+ "required": [
420
+ "amount",
421
+ "scale"
422
+ ],
423
+ "additionalProperties": false
424
+ },
425
+ "output": {
426
+ "type": "string"
427
+ },
428
+ "effects": {
429
+ "reads": [],
430
+ "writes": []
431
+ }
432
+ },
433
+ {
434
+ "name": "formatUnit",
435
+ "path": [
436
+ "quantity",
437
+ "formatUnit"
438
+ ],
439
+ "description": "This function gives how a unit reads next to an amount: \"kcal/(h·kg)\", \"sets/wk\", \"% of 1RM\", \"mph\".",
440
+ "params": [
441
+ "unit",
442
+ "many"
443
+ ],
444
+ "input": {
445
+ "type": "object",
446
+ "properties": {
447
+ "unit": {
448
+ "type": "string"
449
+ },
450
+ "many": {
451
+ "type": "boolean"
452
+ }
453
+ },
454
+ "required": [
455
+ "unit"
456
+ ],
457
+ "additionalProperties": false
458
+ },
459
+ "output": {
460
+ "type": "string"
461
+ },
462
+ "effects": {
463
+ "reads": [],
464
+ "writes": []
465
+ }
466
+ },
467
+ {
468
+ "name": "isCanonicalUnit",
469
+ "path": [
470
+ "quantity",
471
+ "isCanonicalUnit"
472
+ ],
473
+ "description": "This function tells if stored data can have this spelling. Only the canonical spelling is correct.",
474
+ "params": [
475
+ "spelling"
476
+ ],
477
+ "input": {
478
+ "type": "object",
479
+ "properties": {
480
+ "spelling": {
481
+ "type": "string"
482
+ }
483
+ },
484
+ "required": [
485
+ "spelling"
486
+ ],
487
+ "additionalProperties": false
488
+ },
489
+ "output": {
490
+ "type": "boolean"
491
+ },
492
+ "effects": {
493
+ "reads": [],
494
+ "writes": []
495
+ }
496
+ },
497
+ {
498
+ "name": "isQuantity",
499
+ "path": [
500
+ "quantity",
501
+ "isQuantity"
502
+ ],
503
+ "description": "This function tells if a value from data is a quantity: a finite number and a canonical unit.",
504
+ "params": [
505
+ "value"
506
+ ],
507
+ "input": {
508
+ "type": "object",
509
+ "properties": {
510
+ "value": {}
511
+ },
512
+ "required": [
513
+ "value"
514
+ ],
515
+ "additionalProperties": false
516
+ },
517
+ "output": {
518
+ "type": "boolean"
519
+ },
520
+ "effects": {
521
+ "reads": [],
522
+ "writes": []
523
+ }
524
+ },
525
+ {
526
+ "name": "isUnbounded",
527
+ "path": [
528
+ "quantity",
529
+ "isUnbounded"
530
+ ],
531
+ "params": [
532
+ "extent"
533
+ ],
534
+ "input": {
535
+ "type": "object",
536
+ "properties": {
537
+ "extent": {
538
+ "$ref": "#/$defs/Extent"
539
+ }
540
+ },
541
+ "required": [
542
+ "extent"
543
+ ],
544
+ "additionalProperties": false
545
+ },
546
+ "output": {
547
+ "type": "boolean"
548
+ },
549
+ "effects": {
550
+ "reads": [],
551
+ "writes": []
552
+ }
553
+ },
554
+ {
555
+ "name": "kindOf",
556
+ "path": [
557
+ "quantity",
558
+ "kindOf"
559
+ ],
560
+ "params": [
561
+ "spelling"
562
+ ],
563
+ "input": {
564
+ "type": "object",
565
+ "properties": {
566
+ "spelling": {
567
+ "type": "string"
568
+ }
569
+ },
570
+ "required": [
571
+ "spelling"
572
+ ],
573
+ "additionalProperties": false
574
+ },
575
+ "output": {
576
+ "enum": [
577
+ "time",
578
+ "length",
579
+ "mass",
580
+ "temperature",
581
+ "data",
582
+ "money",
583
+ "current",
584
+ "count",
585
+ "ratio",
586
+ "level",
587
+ "frequency",
588
+ "transfer-rate",
589
+ "data-rate",
590
+ "speed",
591
+ "area",
592
+ "volume",
593
+ "energy",
594
+ "power",
595
+ "voltage",
596
+ "charge",
597
+ "resistance",
598
+ "specific-power",
599
+ "specific-volume-rate",
600
+ "money-rate",
601
+ "energy-price",
602
+ "derived"
603
+ ]
604
+ },
605
+ "effects": {
606
+ "reads": [],
607
+ "writes": []
608
+ }
609
+ },
610
+ {
611
+ "name": "kindOfQuantity",
612
+ "path": [
613
+ "quantity",
614
+ "kindOfQuantity"
615
+ ],
616
+ "description": "This function gives the kind that a quantity measures.",
617
+ "params": [
618
+ "amount"
619
+ ],
620
+ "input": {
621
+ "type": "object",
622
+ "properties": {
623
+ "amount": {
624
+ "anyOf": [
625
+ {
626
+ "$ref": "#/$defs/Quantity"
627
+ },
628
+ {
629
+ "$ref": "#/$defs/Unbounded"
630
+ }
631
+ ]
632
+ }
633
+ },
634
+ "required": [
635
+ "amount"
636
+ ],
637
+ "additionalProperties": false
638
+ },
639
+ "output": {
640
+ "enum": [
641
+ "time",
642
+ "length",
643
+ "mass",
644
+ "temperature",
645
+ "data",
646
+ "money",
647
+ "current",
648
+ "count",
649
+ "ratio",
650
+ "level",
651
+ "frequency",
652
+ "transfer-rate",
653
+ "data-rate",
654
+ "speed",
655
+ "area",
656
+ "volume",
657
+ "energy",
658
+ "power",
659
+ "voltage",
660
+ "charge",
661
+ "resistance",
662
+ "specific-power",
663
+ "specific-volume-rate",
664
+ "money-rate",
665
+ "energy-price",
666
+ "derived"
667
+ ]
668
+ },
669
+ "effects": {
670
+ "reads": [],
671
+ "writes": []
672
+ }
673
+ },
674
+ {
675
+ "name": "max",
676
+ "path": [
677
+ "quantity",
678
+ "max"
679
+ ],
680
+ "params": [
681
+ "a",
682
+ "b"
683
+ ],
684
+ "input": {
685
+ "type": "object",
686
+ "properties": {
687
+ "a": {
688
+ "$ref": "#/$defs/Extent"
689
+ },
690
+ "b": {
691
+ "$ref": "#/$defs/Extent"
692
+ }
693
+ },
694
+ "required": [
695
+ "a",
696
+ "b"
697
+ ],
698
+ "additionalProperties": false
699
+ },
700
+ "output": {
701
+ "$ref": "#/$defs/Extent"
702
+ },
703
+ "generics": [
704
+ "T"
705
+ ],
706
+ "effects": {
707
+ "reads": [],
708
+ "writes": []
709
+ }
710
+ },
711
+ {
712
+ "name": "mean",
713
+ "path": [
714
+ "quantity",
715
+ "mean"
716
+ ],
717
+ "description": "This function gives the arithmetic mean. For a logarithmic level, it gives the energy mean: 10·log10 of the mean power.",
718
+ "params": [
719
+ "amounts",
720
+ "unit"
721
+ ],
722
+ "input": {
723
+ "type": "object",
724
+ "properties": {
725
+ "amounts": {
726
+ "type": "array",
727
+ "items": {
728
+ "$ref": "#/$defs/Quantity"
729
+ }
730
+ },
731
+ "unit": {
732
+ "type": "string"
733
+ }
734
+ },
735
+ "required": [
736
+ "amounts"
737
+ ],
738
+ "additionalProperties": false
739
+ },
740
+ "output": {
741
+ "$ref": "#/$defs/Quantity"
742
+ },
743
+ "effects": {
744
+ "reads": [],
745
+ "writes": []
746
+ }
747
+ },
748
+ {
749
+ "name": "min",
750
+ "path": [
751
+ "quantity",
752
+ "min"
753
+ ],
754
+ "params": [
755
+ "a",
756
+ "b"
757
+ ],
758
+ "input": {
759
+ "type": "object",
760
+ "properties": {
761
+ "a": {
762
+ "$ref": "#/$defs/Extent"
763
+ },
764
+ "b": {
765
+ "$ref": "#/$defs/Extent"
766
+ }
767
+ },
768
+ "required": [
769
+ "a",
770
+ "b"
771
+ ],
772
+ "additionalProperties": false
773
+ },
774
+ "output": {
775
+ "$ref": "#/$defs/Extent"
776
+ },
777
+ "generics": [
778
+ "T"
779
+ ],
780
+ "effects": {
781
+ "reads": [],
782
+ "writes": []
783
+ }
784
+ },
785
+ {
786
+ "name": "quantity",
787
+ "path": [
788
+ "quantity",
789
+ "quantity"
790
+ ],
791
+ "description": "This function makes a quantity, and checks that it has a finite value and a canonical unit.",
792
+ "params": [
793
+ "value",
794
+ "unit"
795
+ ],
796
+ "input": {
797
+ "type": "object",
798
+ "properties": {
799
+ "value": {
800
+ "type": "number"
801
+ },
802
+ "unit": {
803
+ "type": "string"
804
+ }
805
+ },
806
+ "required": [
807
+ "value",
808
+ "unit"
809
+ ],
810
+ "additionalProperties": false
811
+ },
812
+ "output": {
813
+ "$ref": "#/$defs/Quantity"
814
+ },
815
+ "effects": {
816
+ "reads": [],
817
+ "writes": []
818
+ }
819
+ },
820
+ {
821
+ "name": "round",
822
+ "path": [
823
+ "quantity",
824
+ "round"
825
+ ],
826
+ "description": "This function rounds an amount to the decimals that its unit keeps (money to the cent), or to `decimals`.",
827
+ "params": [
828
+ "amount",
829
+ "decimals"
830
+ ],
831
+ "input": {
832
+ "type": "object",
833
+ "properties": {
834
+ "amount": {
835
+ "$ref": "#/$defs/Quantity"
836
+ },
837
+ "decimals": {
838
+ "type": "number"
839
+ }
840
+ },
841
+ "required": [
842
+ "amount"
843
+ ],
844
+ "additionalProperties": false
845
+ },
846
+ "output": {
847
+ "$ref": "#/$defs/Quantity"
848
+ },
849
+ "effects": {
850
+ "reads": [],
851
+ "writes": []
852
+ }
853
+ },
854
+ {
855
+ "name": "sameVector",
856
+ "path": [
857
+ "quantity",
858
+ "sameVector"
859
+ ],
860
+ "params": [
861
+ "a",
862
+ "b"
863
+ ],
864
+ "input": {
865
+ "type": "object",
866
+ "properties": {
867
+ "a": {
868
+ "type": "object",
869
+ "properties": {
870
+ "time": {
871
+ "type": "number"
872
+ },
873
+ "length": {
874
+ "type": "number"
875
+ },
876
+ "mass": {
877
+ "type": "number"
878
+ },
879
+ "temperature": {
880
+ "type": "number"
881
+ },
882
+ "data": {
883
+ "type": "number"
884
+ },
885
+ "money": {
886
+ "type": "number"
887
+ },
888
+ "current": {
889
+ "type": "number"
890
+ }
891
+ }
892
+ },
893
+ "b": {
894
+ "type": "object",
895
+ "properties": {
896
+ "time": {
897
+ "type": "number"
898
+ },
899
+ "length": {
900
+ "type": "number"
901
+ },
902
+ "mass": {
903
+ "type": "number"
904
+ },
905
+ "temperature": {
906
+ "type": "number"
907
+ },
908
+ "data": {
909
+ "type": "number"
910
+ },
911
+ "money": {
912
+ "type": "number"
913
+ },
914
+ "current": {
915
+ "type": "number"
916
+ }
917
+ }
918
+ }
919
+ },
920
+ "required": [
921
+ "a",
922
+ "b"
923
+ ],
924
+ "additionalProperties": false
925
+ },
926
+ "output": {
927
+ "type": "boolean"
928
+ },
929
+ "effects": {
930
+ "reads": [],
931
+ "writes": []
932
+ }
933
+ },
934
+ {
935
+ "name": "scale",
936
+ "path": [
937
+ "quantity",
938
+ "scale"
939
+ ],
940
+ "description": "This function multiplies an amount by a plain number: a count of probes, or a share.",
941
+ "params": [
942
+ "amount",
943
+ "by"
944
+ ],
945
+ "input": {
946
+ "type": "object",
947
+ "properties": {
948
+ "amount": {
949
+ "$ref": "#/$defs/Quantity"
950
+ },
951
+ "by": {
952
+ "type": "number"
953
+ }
954
+ },
955
+ "required": [
956
+ "amount",
957
+ "by"
958
+ ],
959
+ "additionalProperties": false
960
+ },
961
+ "output": {
962
+ "$ref": "#/$defs/Quantity"
963
+ },
964
+ "effects": {
965
+ "reads": [],
966
+ "writes": []
967
+ }
968
+ },
969
+ {
970
+ "name": "sub",
971
+ "path": [
972
+ "quantity",
973
+ "sub"
974
+ ],
975
+ "params": [
976
+ "a",
977
+ "b"
978
+ ],
979
+ "input": {
980
+ "type": "object",
981
+ "properties": {
982
+ "a": {
983
+ "$ref": "#/$defs/Quantity"
984
+ },
985
+ "b": {
986
+ "$ref": "#/$defs/Quantity"
987
+ }
988
+ },
989
+ "required": [
990
+ "a",
991
+ "b"
992
+ ],
993
+ "additionalProperties": false
994
+ },
995
+ "output": {
996
+ "$ref": "#/$defs/Quantity"
997
+ },
998
+ "effects": {
999
+ "reads": [],
1000
+ "writes": []
1001
+ }
1002
+ },
1003
+ {
1004
+ "name": "sum",
1005
+ "path": [
1006
+ "quantity",
1007
+ "sum"
1008
+ ],
1009
+ "description": "This function gives the sum in `unit`, or in the unit of the first amount. An empty sum needs `unit`.",
1010
+ "params": [
1011
+ "amounts",
1012
+ "unit"
1013
+ ],
1014
+ "input": {
1015
+ "type": "object",
1016
+ "properties": {
1017
+ "amounts": {
1018
+ "type": "array",
1019
+ "items": {
1020
+ "$ref": "#/$defs/Quantity"
1021
+ }
1022
+ },
1023
+ "unit": {
1024
+ "type": "string"
1025
+ }
1026
+ },
1027
+ "required": [
1028
+ "amounts"
1029
+ ],
1030
+ "additionalProperties": false
1031
+ },
1032
+ "output": {
1033
+ "$ref": "#/$defs/Quantity"
1034
+ },
1035
+ "effects": {
1036
+ "reads": [],
1037
+ "writes": []
1038
+ }
1039
+ },
1040
+ {
1041
+ "name": "toNanoseconds",
1042
+ "path": [
1043
+ "quantity",
1044
+ "toNanoseconds"
1045
+ ],
1046
+ "description": "This function gives a time as a whole number of nanoseconds, or refuses it. A double holds each whole nanosecond for approximately 104 days.",
1047
+ "params": [
1048
+ "amount",
1049
+ "on"
1050
+ ],
1051
+ "input": {
1052
+ "type": "object",
1053
+ "properties": {
1054
+ "amount": {
1055
+ "$ref": "#/$defs/Quantity"
1056
+ },
1057
+ "on": {
1058
+ "$ref": "#/$defs/MeasuredOn"
1059
+ }
1060
+ },
1061
+ "required": [
1062
+ "amount"
1063
+ ],
1064
+ "additionalProperties": false
1065
+ },
1066
+ "output": {
1067
+ "type": "number"
1068
+ },
1069
+ "effects": {
1070
+ "reads": [],
1071
+ "writes": []
1072
+ }
1073
+ },
1074
+ {
1075
+ "name": "unbounded",
1076
+ "path": [
1077
+ "quantity",
1078
+ "unbounded"
1079
+ ],
1080
+ "params": [
1081
+ "unit"
1082
+ ],
1083
+ "input": {
1084
+ "type": "object",
1085
+ "properties": {
1086
+ "unit": {
1087
+ "type": "string"
1088
+ }
1089
+ },
1090
+ "required": [
1091
+ "unit"
1092
+ ],
1093
+ "additionalProperties": false
1094
+ },
1095
+ "output": {
1096
+ "$ref": "#/$defs/Unbounded"
1097
+ },
1098
+ "effects": {
1099
+ "reads": [],
1100
+ "writes": []
1101
+ }
1102
+ },
1103
+ {
1104
+ "name": "valueIn",
1105
+ "path": [
1106
+ "quantity",
1107
+ "valueIn"
1108
+ ],
1109
+ "description": "This function gives the number that a quantity is in a unit.",
1110
+ "params": [
1111
+ "amount",
1112
+ "unit",
1113
+ "on"
1114
+ ],
1115
+ "input": {
1116
+ "type": "object",
1117
+ "properties": {
1118
+ "amount": {
1119
+ "$ref": "#/$defs/Quantity"
1120
+ },
1121
+ "unit": {
1122
+ "type": "string"
1123
+ },
1124
+ "on": {
1125
+ "$ref": "#/$defs/MeasuredOn"
1126
+ }
1127
+ },
1128
+ "required": [
1129
+ "amount",
1130
+ "unit"
1131
+ ],
1132
+ "additionalProperties": false
1133
+ },
1134
+ "output": {
1135
+ "type": "number"
1136
+ },
1137
+ "effects": {
1138
+ "reads": [],
1139
+ "writes": []
1140
+ }
1141
+ },
1142
+ {
1143
+ "name": "whyNotConvertible",
1144
+ "path": [
1145
+ "quantity",
1146
+ "whyNotConvertible"
1147
+ ],
1148
+ "description": "This function gives the reason that `from` cannot become `to`, or undefined when it can.",
1149
+ "params": [
1150
+ "from",
1151
+ "to"
1152
+ ],
1153
+ "input": {
1154
+ "type": "object",
1155
+ "properties": {
1156
+ "from": {
1157
+ "type": "string"
1158
+ },
1159
+ "to": {
1160
+ "type": "string"
1161
+ }
1162
+ },
1163
+ "required": [
1164
+ "from",
1165
+ "to"
1166
+ ],
1167
+ "additionalProperties": false
1168
+ },
1169
+ "output": {
1170
+ "anyOf": [
1171
+ {
1172
+ "type": "string"
1173
+ },
1174
+ {
1175
+ "type": "null"
1176
+ }
1177
+ ]
1178
+ },
1179
+ "effects": {
1180
+ "reads": [],
1181
+ "writes": []
1182
+ }
1183
+ }
1184
+ ],
1185
+ "exempt": [
1186
+ {
1187
+ "name": "convertExact",
1188
+ "reason": "input-not-json",
1189
+ "detail": "value.n: bigint"
1190
+ },
1191
+ {
1192
+ "name": "lookupAtom",
1193
+ "reason": "output-not-json",
1194
+ "detail": "factor.n: bigint"
1195
+ },
1196
+ {
1197
+ "name": "parseUnit",
1198
+ "reason": "output-not-json",
1199
+ "detail": "components.atom.factor.n: bigint"
1200
+ },
1201
+ {
1202
+ "name": "tryParseUnit",
1203
+ "reason": "output-not-json",
1204
+ "detail": "components.atom.factor.n: bigint"
1205
+ },
1206
+ {
1207
+ "name": "unitSystem",
1208
+ "reason": "input-not-json",
1209
+ "detail": "atoms.factor.n: bigint"
1210
+ }
1211
+ ],
1212
+ "others": {
1213
+ "classes": [
1214
+ "UnitError"
1215
+ ],
1216
+ "values": 14,
1217
+ "types": 18
1218
+ }
1219
+ };
1220
+ //# sourceMappingURL=manifest.js.map