@parse5/tools
Advanced tools
Comparing version 0.1.0 to 0.1.1-nodenext.0
@@ -1,2 +0,2 @@ | ||
import type { Element } from 'parse5/dist/tree-adapters/default.js'; | ||
import type { Element } from './nodeTypes.js'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Sets the given attribute on the specified node |
import { html, Token } from 'parse5'; | ||
import type { CommentNode, TextNode, Element, Template, DocumentFragment, Document } from 'parse5/dist/tree-adapters/default.js'; | ||
import type { CommentNode, TextNode, Element, Template, DocumentFragment, Document } from './nodeTypes.js'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Creates an element node |
@@ -1,2 +0,2 @@ | ||
import type { Node } from 'parse5/dist/tree-adapters/default.js'; | ||
import type { Node } from './nodeTypes.js'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Computes the text content of a given node using a similar |
@@ -1,2 +0,2 @@ | ||
import type { Node } from 'parse5/dist/tree-adapters/default.js'; | ||
import type { Node } from './nodeTypes.js'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Queries the AST for a node which satifies the given condition |
@@ -1,2 +0,2 @@ | ||
import type { Element, ParentNode, CommentNode, TextNode, Template, DocumentFragment, Document, DocumentType, Node } from 'parse5/dist/tree-adapters/default.js'; | ||
import type { Element, ParentNode, CommentNode, TextNode, Template, DocumentFragment, Document, DocumentType, Node } from './nodeTypes.js'; | ||
export interface Visitor { | ||
@@ -3,0 +3,0 @@ 'pre:node'?: (node: Node, parent?: ParentNode) => boolean | void; |
@@ -1,2 +0,4 @@ | ||
import type { ChildNode, Node } from 'parse5/dist/tree-adapters/default.js'; | ||
import type { DefaultTreeAdapterMap, TreeAdapter } from 'parse5'; | ||
import type { ChildNode, Node } from './nodeTypes.js'; | ||
declare type DefaultTreeAdapterLike = TreeAdapter<DefaultTreeAdapterMap>; | ||
/** | ||
@@ -8,3 +10,3 @@ * Attempts to remove the given node from the AST | ||
export declare function removeNode(node: Node): void; | ||
export declare const appendChild: (parentNode: import("parse5/dist/tree-adapters/default.js").ParentNode, newNode: ChildNode) => void; | ||
export declare const appendChild: DefaultTreeAdapterLike['appendChild']; | ||
/** | ||
@@ -26,1 +28,2 @@ * Performs a splice on the children of the given node | ||
export declare function replaceWith(node: ChildNode, ...replacements: ChildNode[]): void; | ||
export {}; |
@@ -1,2 +0,4 @@ | ||
import type { ParentNode, ChildNode, Template, DocumentFragment, Document, Node } from 'parse5/dist/tree-adapters/default.js'; | ||
import type { DefaultTreeAdapterMap, TreeAdapter } from 'parse5'; | ||
import type { ParentNode, ChildNode, Template, DocumentFragment, Document, Node } from './nodeTypes.js'; | ||
declare type DefaultTreeAdapterLike = TreeAdapter<DefaultTreeAdapterMap>; | ||
/** | ||
@@ -20,6 +22,6 @@ * Determines if a given node is a document or not | ||
export declare function isTemplateNode(node: Node): node is Template; | ||
export declare const isElementNode: (node: Node) => node is import("parse5/dist/tree-adapters/default.js").Element; | ||
export declare const isCommentNode: (node: Node) => node is import("parse5/dist/tree-adapters/default.js").CommentNode; | ||
export declare const isDocumentTypeNode: (node: Node) => node is import("parse5/dist/tree-adapters/default.js").DocumentType; | ||
export declare const isTextNode: (node: Node) => node is import("parse5/dist/tree-adapters/default.js").TextNode; | ||
export declare const isElementNode: DefaultTreeAdapterLike['isElementNode']; | ||
export declare const isCommentNode: DefaultTreeAdapterLike['isCommentNode']; | ||
export declare const isDocumentTypeNode: DefaultTreeAdapterLike['isDocumentTypeNode']; | ||
export declare const isTextNode: DefaultTreeAdapterLike['isTextNode']; | ||
/** | ||
@@ -37,1 +39,2 @@ * Determines if a given node is a parent or not | ||
export declare function isChildNode(node: Node): node is ChildNode; | ||
export {}; |
{ | ||
"name": "@parse5/tools", | ||
"version": "0.1.0", | ||
"version": "0.1.1-nodenext.0", | ||
"description": "A small set of utilities for dealing with parse5 syntax trees", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
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
27443
20
641