@csstools/css-parser-algorithms
Advanced tools
Comparing version
# Changes to CSS Parser Algorithms | ||
### 2.2.0 (June 1, 2023) | ||
- Add `state` to `walk` methods. | ||
This makes it possible pass down information from a parent structure to children. | ||
e.g. you can set `entry.state.isInCalcExpression = true` for `calc((10 + 5) / 2)` when walking the `FunctionNode` for `calc`. | ||
### 2.1.1 (April 10, 2023) | ||
@@ -7,3 +14,2 @@ | ||
### 2.1.0 (March 25, 2023) | ||
@@ -10,0 +16,0 @@ |
@@ -26,6 +26,7 @@ import { CSSToken, TokenFunction } from '@csstools/css-tokenizer'; | ||
at(index: number | string): ComponentValue | undefined; | ||
walk(cb: (entry: { | ||
walk<T extends Record<string, unknown>>(cb: (entry: { | ||
node: ComponentValue; | ||
parent: ContainerNode; | ||
}, index: number | string) => boolean | void): false | undefined; | ||
state?: T; | ||
}, index: number | string) => boolean | void, state?: T): false | undefined; | ||
toJSON(): unknown; | ||
@@ -54,6 +55,7 @@ isFunctionNode(): this is FunctionNode; | ||
at(index: number | string): ComponentValue | undefined; | ||
walk(cb: (entry: { | ||
walk<T extends Record<string, unknown>>(cb: (entry: { | ||
node: ComponentValue; | ||
parent: ContainerNode; | ||
}, index: number | string) => boolean | void): false | undefined; | ||
state?: T; | ||
}, index: number | string) => boolean | void, state?: T): false | undefined; | ||
toJSON(): unknown; | ||
@@ -60,0 +62,0 @@ isSimpleBlockNode(): this is SimpleBlockNode; |
{ | ||
"name": "@csstools/css-parser-algorithms", | ||
"description": "Algorithms to help you parse CSS from an array of tokens.", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"contributors": [ | ||
@@ -17,6 +17,12 @@ { | ||
"license": "MIT", | ||
"funding": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/csstools" | ||
}, | ||
"funding": [ | ||
{ | ||
"type": "github", | ||
"url": "https://github.com/sponsors/csstools" | ||
}, | ||
{ | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/csstools" | ||
} | ||
], | ||
"engines": { | ||
@@ -23,0 +29,0 @@ "node": "^14 || ^16 || >=18" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
31799
2.07%237
1.28%