unprint 0.11.6 → 0.11.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/app.js +4 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unprint",
3
- "version": "0.11.6",
3
+ "version": "0.11.7",
4
4
  "description": "Simplify common web scraping tasks while staying in control of the data.",
5
5
  "main": "src/app.js",
6
6
  "scripts": {
package/src/app.js CHANGED
@@ -200,7 +200,7 @@ function queryDatasets(context, selector, dataAttribute, customOptions) {
200
200
 
201
201
  const defaultNumberRegexp = /\d+([.,]\d+)?/;
202
202
 
203
- function matchNumberString(rawNumberString, options) {
203
+ function extractNumber(rawNumberString, options) {
204
204
  if (!rawNumberString) {
205
205
  return null;
206
206
  }
@@ -230,7 +230,7 @@ function queryNumber(context, selector, customOptions) {
230
230
  ...customOptions,
231
231
  };
232
232
 
233
- return matchNumberString(numberString, options);
233
+ return extractNumber(numberString, options);
234
234
  }
235
235
 
236
236
  function queryNumbers(context, selector, customOptions) {
@@ -248,7 +248,7 @@ function queryNumbers(context, selector, customOptions) {
248
248
  }
249
249
 
250
250
  return numberStrings
251
- .map((numberString) => matchNumberString(numberString, options))
251
+ .map((numberString) => extractNumber(numberString, options))
252
252
  .filter(Boolean);
253
253
  }
254
254
 
@@ -928,6 +928,7 @@ module.exports = {
928
928
  initAll,
929
929
  extractDate,
930
930
  extractDuration,
931
+ extractNumber,
931
932
  extractTimestamp,
932
933
  formatDate,
933
934
  dateConstants: {