@stll/html 0.1.0 → 0.1.1

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/dist/bounded.d.ts CHANGED
@@ -1,9 +1,7 @@
1
- import { n as CheerioAPI } from "./selection-MSQw_x8X.js";
2
- //#region src/bounded.d.ts
1
+ import { n as CheerioAPI } from "./selection-DiMoYiIl.js";
3
2
  type AllocationBudget = {
4
3
  maxDomAllocations: number;
5
4
  reject: () => never;
6
5
  };
7
6
  export declare const loadWithAllocationBudget: (html: string, { maxDomAllocations, reject }: AllocationBudget) => import("cheerio/slim").CheerioAPI;
8
- //#endregion
9
7
  export type { CheerioAPI };
package/dist/bounded.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { load } from "./load.js";
2
2
  import { isText } from "domhandler";
3
3
  import { adapter } from "parse5-htmlparser2-tree-adapter";
4
- //#region src/bounded.ts
4
+ // src/bounded.ts
5
5
  const loadWithAllocationBudget = (html, { maxDomAllocations, reject }) => {
6
6
  let allocations = 0;
7
7
  let parsingPublisherMarkup = true;
@@ -55,5 +55,4 @@ const loadWithAllocationBudget = (html, { maxDomAllocations, reject }) => {
55
55
  parsingPublisherMarkup = false;
56
56
  return document;
57
57
  };
58
- //#endregion
59
58
  export { loadWithAllocationBudget };
package/dist/email.d.ts CHANGED
@@ -1,10 +1,8 @@
1
1
  import { AnyNode } from "./nodes.js";
2
- //#region src/email.d.ts
3
2
  export declare const EMAIL_PREVIEW_DOM_OPTIONS: Readonly<{
4
3
  scriptingEnabled: false;
5
4
  treeAdapter: import("parse5").TreeAdapter<import("parse5-htmlparser2-tree-adapter").Htmlparser2TreeAdapterMap>;
6
5
  }>;
7
6
  export declare const loadEmailDocument: (html: string) => import("cheerio/slim").CheerioAPI;
8
7
  export declare const serializeEmailNode: (node: AnyNode) => string;
9
- export declare const serializeEmailPreviewMarkup: ($: ReturnType<typeof loadEmailDocument>) => string;
10
- //#endregion
8
+ export declare const serializeEmailPreviewMarkup: ($: ReturnType<typeof loadEmailDocument>) => string;
package/dist/email.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { load } from "./load.js";
2
2
  import { serializeOuter } from "parse5";
3
3
  import { adapter } from "parse5-htmlparser2-tree-adapter";
4
- //#region src/email.ts
4
+ // src/email.ts
5
5
  const EMAIL_PREVIEW_DOM_OPTIONS = Object.freeze({
6
6
  scriptingEnabled: false,
7
7
  treeAdapter: adapter
@@ -12,5 +12,4 @@ const serializeEmailPreviewMarkup = ($) => {
12
12
  const html = $("html").get(0);
13
13
  return html ? serializeEmailNode(html) : "";
14
14
  };
15
- //#endregion
16
15
  export { EMAIL_PREVIEW_DOM_OPTIONS, loadEmailDocument, serializeEmailNode, serializeEmailPreviewMarkup };
package/dist/load.d.ts CHANGED
@@ -1,7 +1,5 @@
1
- import { n as CheerioAPI, r as CheerioOptions, t as Cheerio } from "./selection-MSQw_x8X.js";
2
- //#region src/load.d.ts
1
+ import { n as CheerioAPI, r as CheerioOptions, t as Cheerio } from "./selection-DiMoYiIl.js";
3
2
  export declare const htmlTreeAdapter: import("parse5").TreeAdapter<import("parse5-htmlparser2-tree-adapter").Htmlparser2TreeAdapterMap>;
4
3
  /** Parse strings without loading Cheerio's byte decoders or HTTP client. */
5
4
  export declare const load: (content: string, options?: CheerioOptions | null, document?: boolean) => CheerioAPI;
6
- //#endregion
7
5
  export type { Cheerio, CheerioAPI, CheerioOptions };
package/dist/load.js CHANGED
@@ -3,7 +3,7 @@ import { load as load$1 } from "cheerio/slim";
3
3
  import { isDocument } from "domhandler";
4
4
  import { parse, parseFragment, serializeOuter } from "parse5";
5
5
  import { adapter } from "parse5-htmlparser2-tree-adapter";
6
- //#region src/load.ts
6
+ // src/load.ts
7
7
  const htmlTreeAdapter = adapter;
8
8
  /** Parse strings without loading Cheerio's byte decoders or HTTP client. */
9
9
  const load = (content, options, document = true) => {
@@ -50,5 +50,4 @@ const isMarkup = (value) => {
50
50
  return start !== -1 && /[a-z!]/iu.test(value.charAt(start + 1)) && value.includes(">", start + 2);
51
51
  };
52
52
  const usesXmlParser = (options) => options?.xml === true || typeof options?.xml === "object" || options?.xmlMode === true;
53
- //#endregion
54
53
  export { htmlTreeAdapter, load };
package/dist/nodes.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { AnyNode, Element, Element as Element$1, ParentNode, Text, Text as Text$1, cloneNode as cloneNode$1, hasChildren as hasChildren$1, isCDATA as isCDATA$1, isComment as isComment$1, isTag as isTag$1, isText as isText$1 } from "domhandler";
2
- //#region src/nodes.d.ts
3
2
  export declare const createElement: (...args: ConstructorParameters<typeof Element$1>) => Element$1;
4
3
  export declare const createText: (data: string) => Text$1;
5
4
  export declare const cloneNode: typeof cloneNode$1;
@@ -8,5 +7,4 @@ export declare const isCDATA: typeof isCDATA$1;
8
7
  export declare const isComment: typeof isComment$1;
9
8
  export declare const isTag: typeof isTag$1;
10
9
  export declare const isText: typeof isText$1;
11
- //#endregion
12
10
  export type { AnyNode, Element, ParentNode, Text };
package/dist/nodes.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Element, Text, cloneNode as cloneNode$1, hasChildren as hasChildren$1, isCDATA as isCDATA$1, isComment as isComment$1, isTag as isTag$1, isText as isText$1 } from "domhandler";
2
- //#region src/nodes.ts
2
+ // src/nodes.ts
3
3
  const createElement = (...args) => new Element(...args);
4
4
  const createText = (data) => new Text(data);
5
5
  const cloneNode = cloneNode$1;
@@ -8,5 +8,4 @@ const isCDATA = isCDATA$1;
8
8
  const isComment = isComment$1;
9
9
  const isTag = isTag$1;
10
10
  const isText = isText$1;
11
- //#endregion
12
11
  export { cloneNode, createElement, createText, hasChildren, isCDATA, isComment, isTag, isText };
@@ -1,7 +1,5 @@
1
1
  import { Cheerio, CheerioAPI, CheerioOptions } from "cheerio/slim";
2
- //#region src/selection.d.ts
3
2
  type CheerioOptions$1 = Omit<CheerioOptions, "xmlMode"> & {
4
3
  xmlMode?: boolean;
5
4
  };
6
- //#endregion
7
5
  export { CheerioAPI as n, CheerioOptions$1 as r, Cheerio as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/html",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "String-only HTML parsing with Cheerio traversal",
5
5
  "keywords": [
6
6
  "cheerio",
@@ -60,12 +60,12 @@
60
60
  "@stll/sha256": "0.0.0",
61
61
  "@stll/typescript-config": "0.0.0",
62
62
  "bun-types": "1.4.4",
63
- "tsdown": "0.23.1"
63
+ "tsdown": "0.23.4"
64
64
  },
65
65
  "dependencies": {
66
66
  "better-result": "3.0.1",
67
67
  "cheerio": "^1.2.0",
68
- "domhandler": "^6.0.1",
68
+ "domhandler": "^5.0.3",
69
69
  "parse5": "7.3.0",
70
70
  "parse5-htmlparser2-tree-adapter": "7.1.0"
71
71
  },