@operato/utils
Advanced tools
Comparing version 1.11.13 to 1.12.7
@@ -6,2 +6,11 @@ # Change Log | ||
### [1.12.7](https://github.com/hatiolab/operato/compare/v1.12.6...v1.12.7) (2024-01-03) | ||
### :bug: Bug Fix | ||
* 그리드 숫자 판단 수정 ([f15fdbe](https://github.com/hatiolab/operato/commit/f15fdbe5d4331050d8250cf7611a0dca4b79b239)) | ||
### [1.11.13](https://github.com/hatiolab/operato/compare/v1.11.12...v1.11.13) (2023-12-20) | ||
@@ -8,0 +17,0 @@ |
@@ -1,1 +0,1 @@ | ||
export declare function checkStrictNumber(value: any): boolean; | ||
export declare function parseToNumberOrNull(value: any): number | null; |
@@ -1,2 +0,4 @@ | ||
// 공백, 널, 불린 값을 제외하고 숫자인지 판단 | ||
// 숫자라면 숫자값을, 아니면 null을 반환 | ||
// 0 = true | ||
// '0' = true | ||
// 123 = true | ||
@@ -13,9 +15,10 @@ // "123" = true | ||
// [] = false | ||
export function checkStrictNumber(value) { | ||
const type = typeof value; | ||
if (value === null || value === undefined || value === '' || type === 'boolean' || type === 'object') { | ||
return false; | ||
export function parseToNumberOrNull(value) { | ||
let result = null; | ||
// 숫자나 스트링이면서 NaN이 아니면 숫자로 변환 | ||
if ((typeof value === 'string' || typeof value === 'number') && value !== '' && !isNaN(value)) { | ||
result = Number(value); | ||
} | ||
return !isNaN(Number(value)); | ||
return result; | ||
} | ||
//# sourceMappingURL=checker.js.map |
@@ -5,3 +5,3 @@ { | ||
"author": "heartyoh", | ||
"version": "1.11.13", | ||
"version": "1.12.7", | ||
"main": "dist/src/index.js", | ||
@@ -121,3 +121,3 @@ "module": "dist/src/index.js", | ||
}, | ||
"gitHead": "0af53828fbce09a9156cfa0728c934f34dfe527f" | ||
"gitHead": "6c27ff0f4f70f5afd872d2ee6a5f05cdd974aa67" | ||
} |
@@ -1,2 +0,4 @@ | ||
// 공백, 널, 불린 값을 제외하고 숫자인지 판단 | ||
// 숫자라면 숫자값을, 아니면 null을 반환 | ||
// 0 = true | ||
// '0' = true | ||
// 123 = true | ||
@@ -13,9 +15,11 @@ // "123" = true | ||
// [] = false | ||
export function checkStrictNumber(value: any): boolean { | ||
const type = typeof value | ||
if (value === null || value === undefined || value === '' || type === 'boolean' || type === 'object') { | ||
return false | ||
export function parseToNumberOrNull(value: any): number | null { | ||
let result: number | null = null | ||
// 숫자나 스트링이면서 NaN이 아니면 숫자로 변환 | ||
if ((typeof value === 'string' || typeof value === 'number') && value !== '' && !isNaN(value as number)) { | ||
result = Number(value) | ||
} | ||
return !isNaN(Number(value)) | ||
return result | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
221498
2259
0