Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

number-parse-float.js 977B

1234567891011121314151617181920212223
  1. 'use strict';
  2. var globalThis = require('../internals/global-this');
  3. var fails = require('../internals/fails');
  4. var uncurryThis = require('../internals/function-uncurry-this');
  5. var toString = require('../internals/to-string');
  6. var trim = require('../internals/string-trim').trim;
  7. var whitespaces = require('../internals/whitespaces');
  8. var charAt = uncurryThis(''.charAt);
  9. var $parseFloat = globalThis.parseFloat;
  10. var Symbol = globalThis.Symbol;
  11. var ITERATOR = Symbol && Symbol.iterator;
  12. var FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity
  13. // MS Edge 18- broken with boxed symbols
  14. || (ITERATOR && !fails(function () { $parseFloat(Object(ITERATOR)); }));
  15. // `parseFloat` method
  16. // https://tc39.es/ecma262/#sec-parsefloat-string
  17. module.exports = FORCED ? function parseFloat(string) {
  18. var trimmedString = trim(toString(string));
  19. var result = $parseFloat(trimmedString);
  20. return result === 0 && charAt(trimmedString, 0) === '-' ? -0 : result;
  21. } : $parseFloat;