@os-design/input-number-utils
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -10,4 +10,2 @@ "use strict"; | ||
var _process = _interopRequireDefault(require("process")); | ||
var _escapeStringRegexp = _interopRequireDefault(require("@os-team/escape-string-regexp")); | ||
@@ -17,5 +15,3 @@ | ||
var DEV = _process["default"].env.NODE_ENV === 'development'; | ||
/* eslint-disable no-console */ | ||
var useValidate = function useValidate(_ref) { | ||
@@ -30,11 +26,11 @@ var min = _ref.min, | ||
if (min < Number.MIN_SAFE_INTEGER && DEV) { | ||
if (min < Number.MIN_SAFE_INTEGER) { | ||
console.error("The min value must be greater than or equal to ".concat(Number.MIN_SAFE_INTEGER, ".")); | ||
} | ||
if (max > Number.MAX_SAFE_INTEGER && DEV) { | ||
if (max > Number.MAX_SAFE_INTEGER) { | ||
console.error("The max value must be less than or equal to ".concat(Number.MAX_SAFE_INTEGER, ".")); | ||
} | ||
if (precision > 16 && DEV) { | ||
if (precision > 16) { | ||
console.error('The max precision must be less than or equal to 16.'); | ||
@@ -47,11 +43,11 @@ } | ||
if (!validPrefixSuffix.test(prefix) && DEV) { | ||
if (!validPrefixSuffix.test(prefix)) { | ||
console.error('The prefix must not contain digits, the minus sign, or the decimal separator.'); | ||
} | ||
if (!validPrefixSuffix.test(suffix) && DEV) { | ||
if (!validPrefixSuffix.test(suffix)) { | ||
console.error('The suffix must not contain digits, the minus sign, or the decimal separator.'); | ||
} | ||
if (decimalSeparator === thousandsSeparator && DEV) { | ||
if (decimalSeparator === thousandsSeparator) { | ||
console.error('The decimal separator must be different from the thousands separator.'); | ||
@@ -58,0 +54,0 @@ } |
import { useMemo } from 'react'; | ||
import process from 'process'; | ||
import escapeStringRegexp from '@os-team/escape-string-regexp'; | ||
const DEV = process.env.NODE_ENV === 'development'; | ||
/* eslint-disable no-console */ | ||
const useValidate = ({ | ||
@@ -16,11 +14,11 @@ min, | ||
}) => { | ||
if (min < Number.MIN_SAFE_INTEGER && DEV) { | ||
if (min < Number.MIN_SAFE_INTEGER) { | ||
console.error(`The min value must be greater than or equal to ${Number.MIN_SAFE_INTEGER}.`); | ||
} | ||
if (max > Number.MAX_SAFE_INTEGER && DEV) { | ||
if (max > Number.MAX_SAFE_INTEGER) { | ||
console.error(`The max value must be less than or equal to ${Number.MAX_SAFE_INTEGER}.`); | ||
} | ||
if (precision > 16 && DEV) { | ||
if (precision > 16) { | ||
console.error('The max precision must be less than or equal to 16.'); | ||
@@ -31,11 +29,11 @@ } | ||
if (!validPrefixSuffix.test(prefix) && DEV) { | ||
if (!validPrefixSuffix.test(prefix)) { | ||
console.error('The prefix must not contain digits, the minus sign, or the decimal separator.'); | ||
} | ||
if (!validPrefixSuffix.test(suffix) && DEV) { | ||
if (!validPrefixSuffix.test(suffix)) { | ||
console.error('The suffix must not contain digits, the minus sign, or the decimal separator.'); | ||
} | ||
if (decimalSeparator === thousandsSeparator && DEV) { | ||
if (decimalSeparator === thousandsSeparator) { | ||
console.error('The decimal separator must be different from the thousands separator.'); | ||
@@ -42,0 +40,0 @@ } |
{ | ||
"name": "@os-design/input-number-utils", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"license": "UNLICENSED", | ||
@@ -36,3 +36,3 @@ "repository": "git@gitlab.com:os-team/libs/os-design.git", | ||
}, | ||
"gitHead": "990fa0eb8e38bbb94ebea1ba0c825574ff11fe5e" | ||
"gitHead": "cac99126e9fef77b38f35021b01e0061b0dc41b6" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1
94865
827