UNPKG

984 BSource Map (JSON)View Raw
1{"version":3,"sources":["../source/round.js"],"names":["getRoundFunction","round","Math","floor","getDiffRatioToNextRoundedNumber"],"mappings":"AAAA,OAAO,SAASA,gBAAT,CAA0BC,KAA1B,EAAiC;AACvC,UAAQA,KAAR;AACC,SAAK,OAAL;AACC,aAAOC,IAAI,CAACC,KAAZ;;AACD;AACC,aAAOD,IAAI,CAACD,KAAZ;AAJF;AAMA,C,CAED;;AACA,OAAO,SAASG,+BAAT,CAAyCH,KAAzC,EAAgD;AACtD,UAAQA,KAAR;AACC,SAAK,OAAL;AACC;AACA;AACA,aAAO,CAAP;;AACD;AACC;AACA;AACA,aAAO,GAAP;AARF;AAUA","sourcesContent":["export function getRoundFunction(round) {\r\n\tswitch (round) {\r\n\t\tcase 'floor':\r\n\t\t\treturn Math.floor\r\n\t\tdefault:\r\n\t\t\treturn Math.round\r\n\t}\r\n}\r\n\r\n// For non-negative numbers.\r\nexport function getDiffRatioToNextRoundedNumber(round) {\r\n\tswitch (round) {\r\n\t\tcase 'floor':\r\n\t\t\t// Math.floor(x) = x\r\n\t\t\t// Math.floor(x + 1) = x + 1\r\n\t\t\treturn 1\r\n\t\tdefault:\r\n\t\t\t// Math.round(x) = x\r\n\t\t\t// Math.round(x + 0.5) = x + 1\r\n\t\t\treturn 0.5\r\n\t}\r\n}"],"file":"round.js"}
\No newline at end of file