File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ var DashJoin = ( 'object' === typeof module && exports ) || { } ;
2
+ ( function ( window , DashJoin ) {
3
+ 'use strict' ;
4
+
5
+ const DENOM_LOWEST = 100001 ;
6
+ const PREDENOM_MIN = DENOM_LOWEST + 193 ;
7
+
8
+ DashJoin . DENOM_LOWEST = DENOM_LOWEST ;
9
+ DashJoin . PREDENOM_MIN = PREDENOM_MIN ;
10
+ DashJoin . DENOMS = [
11
+ 100001 , // 0.00100001
12
+ 1000010 , // 0.01000010
13
+ 10000100 , // 0.10000100
14
+ 100001000 , // 1.00001000
15
+ 1000010000 , // 10.00010000
16
+ ] ;
17
+ let reverseDenoms = DashJoin . DENOMS . slice ( 0 ) ;
18
+ reverseDenoms . reverse ( ) ;
19
+
20
+ // Ask Niles if there's an layman-ish obvious way to do this
21
+ DashJoin . getDenom = function ( sats ) {
22
+ for ( let denom of reverseDenoms ) {
23
+ let isDenom = sats === denom ;
24
+ if ( isDenom ) {
25
+ return isDenom ;
26
+ }
27
+ }
28
+
29
+ return 0 ;
30
+ } ;
31
+
32
+ //@ts -ignore
33
+ window . DashJoin = DashJoin ;
34
+ } ) ( globalThis . window || { } , DashJoin ) ;
35
+ if ( 'object' === typeof module ) {
36
+ module . exports = DashJoin ;
37
+ }
You can’t perform that action at this time.
0 commit comments