Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@os-design/input-number-utils

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@os-design/input-number-utils - npm Package Compare versions

Comparing version 1.0.11 to 1.0.12

16

dist/cjs/utils/useValidate.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc