cheerio-select
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -5,3 +5,3 @@ import { Options as CSSSelectOptions } from "css-select"; | ||
export declare function filter(selector: string, elements: Element[], options?: Options): Element[]; | ||
export declare function select(selector: string, root: Element | Element[], options?: Options): Element[]; | ||
export declare function select(selector: string | ((el: Element) => boolean), root: Element | Element[], options?: Options): Element[]; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -128,2 +128,5 @@ "use strict"; | ||
if (options === void 0) { options = {}; } | ||
if (typeof selector === "function") { | ||
return find(root, selector); | ||
} | ||
var _a = helpers_1.groupSelectors(css_what_1.parse(selector, options)), plain = _a[0], filtered = _a[1]; | ||
@@ -234,4 +237,9 @@ var results = filtered.map(function (sel) { | ||
return []; | ||
var query = css_select_1._compileToken(sel, | ||
// @ts-expect-error TS seems to mess up the type here ¯\_(ツ)_/¯ | ||
var query = css_select_1._compileToken(sel, options, root); | ||
options, root); | ||
return find(root, query, limit); | ||
} | ||
function find(root, query, limit) { | ||
if (limit === void 0) { limit = Infinity; } | ||
var elems = css_select_1.prepareContext(root, DomUtils, query.shouldTestNextSiblings); | ||
@@ -238,0 +246,0 @@ return DomUtils.find(function (node) { return DomUtils.isTag(node) && query(node); }, elems, true, limit); |
{ | ||
"name": "cheerio-select", | ||
"description": "CSS selector engine supporting jQuery selectors", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"author": "Felix Boehm <me@feedic.com>", | ||
@@ -6,0 +6,0 @@ "funding": "https://github.com/sponsors/fb55", |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
19434
335
0