@texting/charset-halfwidth
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -59,3 +59,23 @@ 'use strict'; | ||
const COMMA = /,/g; | ||
const isNumeric = x => { | ||
var _x; | ||
x = (_x = x) === null || _x === void 0 ? void 0 : _x.replace(COMMA, ''); | ||
return !isNaN(x - parseFloat(x)); | ||
}; | ||
const validate = (x, y) => isNaN(x - y) ? NaN : y; | ||
const parseNum = x => { | ||
var _x; | ||
x = (_x = x) === null || _x === void 0 ? void 0 : _x.replace(COMMA, ''); | ||
return validate(x, parseFloat(x)); | ||
}; | ||
exports.HalfToFull = HalfToFull; | ||
exports.halfToFull = halfToFull; | ||
exports.isNumeric = isNumeric; | ||
exports.parseNum = parseNum; |
@@ -55,2 +55,20 @@ import { hasAnsi, clearAnsi } from '@texting/charset-ansi'; | ||
export { HalfToFull, halfToFull }; | ||
const COMMA = /,/g; | ||
const isNumeric = x => { | ||
var _x; | ||
x = (_x = x) === null || _x === void 0 ? void 0 : _x.replace(COMMA, ''); | ||
return !isNaN(x - parseFloat(x)); | ||
}; | ||
const validate = (x, y) => isNaN(x - y) ? NaN : y; | ||
const parseNum = x => { | ||
var _x; | ||
x = (_x = x) === null || _x === void 0 ? void 0 : _x.replace(COMMA, ''); | ||
return validate(x, parseFloat(x)); | ||
}; | ||
export { HalfToFull, halfToFull, isNumeric, parseNum }; |
{ | ||
"name": "@texting/charset-halfwidth", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Regex sets", | ||
@@ -18,5 +18,5 @@ "main": "dist/index.cjs.js", | ||
"dependencies": { | ||
"@texting/charset-ansi": "^0.0.4", | ||
"@texting/enum-chars-fullwidth": "^0.0.4", | ||
"@texting/regex-charset": "^0.0.4" | ||
"@texting/charset-ansi": "^0.0.5", | ||
"@texting/enum-chars-fullwidth": "^0.0.5", | ||
"@texting/regex-charset": "^0.0.5" | ||
}, | ||
@@ -39,3 +39,3 @@ "repository": { | ||
"homepage": "https://github.com/gadge/spare#readme", | ||
"gitHead": "72794cf10726d765b4dbc0326fbfd9ae50ec57df" | ||
"gitHead": "36e60cc8aa555024c380dfabe7e9ee3b475a2d46" | ||
} |
7514
127
+ Added@texting/charset-ansi@0.0.5(transitive)
+ Added@texting/enum-chars-fullwidth@0.0.5(transitive)
+ Added@texting/regex-charset@0.0.5(transitive)
- Removed@texting/charset-ansi@0.0.4(transitive)
- Removed@texting/enum-chars-fullwidth@0.0.4(transitive)
- Removed@texting/regex-charset@0.0.4(transitive)
Updated@texting/charset-ansi@^0.0.5