Blame view

天文台pc/tianwentai-ui/node_modules/motion-utils/dist/es/progress.mjs 640 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  /*
    Progress within given range
  
    Given a lower limit and an upper limit, we return the progress
    (expressed as a number 0-1) represented by the given value, and
    limit that progress to within 0-1.
  
    @param [number]: Lower limit
    @param [number]: Upper limit
    @param [number]: Value to find progress within given range
    @return [number]: Progress of value within range as expressed 0-1
  */
  /*#__NO_SIDE_EFFECTS__*/
  const progress = (from, to, value) => {
      const toFromDifference = to - from;
      return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
  };
  
  export { progress };
  //# sourceMappingURL=progress.mjs.map