@vltpkg/dss-parser
Type Aliases
ParsedSelectorToken
type ParsedSelectorToken = PostcssNode & object
Defined in: types.ts:47
Type declaration
token
token: string
PostCSSLeaf
type PostCSSLeaf = | ReturnType<typeof tag> | ReturnType<typeof id> | ReturnType<typeof attribute> | ReturnType<typeof combinator> | ReturnType<typeof pseudo> | ReturnType<typeof string>
Defined in: types.ts:37
PostcssNode
type PostcssNode = | Tag | String | Selector | Root | Pseudo | Nesting | Identifier | Comment | Combinator | ClassName | Attribute | Universal
Defined in: types.ts:23
PostcssNodeWithChildren
type PostcssNodeWithChildren = Selector | Root | Pseudo
Defined in: types.ts:45
Functions
asAttributeNode()
function asAttributeNode(node?): Attribute
Defined in: types.ts:77
Parameters
node?
Returns
Attribute
asCombinatorNode()
function asCombinatorNode(node?): Combinator
Defined in: types.ts:94
Parameters
node?
Returns
Combinator
asCommentNode()
function asCommentNode(node?): Comment
Defined in: types.ts:198
Parameters
node?
Returns
Comment
asIdentifierNode()
function asIdentifierNode(node?): Identifier
Defined in: types.ts:111
Parameters
node?
Returns
Identifier
asPostcssNodeWithChildren()
function asPostcssNodeWithChildren(node?): PostcssNodeWithChildren
Defined in: types.ts:56
Parameters
node?
Returns
asPseudoNode()
function asPseudoNode(node?): Pseudo
Defined in: types.ts:145
Parameters
node?
Returns
Pseudo
asSelectorNode()
function asSelectorNode(node?): Selector
Defined in: types.ts:128
Parameters
node?
Returns
Selector
asStringNode()
function asStringNode(node?): String
Defined in: types.ts:180
Parameters
node?
Returns
String
asTagNode()
function asTagNode(node?): Tag
Defined in: types.ts:162
Parameters
node?
Returns
Tag
escapeDots()
function escapeDots(query): string
Defined in: index.ts:24
Parameters
query
string
Returns
string
escapeScopedNamesSlashes()
function escapeScopedNamesSlashes(query): string
Defined in: index.ts:18
Escapes forward slashes in specific patterns matching @scoped/name paths This will allow usage of unescaped forward slashes necessary for scoped package names in the id selector.
Parameters
query
string
Returns
string
isAttributeNode()
function isAttributeNode(node): node is Attribute
Defined in: types.ts:74
Parameters
node
unknown
Returns
node is Attribute
isCombinatorNode()
function isCombinatorNode(node): node is Combinator
Defined in: types.ts:91
Parameters
node
unknown
Returns
node is Combinator
isCommentNode()
function isCommentNode(node): node is Comment
Defined in: types.ts:195
Parameters
node
unknown
Returns
node is Comment
isIdentifierNode()
function isIdentifierNode(node): node is Identifier
Defined in: types.ts:108
Parameters
node
any
Returns
node is Identifier
isPostcssNodeWithChildren()
function isPostcssNodeWithChildren( node,): node is PostcssNodeWithChildren
Defined in: types.ts:51
Parameters
node
any
Returns
node is PostcssNodeWithChildren
isPseudoNode()
function isPseudoNode(node): node is Pseudo
Defined in: types.ts:142
Parameters
node
unknown
Returns
node is Pseudo
isSelectorNode()
function isSelectorNode(node): node is Selector
Defined in: types.ts:125
Parameters
node
any
Returns
node is Selector
isStringNode()
function isStringNode(node): node is String
Defined in: types.ts:177
Parameters
node
unknown
Returns
node is String
isTagNode()
function isTagNode(node): node is Tag
Defined in: types.ts:159
Parameters
node
unknown
Returns
node is Tag
parse()
function parse(query): Root
Defined in: index.ts:48
Parses a CSS selector string into an AST Handles escaping of forward slashes in specific patterns
Parameters
query
string
Returns
Root
unescapeDots()
function unescapeDots(query): string
Defined in: index.ts:27
Parameters
query
string
Returns
string