Comparing version
@@ -5,2 +5,4 @@ # Changelog | ||
### [1.0.3](https://github.com/wind2sing/cparse/compare/v1.0.0...v1.0.3) (2020-08-06) | ||
## 1.0.0 (2020-08-06) | ||
@@ -7,0 +9,0 @@ |
{ | ||
"name": "cparse", | ||
"version": "1.0.1", | ||
"version": "1.0.3", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"scripts": { | ||
"test": "jest" | ||
}, | ||
"dependencies": { | ||
"cheerio": "^1.0.0-rc.3", | ||
"debug": "^4.1.1" | ||
"cheerio": "^1.0.0-rc.3" | ||
}, | ||
"homepage": "https://github.com/wind2sing/cparse" | ||
"keywords": [ | ||
"parse", | ||
"cheerio" | ||
], | ||
"homepage": "https://github.com/wind2sing/cparse#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/wind2sing/cparse.git" | ||
}, | ||
"devDependencies": { | ||
"jest": "^26.2.2" | ||
} | ||
} |
@@ -1,2 +0,4 @@ | ||
const log = require("debug")("crawlx-filters"); | ||
const debug = function () { | ||
console.error(...arguments); | ||
}; | ||
@@ -12,14 +14,9 @@ module.exports = { | ||
}, | ||
bool: v => Boolean(v), | ||
trim: value => (typeof value === "string" ? value.trim() : value), | ||
bool: (v) => Boolean(v), | ||
trim: (value) => (typeof value === "string" ? value.trim() : value), | ||
slice: (value, start, end) => value.slice(start, end), | ||
reverse: value => | ||
value | ||
.split("") | ||
.reverse() | ||
.join(""), | ||
reverse: (value) => value.split("").reverse().join(""), | ||
date: (v, append) => { | ||
if (append && typeof v === "string") v += append; | ||
let r = new Date(v); | ||
if (isNaN(r)) { | ||
@@ -34,6 +31,5 @@ let m = /(\d{4})\D*(\d{2})\D*(\d{2})\D*(\d{2}:\d{2}(:\d{2})?)?/.exec(v); | ||
size: (() => { | ||
let debug = log.extend("parseSize"); | ||
let validAmount = n => !isNaN(parseFloat(n)) && isFinite(n); | ||
let parsableUnit = u => u.match(/\D*/).pop() === u; | ||
return function(input) { | ||
let validAmount = (n) => !isNaN(parseFloat(n)) && isFinite(n); | ||
let parsableUnit = (u) => u.match(/\D*/).pop() === u; | ||
return function (input) { | ||
let parsed = input.toString().match(/.*?([0-9\.,]+)(?:\s*)?(\w*).*/); | ||
@@ -46,3 +42,3 @@ if (!parsed) { | ||
let unit = parsed[2]; | ||
let validUnit = function(sourceUnit) { | ||
let validUnit = function (sourceUnit) { | ||
return sourceUnit === unit; | ||
@@ -70,3 +66,3 @@ }; | ||
[["Eb"], 1.441e17], | ||
[["e", "E", "eb", "EB", "EiB", "Ei", "ei"], Math.pow(1024, 6)] | ||
[["e", "E", "eb", "EB", "EiB", "Ei", "ei"], Math.pow(1024, 6)], | ||
]; | ||
@@ -84,3 +80,3 @@ for (let i = 0; i < increments.length; i++) { | ||
}; | ||
})() | ||
})(), | ||
}; |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
11255
11.86%1
-50%12
9.09%365
5.8%1
Infinity%- Removed
- Removed
- Removed