@depup/cheerio 1.2.0-depup.2
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/LICENSE +21 -0
- package/README.md +36 -0
- package/Readme.md +229 -0
- package/changes.json +30 -0
- package/dist/browser/api/attributes.d.ts +385 -0
- package/dist/browser/api/attributes.d.ts.map +1 -0
- package/dist/browser/api/attributes.js +636 -0
- package/dist/browser/api/attributes.js.map +1 -0
- package/dist/browser/api/css.d.ts +42 -0
- package/dist/browser/api/css.d.ts.map +1 -0
- package/dist/browser/api/css.js +116 -0
- package/dist/browser/api/css.js.map +1 -0
- package/dist/browser/api/extract.d.ts +27 -0
- package/dist/browser/api/extract.d.ts.map +1 -0
- package/dist/browser/api/extract.js +42 -0
- package/dist/browser/api/extract.js.map +1 -0
- package/dist/browser/api/forms.d.ts +36 -0
- package/dist/browser/api/forms.d.ts.map +1 -0
- package/dist/browser/api/forms.js +81 -0
- package/dist/browser/api/forms.js.map +1 -0
- package/dist/browser/api/manipulation.d.ts +528 -0
- package/dist/browser/api/manipulation.d.ts.map +1 -0
- package/dist/browser/api/manipulation.js +831 -0
- package/dist/browser/api/manipulation.js.map +1 -0
- package/dist/browser/api/traversing.d.ts +657 -0
- package/dist/browser/api/traversing.d.ts.map +1 -0
- package/dist/browser/api/traversing.js +857 -0
- package/dist/browser/api/traversing.js.map +1 -0
- package/dist/browser/cheerio.d.ts +85 -0
- package/dist/browser/cheerio.d.ts.map +1 -0
- package/dist/browser/cheerio.js +58 -0
- package/dist/browser/cheerio.js.map +1 -0
- package/dist/browser/index-browser.d.mts.map +1 -0
- package/dist/browser/index-browser.mjs.map +1 -0
- package/dist/browser/index.d.ts +5 -0
- package/dist/browser/index.js +3 -0
- package/dist/browser/load-parse.d.ts +20 -0
- package/dist/browser/load-parse.d.ts.map +1 -0
- package/dist/browser/load-parse.js +28 -0
- package/dist/browser/load-parse.js.map +1 -0
- package/dist/browser/load.d.ts +91 -0
- package/dist/browser/load.d.ts.map +1 -0
- package/dist/browser/load.js +129 -0
- package/dist/browser/load.js.map +1 -0
- package/dist/browser/options.d.ts +98 -0
- package/dist/browser/options.d.ts.map +1 -0
- package/dist/browser/options.js +34 -0
- package/dist/browser/options.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/browser/parse.d.ts +18 -0
- package/dist/browser/parse.d.ts.map +1 -0
- package/dist/browser/parse.js +73 -0
- package/dist/browser/parse.js.map +1 -0
- package/dist/browser/parsers/parse5-adapter.d.ts +20 -0
- package/dist/browser/parsers/parse5-adapter.d.ts.map +1 -0
- package/dist/browser/parsers/parse5-adapter.js +50 -0
- package/dist/browser/parsers/parse5-adapter.js.map +1 -0
- package/dist/browser/slim.d.ts +25 -0
- package/dist/browser/slim.d.ts.map +1 -0
- package/dist/browser/slim.js +22 -0
- package/dist/browser/slim.js.map +1 -0
- package/dist/browser/static.d.ts +112 -0
- package/dist/browser/static.d.ts.map +1 -0
- package/dist/browser/static.js +204 -0
- package/dist/browser/static.js.map +1 -0
- package/dist/browser/types.d.ts +21 -0
- package/dist/browser/types.d.ts.map +1 -0
- package/dist/browser/types.js +3 -0
- package/dist/browser/types.js.map +1 -0
- package/dist/browser/utils.d.ts +55 -0
- package/dist/browser/utils.d.ts.map +1 -0
- package/dist/browser/utils.js +84 -0
- package/dist/browser/utils.js.map +1 -0
- package/dist/commonjs/api/attributes.d.ts +385 -0
- package/dist/commonjs/api/attributes.d.ts.map +1 -0
- package/dist/commonjs/api/attributes.js +647 -0
- package/dist/commonjs/api/attributes.js.map +1 -0
- package/dist/commonjs/api/css.d.ts +42 -0
- package/dist/commonjs/api/css.d.ts.map +1 -0
- package/dist/commonjs/api/css.js +119 -0
- package/dist/commonjs/api/css.js.map +1 -0
- package/dist/commonjs/api/extract.d.ts +27 -0
- package/dist/commonjs/api/extract.d.ts.map +1 -0
- package/dist/commonjs/api/extract.js +45 -0
- package/dist/commonjs/api/extract.js.map +1 -0
- package/dist/commonjs/api/forms.d.ts +36 -0
- package/dist/commonjs/api/forms.d.ts.map +1 -0
- package/dist/commonjs/api/forms.js +85 -0
- package/dist/commonjs/api/forms.js.map +1 -0
- package/dist/commonjs/api/manipulation.d.ts +528 -0
- package/dist/commonjs/api/manipulation.d.ts.map +1 -0
- package/dist/commonjs/api/manipulation.js +850 -0
- package/dist/commonjs/api/manipulation.js.map +1 -0
- package/dist/commonjs/api/traversing.d.ts +657 -0
- package/dist/commonjs/api/traversing.d.ts.map +1 -0
- package/dist/commonjs/api/traversing.js +914 -0
- package/dist/commonjs/api/traversing.js.map +1 -0
- package/dist/commonjs/cheerio.d.ts +85 -0
- package/dist/commonjs/cheerio.d.ts.map +1 -0
- package/dist/commonjs/cheerio.js +95 -0
- package/dist/commonjs/cheerio.js.map +1 -0
- package/dist/commonjs/index.d.ts +104 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +250 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/load-parse.d.ts +20 -0
- package/dist/commonjs/load-parse.d.ts.map +1 -0
- package/dist/commonjs/load-parse.js +34 -0
- package/dist/commonjs/load-parse.js.map +1 -0
- package/dist/commonjs/load.d.ts +91 -0
- package/dist/commonjs/load.d.ts.map +1 -0
- package/dist/commonjs/load.js +165 -0
- package/dist/commonjs/load.js.map +1 -0
- package/dist/commonjs/options.d.ts +98 -0
- package/dist/commonjs/options.d.ts.map +1 -0
- package/dist/commonjs/options.js +37 -0
- package/dist/commonjs/options.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/parse.d.ts +18 -0
- package/dist/commonjs/parse.d.ts.map +1 -0
- package/dist/commonjs/parse.js +77 -0
- package/dist/commonjs/parse.js.map +1 -0
- package/dist/commonjs/parsers/parse5-adapter.d.ts +20 -0
- package/dist/commonjs/parsers/parse5-adapter.d.ts.map +1 -0
- package/dist/commonjs/parsers/parse5-adapter.js +54 -0
- package/dist/commonjs/parsers/parse5-adapter.js.map +1 -0
- package/dist/commonjs/slim.d.ts +25 -0
- package/dist/commonjs/slim.d.ts.map +1 -0
- package/dist/commonjs/slim.js +30 -0
- package/dist/commonjs/slim.js.map +1 -0
- package/dist/commonjs/static.d.ts +112 -0
- package/dist/commonjs/static.d.ts.map +1 -0
- package/dist/commonjs/static.js +214 -0
- package/dist/commonjs/static.js.map +1 -0
- package/dist/commonjs/types.d.ts +21 -0
- package/dist/commonjs/types.d.ts.map +1 -0
- package/dist/commonjs/types.js +4 -0
- package/dist/commonjs/types.js.map +1 -0
- package/dist/commonjs/utils.d.ts +55 -0
- package/dist/commonjs/utils.d.ts.map +1 -0
- package/dist/commonjs/utils.js +91 -0
- package/dist/commonjs/utils.js.map +1 -0
- package/dist/esm/api/attributes.d.ts +385 -0
- package/dist/esm/api/attributes.d.ts.map +1 -0
- package/dist/esm/api/attributes.js +636 -0
- package/dist/esm/api/attributes.js.map +1 -0
- package/dist/esm/api/css.d.ts +42 -0
- package/dist/esm/api/css.d.ts.map +1 -0
- package/dist/esm/api/css.js +116 -0
- package/dist/esm/api/css.js.map +1 -0
- package/dist/esm/api/extract.d.ts +27 -0
- package/dist/esm/api/extract.d.ts.map +1 -0
- package/dist/esm/api/extract.js +42 -0
- package/dist/esm/api/extract.js.map +1 -0
- package/dist/esm/api/forms.d.ts +36 -0
- package/dist/esm/api/forms.d.ts.map +1 -0
- package/dist/esm/api/forms.js +81 -0
- package/dist/esm/api/forms.js.map +1 -0
- package/dist/esm/api/manipulation.d.ts +528 -0
- package/dist/esm/api/manipulation.d.ts.map +1 -0
- package/dist/esm/api/manipulation.js +831 -0
- package/dist/esm/api/manipulation.js.map +1 -0
- package/dist/esm/api/traversing.d.ts +657 -0
- package/dist/esm/api/traversing.d.ts.map +1 -0
- package/dist/esm/api/traversing.js +857 -0
- package/dist/esm/api/traversing.js.map +1 -0
- package/dist/esm/cheerio.d.ts +85 -0
- package/dist/esm/cheerio.d.ts.map +1 -0
- package/dist/esm/cheerio.js +58 -0
- package/dist/esm/cheerio.js.map +1 -0
- package/dist/esm/index.d.ts +104 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +202 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/load-parse.d.ts +20 -0
- package/dist/esm/load-parse.d.ts.map +1 -0
- package/dist/esm/load-parse.js +28 -0
- package/dist/esm/load-parse.js.map +1 -0
- package/dist/esm/load.d.ts +91 -0
- package/dist/esm/load.d.ts.map +1 -0
- package/dist/esm/load.js +129 -0
- package/dist/esm/load.js.map +1 -0
- package/dist/esm/options.d.ts +98 -0
- package/dist/esm/options.d.ts.map +1 -0
- package/dist/esm/options.js +34 -0
- package/dist/esm/options.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/parse.d.ts +18 -0
- package/dist/esm/parse.d.ts.map +1 -0
- package/dist/esm/parse.js +73 -0
- package/dist/esm/parse.js.map +1 -0
- package/dist/esm/parsers/parse5-adapter.d.ts +20 -0
- package/dist/esm/parsers/parse5-adapter.d.ts.map +1 -0
- package/dist/esm/parsers/parse5-adapter.js +50 -0
- package/dist/esm/parsers/parse5-adapter.js.map +1 -0
- package/dist/esm/slim.d.ts +25 -0
- package/dist/esm/slim.d.ts.map +1 -0
- package/dist/esm/slim.js +22 -0
- package/dist/esm/slim.js.map +1 -0
- package/dist/esm/static.d.ts +112 -0
- package/dist/esm/static.d.ts.map +1 -0
- package/dist/esm/static.js +204 -0
- package/dist/esm/static.js.map +1 -0
- package/dist/esm/types.d.ts +21 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +3 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils.d.ts +55 -0
- package/dist/esm/utils.d.ts.map +1 -0
- package/dist/esm/utils.js +84 -0
- package/dist/esm/utils.js.map +1 -0
- package/package.json +219 -0
- package/src/api/attributes.ts +1145 -0
- package/src/api/css.ts +224 -0
- package/src/api/extract.ts +92 -0
- package/src/api/forms.ts +103 -0
- package/src/api/manipulation.ts +1115 -0
- package/src/api/traversing.ts +1175 -0
- package/src/cheerio.ts +143 -0
- package/src/index-browser.mts +10 -0
- package/src/index.ts +294 -0
- package/src/load-parse.ts +39 -0
- package/src/load.ts +282 -0
- package/src/options.ts +136 -0
- package/src/parse.ts +105 -0
- package/src/parsers/parse5-adapter.ts +66 -0
- package/src/slim.ts +33 -0
- package/src/static.ts +312 -0
- package/src/types.ts +58 -0
- package/src/utils.ts +99 -0
package/dist/esm/load.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { flattenOptions, } from './options.js';
|
|
2
|
+
import * as staticMethods from './static.js';
|
|
3
|
+
import { Cheerio } from './cheerio.js';
|
|
4
|
+
import { isHtml, isCheerio } from './utils.js';
|
|
5
|
+
import { ElementType } from 'htmlparser2';
|
|
6
|
+
export function getLoad(parse, render) {
|
|
7
|
+
/**
|
|
8
|
+
* Create a querying function, bound to a document created from the provided
|
|
9
|
+
* markup.
|
|
10
|
+
*
|
|
11
|
+
* Note that similar to web browser contexts, this operation may introduce
|
|
12
|
+
* `<html>`, `<head>`, and `<body>` elements; set `isDocument` to `false` to
|
|
13
|
+
* switch to fragment mode and disable this.
|
|
14
|
+
*
|
|
15
|
+
* @param content - Markup to be loaded.
|
|
16
|
+
* @param options - Options for the created instance.
|
|
17
|
+
* @param isDocument - Allows parser to be switched to fragment mode.
|
|
18
|
+
* @returns The loaded document.
|
|
19
|
+
* @see {@link https://cheerio.js.org/docs/basics/loading#load} for additional usage information.
|
|
20
|
+
*/
|
|
21
|
+
return function load(content, options, isDocument = true) {
|
|
22
|
+
if (content == null) {
|
|
23
|
+
throw new Error('cheerio.load() expects a string');
|
|
24
|
+
}
|
|
25
|
+
const internalOpts = flattenOptions(options);
|
|
26
|
+
const initialRoot = parse(content, internalOpts, isDocument, null);
|
|
27
|
+
/**
|
|
28
|
+
* Create an extended class here, so that extensions only live on one
|
|
29
|
+
* instance.
|
|
30
|
+
*/
|
|
31
|
+
class LoadedCheerio extends Cheerio {
|
|
32
|
+
_make(selector, context) {
|
|
33
|
+
const cheerio = initialize(selector, context);
|
|
34
|
+
cheerio.prevObject = this;
|
|
35
|
+
return cheerio;
|
|
36
|
+
}
|
|
37
|
+
_parse(content, options, isDocument, context) {
|
|
38
|
+
return parse(content, options, isDocument, context);
|
|
39
|
+
}
|
|
40
|
+
_render(dom) {
|
|
41
|
+
return render(dom, this.options);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function initialize(selector, context, root = initialRoot, opts) {
|
|
45
|
+
// $($)
|
|
46
|
+
if (selector && isCheerio(selector))
|
|
47
|
+
return selector;
|
|
48
|
+
const options = flattenOptions(opts, internalOpts);
|
|
49
|
+
const r = typeof root === 'string'
|
|
50
|
+
? [parse(root, options, false, null)]
|
|
51
|
+
: 'length' in root
|
|
52
|
+
? root
|
|
53
|
+
: [root];
|
|
54
|
+
const rootInstance = isCheerio(r)
|
|
55
|
+
? r
|
|
56
|
+
: new LoadedCheerio(r, null, options);
|
|
57
|
+
// Add a cyclic reference, so that calling methods on `_root` never fails.
|
|
58
|
+
rootInstance._root = rootInstance;
|
|
59
|
+
// $(), $(null), $(undefined), $(false)
|
|
60
|
+
if (!selector) {
|
|
61
|
+
return new LoadedCheerio(undefined, rootInstance, options);
|
|
62
|
+
}
|
|
63
|
+
const elements = typeof selector === 'string' && isHtml(selector)
|
|
64
|
+
? // $(<html>)
|
|
65
|
+
parse(selector, options, false, null).children
|
|
66
|
+
: isNode(selector)
|
|
67
|
+
? // $(dom)
|
|
68
|
+
[selector]
|
|
69
|
+
: Array.isArray(selector)
|
|
70
|
+
? // $([dom])
|
|
71
|
+
selector
|
|
72
|
+
: undefined;
|
|
73
|
+
const instance = new LoadedCheerio(elements, rootInstance, options);
|
|
74
|
+
if (elements) {
|
|
75
|
+
return instance;
|
|
76
|
+
}
|
|
77
|
+
if (typeof selector !== 'string') {
|
|
78
|
+
throw new TypeError('Unexpected type of selector');
|
|
79
|
+
}
|
|
80
|
+
// We know that our selector is a string now.
|
|
81
|
+
let search = selector;
|
|
82
|
+
const searchContext = context
|
|
83
|
+
? // If we don't have a context, maybe we have a root, from loading
|
|
84
|
+
typeof context === 'string'
|
|
85
|
+
? isHtml(context)
|
|
86
|
+
? // $('li', '<ul>...</ul>')
|
|
87
|
+
new LoadedCheerio([parse(context, options, false, null)], rootInstance, options)
|
|
88
|
+
: // $('li', 'ul')
|
|
89
|
+
((search = `${context} ${search}`), rootInstance)
|
|
90
|
+
: isCheerio(context)
|
|
91
|
+
? // $('li', $)
|
|
92
|
+
context
|
|
93
|
+
: // $('li', node), $('li', [nodes])
|
|
94
|
+
new LoadedCheerio(Array.isArray(context) ? context : [context], rootInstance, options)
|
|
95
|
+
: rootInstance;
|
|
96
|
+
// If we still don't have a context, return
|
|
97
|
+
if (!searchContext)
|
|
98
|
+
return instance;
|
|
99
|
+
/*
|
|
100
|
+
* #id, .class, tag
|
|
101
|
+
*/
|
|
102
|
+
return searchContext.find(search);
|
|
103
|
+
}
|
|
104
|
+
// Add in static methods & properties
|
|
105
|
+
Object.assign(initialize, staticMethods, {
|
|
106
|
+
load,
|
|
107
|
+
// `_root` and `_options` are used in static methods.
|
|
108
|
+
_root: initialRoot,
|
|
109
|
+
_options: internalOpts,
|
|
110
|
+
// Add `fn` for plugins
|
|
111
|
+
fn: LoadedCheerio.prototype,
|
|
112
|
+
// Add the prototype here to maintain `instanceof` behavior.
|
|
113
|
+
prototype: LoadedCheerio.prototype,
|
|
114
|
+
});
|
|
115
|
+
return initialize;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
function isNode(obj) {
|
|
119
|
+
return (
|
|
120
|
+
// @ts-expect-error: TS doesn't know about the `name` property.
|
|
121
|
+
!!obj.name ||
|
|
122
|
+
// @ts-expect-error: TS doesn't know about the `type` property.
|
|
123
|
+
obj.type === ElementType.Root ||
|
|
124
|
+
// @ts-expect-error: TS doesn't know about the `type` property.
|
|
125
|
+
obj.type === ElementType.Text ||
|
|
126
|
+
// @ts-expect-error: TS doesn't know about the `type` property.
|
|
127
|
+
obj.type === ElementType.Comment);
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=load.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../src/load.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,aAAa,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAgG1C,MAAM,UAAU,OAAO,CACrB,KAAiC,EACjC,MAGW;IAEX;;;;;;;;;;;;;OAaG;IACH,OAAO,SAAS,IAAI,CAClB,OAA8C,EAC9C,OAA+B,EAC/B,UAAU,GAAG,IAAI;QAEjB,IAAK,OAAyB,IAAI,IAAI,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACrD,CAAC;QAED,MAAM,YAAY,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;QAC7C,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;QAEnE;;;WAGG;QACH,MAAM,aAAiB,SAAQ,OAAU;YACvC,KAAK,CACH,QAAoC,EACpC,OAA4C;gBAE5C,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;gBAC9C,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;gBAE1B,OAAO,OAAO,CAAC;YACjB,CAAC;YAED,MAAM,CACJ,OAAyD,EACzD,OAAwB,EACxB,UAAmB,EACnB,OAA0B;gBAE1B,OAAO,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;YACtD,CAAC;YAED,OAAO,CAAC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CAAoB,CAAC;QACvD,CAAC;QAED,qCAAqC;QACrC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,aAAa,EAAE;YACvC,IAAI;YACJ,qDAAqD;YACrD,KAAK,EAAE,WAAW;YAClB,QAAQ,EAAE,YAAY;YACtB,uBAAuB;YACvB,EAAE,EAAE,aAAa,CAAC,SAAS;YAC3B,4DAA4D;YAC5D,SAAS,EAAE,aAAa,CAAC,SAAS;SACnC,CAAC,CAAC;QAEH,OAAO,UAAwB,CAAC;IAClC,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,MAAM,CAAC,GAAY;IAC1B,OAAO;IACL,+DAA+D;IAC/D,CAAC,CAAC,GAAG,CAAC,IAAI;QACV,+DAA+D;QAC/D,GAAG,CAAC,IAAI,KAAK,WAAW,CAAC,IAAI;QAC7B,+DAA+D;QAC/D,GAAG,CAAC,IAAI,KAAK,WAAW,CAAC,IAAI;QAC7B,+DAA+D;QAC/D,GAAG,CAAC,IAAI,KAAK,WAAW,CAAC,OAAO,CACjC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { DomHandlerOptions } from 'domhandler';
|
|
2
|
+
import type { ParserOptions as HTMLParser2ParserOptions } from 'htmlparser2';
|
|
3
|
+
import type { ParserOptions as Parse5ParserOptions } from 'parse5';
|
|
4
|
+
import type { Htmlparser2TreeAdapterMap } from 'parse5-htmlparser2-tree-adapter';
|
|
5
|
+
import type { Options as SelectOptions } from 'cheerio-select';
|
|
6
|
+
import type { DomSerializerOptions } from 'dom-serializer';
|
|
7
|
+
/**
|
|
8
|
+
* Options accepted by htmlparser2, the default parser for XML.
|
|
9
|
+
*
|
|
10
|
+
* @see https://github.com/fb55/htmlparser2/wiki/Parser-options
|
|
11
|
+
*/
|
|
12
|
+
export interface HTMLParser2Options extends DomHandlerOptions, DomSerializerOptions, HTMLParser2ParserOptions {
|
|
13
|
+
/** Treat the input as an XML document. */
|
|
14
|
+
xmlMode?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Options accepted by Cheerio.
|
|
18
|
+
*
|
|
19
|
+
* Please note that parser-specific options are _only recognized_ if the
|
|
20
|
+
* relevant parser is used.
|
|
21
|
+
*/
|
|
22
|
+
export interface CheerioOptions extends Parse5ParserOptions<Htmlparser2TreeAdapterMap> {
|
|
23
|
+
/**
|
|
24
|
+
* Recommended way of configuring htmlparser2 when wanting to parse XML.
|
|
25
|
+
*
|
|
26
|
+
* This will switch Cheerio to use htmlparser2.
|
|
27
|
+
*
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
xml?: HTMLParser2Options | boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Enable xml mode, which will switch Cheerio to use htmlparser2.
|
|
33
|
+
*
|
|
34
|
+
* @deprecated Please use the `xml` option instead.
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
xmlMode?: boolean;
|
|
38
|
+
/** The base URI for the document. Used to resolve the `href` and `src` props. */
|
|
39
|
+
baseURI?: string | URL;
|
|
40
|
+
/**
|
|
41
|
+
* Is the document in quirks mode?
|
|
42
|
+
*
|
|
43
|
+
* This will lead to `.className` and `#id` being case-insensitive.
|
|
44
|
+
*
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
quirksMode?: SelectOptions['quirksMode'];
|
|
48
|
+
/**
|
|
49
|
+
* Extension point for pseudo-classes.
|
|
50
|
+
*
|
|
51
|
+
* Maps from names to either strings of functions.
|
|
52
|
+
*
|
|
53
|
+
* - A string value is a selector that the element must match to be selected.
|
|
54
|
+
* - A function is called with the element as its first argument, and optional
|
|
55
|
+
* parameters second. If it returns true, the element is selected.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
*
|
|
59
|
+
* ```js
|
|
60
|
+
* const $ = cheerio.load(
|
|
61
|
+
* '<div class="foo"></div><div data-bar="boo"></div>',
|
|
62
|
+
* {
|
|
63
|
+
* pseudos: {
|
|
64
|
+
* // `:foo` is an alias for `div.foo`
|
|
65
|
+
* foo: 'div.foo',
|
|
66
|
+
* // `:bar(val)` is equivalent to `[data-bar=val s]`
|
|
67
|
+
* bar: (el, val) => el.attribs['data-bar'] === val,
|
|
68
|
+
* },
|
|
69
|
+
* },
|
|
70
|
+
* );
|
|
71
|
+
*
|
|
72
|
+
* $(':foo').length; // 1
|
|
73
|
+
* $('div:bar(boo)').length; // 1
|
|
74
|
+
* $('div:bar(baz)').length; // 0
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
pseudos?: SelectOptions['pseudos'];
|
|
78
|
+
}
|
|
79
|
+
/** Internal options for Cheerio. */
|
|
80
|
+
export interface InternalOptions extends HTMLParser2Options, Omit<CheerioOptions, 'xml'> {
|
|
81
|
+
/**
|
|
82
|
+
* Whether to use htmlparser2.
|
|
83
|
+
*
|
|
84
|
+
* This is set to true if `xml` is set to true.
|
|
85
|
+
*/
|
|
86
|
+
_useHtmlParser2?: boolean;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Flatten the options for Cheerio.
|
|
90
|
+
*
|
|
91
|
+
* This will set `_useHtmlParser2` to true if `xml` is set to true.
|
|
92
|
+
*
|
|
93
|
+
* @param options - The options to flatten.
|
|
94
|
+
* @param baseOptions - The base options to use.
|
|
95
|
+
* @returns The flattened options.
|
|
96
|
+
*/
|
|
97
|
+
export declare function flattenOptions(options?: CheerioOptions | null, baseOptions?: InternalOptions): InternalOptions;
|
|
98
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,IAAI,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,KAAK,EAAE,aAAa,IAAI,mBAAmB,EAAE,MAAM,QAAQ,CA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tmlParser2` to true if `xml` is set to true.
|
|
8
|
+
*
|
|
9
|
+
* @param options - The options to flatten.
|
|
10
|
+
* @param baseOptions - The base options to use.
|
|
11
|
+
* @returns The flattened options.
|
|
12
|
+
*/
|
|
13
|
+
export function flattenOptions(options, baseOptions) {
|
|
14
|
+
if (!options) {
|
|
15
|
+
return baseOptions !== null && baseOptions !== void 0 ? baseOptions : defaultOpts;
|
|
16
|
+
}
|
|
17
|
+
const opts = {
|
|
18
|
+
_useHtmlParser2: !!options.xmlMode,
|
|
19
|
+
...baseOptions,
|
|
20
|
+
...options,
|
|
21
|
+
};
|
|
22
|
+
if (options.xml) {
|
|
23
|
+
opts._useHtmlParser2 = true;
|
|
24
|
+
opts.xmlMode = true;
|
|
25
|
+
if (options.xml !== true) {
|
|
26
|
+
Object.assign(opts, options.xml);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else if (options.xmlMode) {
|
|
30
|
+
opts._useHtmlParser2 = true;
|
|
31
|
+
}
|
|
32
|
+
return opts;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":"AAgGA,MAAM,WAAW,GAAoB;IACnC,eAAe,EAAE,KAAK;CACvB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAC5B,OAA+B,EAC/B,WAA6B;IAE7B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,WAAW,CAAC;IACpC,CAAC;IAED,MAAM,IAAI,GAAoB;QAC5B,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO;QAClC,GAAG,WAAW;QACd,GAAG,OAAO;KACX,CAAC;IAEF,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QAEpB,IAAI,OAAO,CAAC,GAAG,KAAK,IAAI,EAAE,CAAC;YACzB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;SAAM,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type AnyNode, Document, type ParentNode } from 'domhandler';
|
|
2
|
+
import type { InternalOptions } from './options.js';
|
|
3
|
+
/**
|
|
4
|
+
* Get the parse function with options.
|
|
5
|
+
*
|
|
6
|
+
* @param parser - The parser function.
|
|
7
|
+
* @returns The parse function with options.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getParse(parser: (content: string, options: InternalOptions, isDocument: boolean, context: ParentNode | null) => Document): (content: string | Document | AnyNode | AnyNode[] | Buffer, options: InternalOptions, isDocument: boolean, context: ParentNode | null) => Document;
|
|
10
|
+
/**
|
|
11
|
+
* Update the dom structure, for one changed layer.
|
|
12
|
+
*
|
|
13
|
+
* @param newChilds - The new children.
|
|
14
|
+
* @param parent - The new parent.
|
|
15
|
+
* @returns The parent node.
|
|
16
|
+
*/
|
|
17
|
+
export declare function update(newChilds: AnyNode[] | AnyNode, parent: ParentNode | null): ParentNode | null;
|
|
18
|
+
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/parse.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,OAAO,EACZ,QAAQ,EACR,KAAK,UAAU,EAEhB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,CACN,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe,EACxB,UAAU,EAAE,OAAO,EACnB,OAAO,EAAE,UAAU,GAAG,IAAI,KACvB,QAAQ,IAYX,SAAS,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,EAAE,GAAG,MAAM,EACzD,SAAS,eAAe,EACxB,YAAY,OAAO,EACnB,SAAS,UAAU,GAAG,IAAI,KACzB,QAAQ,CAwBZ;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CACpB,SAAS,EAAE,OAAO,EAAE,GAAG,OAAO,EAC9B,MAAM,EAAE,UAAU,GAAG,IAAI,GACxB,UAAU,GAAG,IAAI,CA+BnB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { removeElement } from 'domutils';
|
|
2
|
+
import { Document, isDocument as checkIsDocument, } from 'domhandler';
|
|
3
|
+
/**
|
|
4
|
+
* Get the parse function with options.
|
|
5
|
+
*
|
|
6
|
+
* @param parser - The parser function.
|
|
7
|
+
* @returns The parse function with options.
|
|
8
|
+
*/
|
|
9
|
+
export function getParse(parser) {
|
|
10
|
+
/**
|
|
11
|
+
* Parse a HTML string or a node.
|
|
12
|
+
*
|
|
13
|
+
* @param content - The HTML string or node.
|
|
14
|
+
* @param options - The parser options.
|
|
15
|
+
* @param isDocument - If `content` is a document.
|
|
16
|
+
* @param context - The context node in the DOM tree.
|
|
17
|
+
* @returns The parsed document node.
|
|
18
|
+
*/
|
|
19
|
+
return function parse(content, options, isDocument, context) {
|
|
20
|
+
if (typeof Buffer !== 'undefined' && Buffer.isBuffer(content)) {
|
|
21
|
+
content = content.toString();
|
|
22
|
+
}
|
|
23
|
+
if (typeof content === 'string') {
|
|
24
|
+
return parser(content, options, isDocument, context);
|
|
25
|
+
}
|
|
26
|
+
const doc = content;
|
|
27
|
+
if (!Array.isArray(doc) && checkIsDocument(doc)) {
|
|
28
|
+
// If `doc` is already a root, just return it
|
|
29
|
+
return doc;
|
|
30
|
+
}
|
|
31
|
+
// Add content to new root element
|
|
32
|
+
const root = new Document([]);
|
|
33
|
+
// Update the DOM using the root
|
|
34
|
+
update(doc, root);
|
|
35
|
+
return root;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Update the dom structure, for one changed layer.
|
|
40
|
+
*
|
|
41
|
+
* @param newChilds - The new children.
|
|
42
|
+
* @param parent - The new parent.
|
|
43
|
+
* @returns The parent node.
|
|
44
|
+
*/
|
|
45
|
+
export function update(newChilds, parent) {
|
|
46
|
+
// Normalize
|
|
47
|
+
const arr = Array.isArray(newChilds) ? newChilds : [newChilds];
|
|
48
|
+
// Update parent
|
|
49
|
+
if (parent) {
|
|
50
|
+
parent.children = arr;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
parent = null;
|
|
54
|
+
}
|
|
55
|
+
// Update neighbors
|
|
56
|
+
for (let i = 0; i < arr.length; i++) {
|
|
57
|
+
const node = arr[i];
|
|
58
|
+
// Cleanly remove existing nodes from their previous structures.
|
|
59
|
+
if (node.parent && node.parent.children !== arr) {
|
|
60
|
+
removeElement(node);
|
|
61
|
+
}
|
|
62
|
+
if (parent) {
|
|
63
|
+
node.prev = arr[i - 1] || null;
|
|
64
|
+
node.next = arr[i + 1] || null;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
node.prev = node.next = null;
|
|
68
|
+
}
|
|
69
|
+
node.parent = parent;
|
|
70
|
+
}
|
|
71
|
+
return parent;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=parse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAEL,QAAQ,EAER,UAAU,IAAI,eAAe,GAC9B,MAAM,YAAY,CAAC;AAGpB;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAC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,EAAE,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QAEpB,gEAAgE;QAChE,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,GAAG,EAAE,CAAC;YAChD,aAAa,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;QAED,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC;YAC/B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC;QACjC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAC/B,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type AnyNode, type Document, type ParentNode } from 'domhandler';
|
|
2
|
+
import type { InternalOptions } from '../options.js';
|
|
3
|
+
/**
|
|
4
|
+
* Parse the content with `parse5` in the context of the given `ParentNode`.
|
|
5
|
+
*
|
|
6
|
+
* @param content - The content to parse.
|
|
7
|
+
* @param options - A set of options to use to parse.
|
|
8
|
+
* @param isDocument - Whether to parse the content as a full HTML document.
|
|
9
|
+
* @param context - The context in which to parse the content.
|
|
10
|
+
* @returns The parsed content.
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseWithParse5(content: string, options: InternalOptions, isDocument: boolean, context: ParentNode | null): Document;
|
|
13
|
+
/**
|
|
14
|
+
* Renders the given DOM tree with `parse5` and returns the result as a string.
|
|
15
|
+
*
|
|
16
|
+
* @param dom - The DOM tree to render.
|
|
17
|
+
* @returns The rendered document.
|
|
18
|
+
*/
|
|
19
|
+
export declare function renderWithParse5(dom: AnyNode | ArrayLike<AnyNode>): string;
|
|
20
|
+
//# sourceMappingURL=parse5-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse5-adapter.d.ts","sourceRoot":"","sources":["../../../src/parsers/parse5-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,UAAU,EAEhB,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe,EACxB,UAAU,EAAE,OAAO,EACnB,OAAO,EAAE,UAAU,GAAG,IAAI,GACzB,QAAQ,CAUV;AAID;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,MAAM,CAqB1E"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { isDocument, } from 'domhandler';
|
|
2
|
+
import { parse as parseDocument, parseFragment, serializeOuter } from 'parse5';
|
|
3
|
+
import { adapter as htmlparser2Adapter } from 'parse5-htmlparser2-tree-adapter';
|
|
4
|
+
/**
|
|
5
|
+
* Parse the content with `parse5` in the context of the given `ParentNode`.
|
|
6
|
+
*
|
|
7
|
+
* @param content - The content to parse.
|
|
8
|
+
* @param options - A set of options to use to parse.
|
|
9
|
+
* @param isDocument - Whether to parse the content as a full HTML document.
|
|
10
|
+
* @param context - The context in which to parse the content.
|
|
11
|
+
* @returns The parsed content.
|
|
12
|
+
*/
|
|
13
|
+
export function parseWithParse5(content, options, isDocument, context) {
|
|
14
|
+
var _a;
|
|
15
|
+
(_a = options.treeAdapter) !== null && _a !== void 0 ? _a : (options.treeAdapter = htmlparser2Adapter);
|
|
16
|
+
if (options.scriptingEnabled !== false) {
|
|
17
|
+
options.scriptingEnabled = true;
|
|
18
|
+
}
|
|
19
|
+
return isDocument
|
|
20
|
+
? parseDocument(content, options)
|
|
21
|
+
: parseFragment(context, content, options);
|
|
22
|
+
}
|
|
23
|
+
const renderOpts = { treeAdapter: htmlparser2Adapter };
|
|
24
|
+
/**
|
|
25
|
+
* Renders the given DOM tree with `parse5` and returns the result as a string.
|
|
26
|
+
*
|
|
27
|
+
* @param dom - The DOM tree to render.
|
|
28
|
+
* @returns The rendered document.
|
|
29
|
+
*/
|
|
30
|
+
export function renderWithParse5(dom) {
|
|
31
|
+
/*
|
|
32
|
+
* `dom-serializer` passes over the special "root" node and renders the
|
|
33
|
+
* node's children in its place. To mimic this behavior with `parse5`, an
|
|
34
|
+
* equivalent operation must be applied to the input array.
|
|
35
|
+
*/
|
|
36
|
+
const nodes = 'length' in dom ? dom : [dom];
|
|
37
|
+
for (let index = 0; index < nodes.length; index += 1) {
|
|
38
|
+
const node = nodes[index];
|
|
39
|
+
if (isDocument(node)) {
|
|
40
|
+
Array.prototype.splice.call(nodes, index, 1, ...node.children);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
let result = '';
|
|
44
|
+
for (let index = 0; index < nodes.length; index += 1) {
|
|
45
|
+
const node = nodes[index];
|
|
46
|
+
result += serializeOuter(node, renderOpts);
|
|
47
|
+
}
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=parse5-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse5-adapter.js","sourceRoot":"","sources":["../../../src/parsers/parse5-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,UAAU,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,IAAI,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAGhF;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAe,EACf,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U,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Alternative entry point for Cheerio that always uses htmlparser2. This
|
|
3
|
+
* way, parse5 won't be loaded, saving some memory.
|
|
4
|
+
*/
|
|
5
|
+
import { type CheerioAPI } from './load.js';
|
|
6
|
+
import { type CheerioOptions } from './options.js';
|
|
7
|
+
import type { AnyNode } from 'domhandler';
|
|
8
|
+
export { contains, merge } from './static.js';
|
|
9
|
+
export type * from './types.js';
|
|
10
|
+
export type { Cheerio } from './cheerio.js';
|
|
11
|
+
export type { CheerioOptions, HTMLParser2Options } from './options.js';
|
|
12
|
+
export type { CheerioAPI } from './load.js';
|
|
13
|
+
/**
|
|
14
|
+
* Create a querying function, bound to a document created from the provided
|
|
15
|
+
* markup.
|
|
16
|
+
*
|
|
17
|
+
* @param content - Markup to be loaded.
|
|
18
|
+
* @param options - Options for the created instance.
|
|
19
|
+
* @param isDocument - Always `false` here, as we are always using
|
|
20
|
+
* `htmlparser2`.
|
|
21
|
+
* @returns The loaded document.
|
|
22
|
+
* @see {@link https://cheerio.js.org#loading} for additional usage information.
|
|
23
|
+
*/
|
|
24
|
+
export declare const load: (content: string | AnyNode | AnyNode[] | Buffer, options?: CheerioOptions | null, isDocument?: boolean) => CheerioAPI;
|
|
25
|
+
//# sourceMappingURL=slim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slim.d.ts","sourceRoot":"","sources":["../../src/slim.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,UAAU,EAAW,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAI1C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC9C,mBAAmB,YAAY,CAAC;AAChC,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvE,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI,EAAE,CACjB,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,EAAE,GAAG,MAAM,EAC9C,OAAO,CAAC,EAAE,cAAc,GAAG,IAAI,EAC/B,UAAU,CAAC,EAAE,OAAO,KACjB,UAAqD,CAAC"}
|
package/dist/esm/slim.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Alternative entry point for Cheerio that always uses htmlparser2. This
|
|
3
|
+
* way, parse5 won't be loaded, saving some memory.
|
|
4
|
+
*/
|
|
5
|
+
import { getLoad } from './load.js';
|
|
6
|
+
import { getParse } from './parse.js';
|
|
7
|
+
import render from 'dom-serializer';
|
|
8
|
+
import { parseDocument } from 'htmlparser2';
|
|
9
|
+
export { contains, merge } from './static.js';
|
|
10
|
+
/**
|
|
11
|
+
* Create a querying function, bound to a document created from the provided
|
|
12
|
+
* markup.
|
|
13
|
+
*
|
|
14
|
+
* @param content - Markup to be loaded.
|
|
15
|
+
* @param options - Options for the created instance.
|
|
16
|
+
* @param isDocument - Always `false` here, as we are always using
|
|
17
|
+
* `htmlparser2`.
|
|
18
|
+
* @returns The loaded document.
|
|
19
|
+
* @see {@link https://cheerio.js.org#loading} for additional usage information.
|
|
20
|
+
*/
|
|
21
|
+
export const load = getLoad(getParse(parseDocument), render);
|
|
22
|
+
//# sourceMappingURL=slim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slim.js","sourceRoot":"","sources":["../../src/slim.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAmB,OAAO,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAM9C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,IAAI,GAIC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { BasicAcceptedElems } from './types.js';
|
|
2
|
+
import type { CheerioAPI } from './load.js';
|
|
3
|
+
import type { Cheerio } from './cheerio.js';
|
|
4
|
+
import type { AnyNode, Document } from 'domhandler';
|
|
5
|
+
import { type CheerioOptions } from './options.js';
|
|
6
|
+
import type { ExtractedMap, ExtractMap } from './api/extract.js';
|
|
7
|
+
/**
|
|
8
|
+
* Renders the document.
|
|
9
|
+
*
|
|
10
|
+
* @category Static
|
|
11
|
+
* @param options - Options for the renderer.
|
|
12
|
+
* @returns The rendered document.
|
|
13
|
+
*/
|
|
14
|
+
export declare function html(this: CheerioAPI, options?: CheerioOptions): string;
|
|
15
|
+
/**
|
|
16
|
+
* Renders the document.
|
|
17
|
+
*
|
|
18
|
+
* @category Static
|
|
19
|
+
* @param dom - Element to render.
|
|
20
|
+
* @param options - Options for the renderer.
|
|
21
|
+
* @returns The rendered document.
|
|
22
|
+
*/
|
|
23
|
+
export declare function html(this: CheerioAPI, dom?: BasicAcceptedElems<AnyNode>, options?: CheerioOptions): string;
|
|
24
|
+
/**
|
|
25
|
+
* Render the document as XML.
|
|
26
|
+
*
|
|
27
|
+
* @category Static
|
|
28
|
+
* @param dom - Element to render.
|
|
29
|
+
* @returns THe rendered document.
|
|
30
|
+
*/
|
|
31
|
+
export declare function xml(this: CheerioAPI, dom?: BasicAcceptedElems<AnyNode>): string;
|
|
32
|
+
/**
|
|
33
|
+
* Render the document as text.
|
|
34
|
+
*
|
|
35
|
+
* This returns the `textContent` of the passed elements. The result will
|
|
36
|
+
* include the contents of `<script>` and `<style>` elements. To avoid this, use
|
|
37
|
+
* `.prop('innerText')` instead.
|
|
38
|
+
*
|
|
39
|
+
* @category Static
|
|
40
|
+
* @param elements - Elements to render.
|
|
41
|
+
* @returns The rendered document.
|
|
42
|
+
*/
|
|
43
|
+
export declare function text(this: CheerioAPI | void, elements?: ArrayLike<AnyNode>): string;
|
|
44
|
+
/**
|
|
45
|
+
* Parses a string into an array of DOM nodes. The `context` argument has no
|
|
46
|
+
* meaning for Cheerio, but it is maintained for API compatibility with jQuery.
|
|
47
|
+
*
|
|
48
|
+
* @category Static
|
|
49
|
+
* @param data - Markup that will be parsed.
|
|
50
|
+
* @param context - Will be ignored. If it is a boolean it will be used as the
|
|
51
|
+
* value of `keepScripts`.
|
|
52
|
+
* @param keepScripts - If false all scripts will be removed.
|
|
53
|
+
* @returns The parsed DOM.
|
|
54
|
+
* @alias Cheerio.parseHTML
|
|
55
|
+
* @see {@link https://api.jquery.com/jQuery.parseHTML/}
|
|
56
|
+
*/
|
|
57
|
+
export declare function parseHTML(this: CheerioAPI, data: string, context?: unknown, keepScripts?: boolean): AnyNode[];
|
|
58
|
+
export declare function parseHTML(this: CheerioAPI, data?: '' | null): null;
|
|
59
|
+
/**
|
|
60
|
+
* Sometimes you need to work with the top-level root element. To query it, you
|
|
61
|
+
* can use `$.root()`.
|
|
62
|
+
*
|
|
63
|
+
* @category Static
|
|
64
|
+
* @example
|
|
65
|
+
*
|
|
66
|
+
* ```js
|
|
67
|
+
* $.root().append('<ul id="vegetables"></ul>').html();
|
|
68
|
+
* //=> <ul id="fruits">...</ul><ul id="vegetables"></ul>
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @returns Cheerio instance wrapping the root node.
|
|
72
|
+
* @alias Cheerio.root
|
|
73
|
+
*/
|
|
74
|
+
export declare function root(this: CheerioAPI): Cheerio<Document>;
|
|
75
|
+
/**
|
|
76
|
+
* Checks to see if the `contained` DOM element is a descendant of the
|
|
77
|
+
* `container` DOM element.
|
|
78
|
+
*
|
|
79
|
+
* @category Static
|
|
80
|
+
* @param container - Potential parent node.
|
|
81
|
+
* @param contained - Potential child node.
|
|
82
|
+
* @returns Indicates if the nodes contain one another.
|
|
83
|
+
* @alias Cheerio.contains
|
|
84
|
+
* @see {@link https://api.jquery.com/jQuery.contains/}
|
|
85
|
+
*/
|
|
86
|
+
export declare function contains(container: AnyNode, contained: AnyNode): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Extract multiple values from a document, and store them in an object.
|
|
89
|
+
*
|
|
90
|
+
* @category Static
|
|
91
|
+
* @param map - An object containing key-value pairs. The keys are the names of
|
|
92
|
+
* the properties to be created on the object, and the values are the
|
|
93
|
+
* selectors to be used to extract the values.
|
|
94
|
+
* @returns An object containing the extracted values.
|
|
95
|
+
*/
|
|
96
|
+
export declare function extract<M extends ExtractMap>(this: CheerioAPI, map: M): ExtractedMap<M>;
|
|
97
|
+
type Writable<T> = {
|
|
98
|
+
-readonly [P in keyof T]: T[P];
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* $.merge().
|
|
102
|
+
*
|
|
103
|
+
* @category Static
|
|
104
|
+
* @param arr1 - First array.
|
|
105
|
+
* @param arr2 - Second array.
|
|
106
|
+
* @returns `arr1`, with elements of `arr2` inserted.
|
|
107
|
+
* @alias Cheerio.merge
|
|
108
|
+
* @see {@link https://api.jquery.com/jQuery.merge/}
|
|
109
|
+
*/
|
|
110
|
+
export declare function merge<T>(arr1: Writable<ArrayLike<T>>, arr2: ArrayLike<T>): ArrayLike<T> | undefined;
|
|
111
|
+
export {};
|
|
112
|
+
//# sourceMappingURL=static.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../../src/static.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAA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