PageSourceSearch

https://rekrutacja.pedagogium.pl/pdg-irk-app/content/script/angularjs/1.6/angular-utils.js

js pedagogium.pl collected 2026-10-04 13:33:23 UTC 2,486 bytes, 74 lines download raw bytes

vendor: 2,486 bytes, lines 1-74
1var isValidForStep; //global
2(function() {
3  /**
4   * @license AngularJS v1.6.10
5   * (c) 2010-2018 Google, Inc. http://angularjs.org
6   * License: MIT
7   */
8  function isNumberInteger(num) {
9    // See http://stackoverflow.com/questions/14636536/how-to-check-if-a-variable-is-an-integer-in-javascript#14794066
10    // (minus the assumption that `num` is a number)
11  
12    // eslint-disable-next-line no-bitwise
13    return (num | 0) === num;
14  }
15  /**
16   * @license AngularJS v1.6.10
17   * (c) 2010-2018 Google, Inc. http://angularjs.org
18   * License: MIT
19   */
20  function countDecimals(num) {
21    var numString = num.toString();
22    var decimalSymbolIndex = numString.indexOf('.');
23  
24    if (decimalSymbolIndex === -1) {
25      if (-1 < num && num < 1) {
26        // It may be in the exponential notation format (`1e-X`)
27        var match = /e-(\d+)$/.exec(numString);
28  
29        if (match) {
30          return Number(match[1]);
31        }
32      }
33  
34      return 0;
35    }
36  
37    return numString.length - decimalSymbolIndex - 1;
38  }
39  /**
40   * @license AngularJS v1.6.10
41   * (c) 2010-2018 Google, Inc. http://angularjs.org
42   * License: MIT
43   */
44  isValidForStep = function(viewValue, stepBase, step) {
45    // At this point `stepBase` and `step` are expected to be non-NaN values
46    // and `viewValue` is expected to be a valid stringified number.
47    var value = Number(viewValue);
48  
49    var isNonIntegerValue = !isNumberInteger(value);
50    var isNonIntegerStepBase = !isNumberInteger(stepBase);
51    var isNonIntegerStep = !isNumberInteger(step);
52  
53    // Due to limitations in Floating Point Arithmetic (e.g. `0.3 - 0.2 !== 0.1` or
54    // `0.5 % 0.1 !== 0`), we need to convert all numbers to integers.
55    if (isNonIntegerValue || isNonIntegerStepBase || isNonIntegerStep) {
56      var valueDecimals = isNonIntegerValue ? countDecimals(value) : 0;
57      var stepBaseDecimals = isNonIntegerStepBase ? countDecimals(stepBase) : 0;
58      var stepDecimals = isNonIntegerStep ? countDecimals(step) : 0;
59  
60      var decimalCount = Math.max(valueDecimals, stepBaseDecimals, stepDecimals);
61      var multiplier = Math.pow(10, decimalCount);
62  
63      value = value * multiplier;
64      stepBase = stepBase * multiplier;
65      step = step * multiplier;
66  
67      if (isNonIntegerValue) value = Math.round(value);
68      if (isNonIntegerStepBase) stepBase = Math.round(stepBase);
69      if (isNonIntegerStep) step = Math.round(step);
70    }
71  
72    return (value - stepBase) % step === 0;
73  }
74})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.