1 line
967 B
Plaintext
1 line
967 B
Plaintext
{"version":3,"file":"progress.mjs","sources":["../../src/progress.ts"],"sourcesContent":["/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n\n @param [number]: Lower limit\n @param [number]: Upper limit\n @param [number]: Value to find progress within given range\n @return [number]: Progress of value within range as expressed 0-1\n*/\n/*#__NO_SIDE_EFFECTS__*/\nexport const progress = (from: number, to: number, value: number) => {\n const toFromDifference = to - from\n\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;AAWE;AACF;AACa,MAAA,QAAQ,GAAG,CAAC,IAAY,EAAE,EAAU,EAAE,KAAa,KAAI;AAChE,IAAA,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,CAAA;AAElC,IAAA,OAAO,gBAAgB,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,IAAI,gBAAgB,CAAA;AACzE;;;;"} |