unprint 0.11.12 → 0.11.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/app.js +14 -2
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -217,11 +217,23 @@ function extractNumber(rawNumberString, customOptions) {
|
|
|
217
217
|
: rawNumberString.replace(',', '');
|
|
218
218
|
|
|
219
219
|
if (numberString && options.match) {
|
|
220
|
-
|
|
220
|
+
const number = Number(numberString.match(options.match)?.[options.matchIndex]);
|
|
221
|
+
|
|
222
|
+
if (Number.isNaN(number)) {
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return number;
|
|
221
227
|
}
|
|
222
228
|
|
|
223
229
|
if (numberString) {
|
|
224
|
-
|
|
230
|
+
const number = Number(numberString);
|
|
231
|
+
|
|
232
|
+
if (Number.isNaN(number)) {
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return number;
|
|
225
237
|
}
|
|
226
238
|
|
|
227
239
|
return null;
|