@crawlee/utils
Advanced tools
Comparing version 3.11.2-beta.37 to 3.11.2-beta.38
@@ -24,3 +24,3 @@ import type { load, CheerioAPI } from 'cheerio'; | ||
* ```javascript | ||
* import cheerio from 'cheerio'; | ||
* import * as cheerio from 'cheerio'; | ||
* const html = '<html><body>Some text</body></html>'; | ||
@@ -27,0 +27,0 @@ * const text = htmlToText(cheerio.load(html, { decodeEntities: true })); |
@@ -6,3 +6,3 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const cheerio_1 = tslib_1.__importDefault(require("cheerio")); | ||
const cheerio = tslib_1.__importStar(require("cheerio")); | ||
const extract_urls_1 = require("./extract-urls"); | ||
@@ -33,3 +33,3 @@ // NOTE: We are skipping 'noscript' since it's content is evaluated as text, instead of HTML elements. That damages the results. | ||
* ```javascript | ||
* import cheerio from 'cheerio'; | ||
* import * as cheerio from 'cheerio'; | ||
* const html = '<html><body>Some text</body></html>'; | ||
@@ -46,3 +46,3 @@ * const text = htmlToText(cheerio.load(html, { decodeEntities: true })); | ||
? htmlOrCheerioElement | ||
: cheerio_1.default.load(htmlOrCheerioElement, { decodeEntities: true }); | ||
: cheerio.load(htmlOrCheerioElement, { decodeEntities: true }); | ||
let text = ''; | ||
@@ -49,0 +49,0 @@ const process = (elems) => { |
@@ -10,4 +10,4 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const cheerio_1 = tslib_1.__importDefault(require("cheerio")); | ||
const cheerio_2 = require("./cheerio"); | ||
const cheerio = tslib_1.__importStar(require("cheerio")); | ||
const cheerio_1 = require("./cheerio"); | ||
// Regex inspired by https://zapier.com/blog/extract-links-email-phone-regex/ | ||
@@ -215,6 +215,6 @@ const EMAIL_REGEX_STRING = '(?:[a-z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\\])'; | ||
return result; | ||
const $ = cheerio_1.default.load(html, { decodeEntities: true }); | ||
const $ = cheerio.load(html, { decodeEntities: true }); | ||
if (data) | ||
data.$ = $; | ||
const text = (0, cheerio_2.htmlToText)($); | ||
const text = (0, cheerio_1.htmlToText)($); | ||
if (data) | ||
@@ -221,0 +221,0 @@ data.text = text; |
{ | ||
"name": "@crawlee/utils", | ||
"version": "3.11.2-beta.37", | ||
"version": "3.11.2-beta.38", | ||
"description": "A set of shared utilities that can be used by crawlers", | ||
@@ -52,3 +52,3 @@ "engines": { | ||
"@apify/ps-tree": "^1.2.0", | ||
"@crawlee/types": "3.11.2-beta.37", | ||
"@crawlee/types": "3.11.2-beta.38", | ||
"@types/sax": "^1.2.7", | ||
@@ -74,3 +74,3 @@ "cheerio": "1.0.0-rc.12", | ||
}, | ||
"gitHead": "411e66194c7df571aef86aa9ccc09700961cd419" | ||
"gitHead": "d90e76fcd8a8ef831db53ca14d1a8e38062ae5f1" | ||
} |
Sorry, the diff of this file is not supported yet
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
322273
+ Added@crawlee/types@3.11.2-beta.38(transitive)
- Removed@crawlee/types@3.11.2-beta.37(transitive)