@csstools/css-tokenizer
Advanced tools
Comparing version 2.2.4 to 2.3.0
# Changes to CSS Tokenizer | ||
### 2.3.0 | ||
_May 4, 2024_ | ||
- Add `mutateUnit` helper function | ||
- Add type guard helpers | ||
### 2.2.4 | ||
@@ -15,8 +22,2 @@ | ||
### 2.2.2 | ||
_December 15, 2023_ | ||
- Fix type definitions | ||
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md) |
@@ -86,3 +86,67 @@ /** | ||
export declare function isTokenAtKeyword(x?: CSSToken | null): x is TokenAtKeyword; | ||
export declare function isTokenBadString(x?: CSSToken | null): x is TokenBadString; | ||
export declare function isTokenBadURL(x?: CSSToken | null): x is TokenBadURL; | ||
export declare function isTokenCDC(x?: CSSToken | null): x is TokenCDC; | ||
export declare function isTokenCDO(x?: CSSToken | null): x is TokenCDO; | ||
export declare function isTokenCloseCurly(x?: CSSToken | null): x is TokenCloseCurly; | ||
export declare function isTokenCloseParen(x?: CSSToken | null): x is TokenCloseParen; | ||
export declare function isTokenCloseSquare(x?: CSSToken | null): x is TokenCloseSquare; | ||
export declare function isTokenColon(x?: CSSToken | null): x is TokenColon; | ||
export declare function isTokenComma(x?: CSSToken | null): x is TokenComma; | ||
export declare function isTokenComment(x?: CSSToken | null): x is TokenComment; | ||
export declare function isTokenDelim(x?: CSSToken | null): x is TokenDelim; | ||
export declare function isTokenDimension(x?: CSSToken | null): x is TokenDimension; | ||
export declare function isTokenEOF(x?: CSSToken | null): x is TokenEOF; | ||
export declare function isTokenFunction(x?: CSSToken | null): x is TokenFunction; | ||
export declare function isTokenHash(x?: CSSToken | null): x is TokenHash; | ||
export declare function isTokenIdent(x?: CSSToken | null): x is TokenIdent; | ||
export declare function isTokenNumber(x?: CSSToken | null): x is TokenNumber; | ||
/** | ||
* Assert that a token is a numeric token | ||
*/ | ||
export declare function isTokenNumeric(x: CSSToken): x is NumericToken; | ||
export declare function isTokenOpenCurly(x?: CSSToken | null): x is TokenOpenCurly; | ||
export declare function isTokenOpenParen(x?: CSSToken | null): x is TokenOpenParen; | ||
export declare function isTokenOpenSquare(x?: CSSToken | null): x is TokenOpenSquare; | ||
export declare function isTokenPercentage(x?: CSSToken | null): x is TokenPercentage; | ||
export declare function isTokenSemicolon(x?: CSSToken | null): x is TokenSemicolon; | ||
export declare function isTokenString(x?: CSSToken | null): x is TokenString; | ||
export declare function isTokenUnicodeRange(x?: CSSToken | null): x is TokenUnicodeRange; | ||
export declare function isTokenURL(x?: CSSToken | null): x is TokenURL; | ||
export declare function isTokenWhitespace(x?: CSSToken | null): x is TokenWhitespace; | ||
/** | ||
* Assert that a token is a whitespace or comment token | ||
*/ | ||
export declare function isTokenWhiteSpaceOrComment(x: CSSToken): x is TokenWhitespace | TokenComment; | ||
/** | ||
* Get the mirror variant of a given token | ||
@@ -122,2 +186,8 @@ * | ||
/** | ||
* Set the unit and update the string representation. | ||
* This handles escaping. | ||
*/ | ||
export declare function mutateUnit(ident: TokenDimension, newUnit: string): void; | ||
/** | ||
* The type of number token | ||
@@ -132,2 +202,7 @@ * Either `integer` or `number` | ||
/** | ||
* The union of all possible CSS tokens that represent a numeric value | ||
*/ | ||
export declare type NumericToken = TokenDimension | TokenNumber | TokenPercentage; | ||
/** | ||
* The CSS Tokenizer is forgiving and will never throw on invalid input. | ||
@@ -134,0 +209,0 @@ * Any errors are reported through the `onParseError` callback. |
{ | ||
"name": "@csstools/css-tokenizer", | ||
"description": "Tokenize CSS", | ||
"version": "2.2.4", | ||
"version": "2.3.0", | ||
"contributors": [ | ||
@@ -6,0 +6,0 @@ { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
71041
720