Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@johanneslumpe/css-value-declaration-grammer-lexer
Advanced tools
A lexer for css value declaration grammar
Lexer for value declarations found at https://github.com/mdn/data/. It currently implements a subset of instructions, not the full spec.
As of now it supports:
|
, ||
,
, &&
)+
, *
, ?
, !
, #
, {}
),
, /
)npm i @johanneslumpe/css-value-declaration-grammer-lexer
Below is a basic example of how to use the lexer:
import { lexValueDeclarationGrammar, formatTokens } from '@johanneslumpe/css-value-declaration-grammer-lexer';
const lexer = lexValueDeclarationGrammar(
'hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )',
);
// `formatToken` will return a pretty-printed version of the emitted tokens
// which is useful for easy inspection of the token result
console.log(formatTokens(lexer.emittedTokens));
// the above will log:
//
// hsl( FUNCTION (FUNCTION_START)
// <hue> DATA_TYPE (BASIC)
// COMBINATOR (JUXTAPOSITION)
// <percentage> DATA_TYPE (BASIC)
// COMBINATOR (JUXTAPOSITION)
// <percentage> DATA_TYPE (BASIC)
// COMBINATOR (JUXTAPOSITION)
// [ GROUP (GROUP_START)
// / LITERAL
// COMBINATOR (JUXTAPOSITION)
// <alpha-value> DATA_TYPE (BASIC)
// ] GROUP (GROUP_END)
// ? MULTIPLIER (QUESTION_MARK)
// ) FUNCTION (FUNCTION_END)
// | COMBINATOR (SINGLE_BAR)
// hsl( FUNCTION (FUNCTION_START)
// <hue> DATA_TYPE (BASIC)
// , LITERAL
// COMBINATOR (JUXTAPOSITION)
// <percentage> DATA_TYPE (BASIC)
// , LITERAL
// COMBINATOR (JUXTAPOSITION)
// <percentage> DATA_TYPE (BASIC)
// , LITERAL
// COMBINATOR (JUXTAPOSITION)
// <alpha-value> DATA_TYPE (BASIC)
// ? MULTIPLIER (QUESTION_MARK)
// ) FUNCTION (FUNCTION_END)
Typedocs can be found in the docs folder
FAQs
A lexer for css value declaration grammar
We found that @johanneslumpe/css-value-declaration-grammer-lexer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.