b07117eeb65900d29711dad335facb03.json 2.71 KB
{"ast":null,"code":"var toNumber = require('./toNumber');\n/** Used as references for various `Number` constants. */\n\n\nvar INFINITY = 1 / 0,\n    MAX_INTEGER = 1.7976931348623157e+308;\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n\nfunction toFinite(value) {\n  if (!value) {\n    return value === 0 ? value : 0;\n  }\n\n  value = toNumber(value);\n\n  if (value === INFINITY || value === -INFINITY) {\n    var sign = value < 0 ? -1 : 1;\n    return sign * MAX_INTEGER;\n  }\n\n  return value === value ? value : 0;\n}\n\nmodule.exports = toFinite;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/lodash/toFinite.js"],"names":["toNumber","require","INFINITY","MAX_INTEGER","toFinite","value","sign","module","exports"],"mappings":"AAAA,IAAIA,QAAQ,GAAGC,OAAO,CAAC,YAAD,CAAtB;AAEA;;;AACA,IAAIC,QAAQ,GAAG,IAAI,CAAnB;AAAA,IACIC,WAAW,GAAG,uBADlB;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,QAAT,CAAkBC,KAAlB,EAAyB;AACvB,MAAI,CAACA,KAAL,EAAY;AACV,WAAOA,KAAK,KAAK,CAAV,GAAcA,KAAd,GAAsB,CAA7B;AACD;;AACDA,EAAAA,KAAK,GAAGL,QAAQ,CAACK,KAAD,CAAhB;;AACA,MAAIA,KAAK,KAAKH,QAAV,IAAsBG,KAAK,KAAK,CAACH,QAArC,EAA+C;AAC7C,QAAII,IAAI,GAAID,KAAK,GAAG,CAAR,GAAY,CAAC,CAAb,GAAiB,CAA7B;AACA,WAAOC,IAAI,GAAGH,WAAd;AACD;;AACD,SAAOE,KAAK,KAAKA,KAAV,GAAkBA,KAAlB,GAA0B,CAAjC;AACD;;AAEDE,MAAM,CAACC,OAAP,GAAiBJ,QAAjB","sourcesContent":["var toNumber = require('./toNumber');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n    MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n  if (!value) {\n    return value === 0 ? value : 0;\n  }\n  value = toNumber(value);\n  if (value === INFINITY || value === -INFINITY) {\n    var sign = (value < 0 ? -1 : 1);\n    return sign * MAX_INTEGER;\n  }\n  return value === value ? value : 0;\n}\n\nmodule.exports = toFinite;\n"]},"metadata":{},"sourceType":"script"}