Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

css-tree

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-tree - npm Package Versions

1
6

1.0.0-alpha.37

Diff

Changelog

Source

1.0.0-alpha.37 (October 22, 2019)

  • Bumped source-map version to ^0.6.1 to fix source map generation inconsistency across node.js versions due to mappings sorting bug and v8 moving to a stable Array#sort (fix commit in source-map)
lahmatiy
published 1.0.0-alpha.36 •

Changelog

Source

1.0.0-alpha.36 (October 13, 2019)

  • Dropped support for Node < 8
  • Updated dev deps (fixed npm audit issues)
  • Reworked build pipeline
    • Package provides dist/csstree.js and dist/csstree.min.js now (instead of single dist/csstree.js that was a min version)
    • Bundle size (min version) reduced from 191Kb to 158Kb due to some optimisations
  • Definition syntax
    • Renamed grammar into definitionSyntax (named per spec)
    • Added compact option to generate() method to avoid formatting (spaces) when possible
  • Lexer
    • Changed dump() method to produce syntaxes in compact form by default
lahmatiy
published 1.0.0-alpha.35 •

Changelog

Source

1.0.0-alpha.35 (October 7, 2019)

  • Walker
    • Changed implementation to avoid runtime compilation due to CSP issues (see #91, #109)
    • Added find(), findLast() and findAll() methods (e.g. csstree.find(ast, node => node.type === 'ClassSelector'))
lahmatiy
published 1.0.0-alpha.34 •

Changelog

Source

1.0.0-alpha.34 (July 27, 2019)

  • Tokenizer
    • Added isBOM() function
    • Added charCodeCategory() function
    • Removed firstCharOffset() function (use isBOM() instead)
    • Removed CHARCODE dictionary
    • Removed INPUT_STREAM_CODE* dictionaries
  • Lexer
    • Allowed comments in matching value (just ignore them like whitespaces)
    • Increased iteration count in value matching from 10k up to 15k
    • Fixed missed debugger (#104)
lahmatiy
published 1.0.0-alpha.33 •

Changelog

Source

1.0.0-alpha.33 (July 11, 2019)

  • Lexer
    • Fixed low priority productions matching by changing an approach for robust one (#103)
lahmatiy
published 1.0.0-alpha.32 •

Changelog

Source

1.0.0-alpha.32 (July 11, 2019)

  • Lexer
    • Fixed low priority productions matching in long ||- and &&- groups (#103)
lahmatiy
published 1.0.0-alpha.31 •

Changelog

Source

1.0.0-alpha.31 (July 11, 2019)

  • Bumped mdn/data to 2.0.4 (#99)
  • Lexer
    • Added bracketed range notation support and related refactoring
    • Removed <number-zero-one>, <number-one-or-greater> and <positive-integer> from generic types. In fact, types moved to patch, because those types can be expressed in a regular grammar due to bracketed range notation implemented
    • Added support for multiple token string matching
    • Improved <custom-ident> production matching to claim the keyword only if no other unfulfilled production can claim it (#101)
    • Improved <length> production matching to claim "unitless zero" only if no other unfulfilled production can claim it
    • Changed lexer's constructor to prevent generic types override when used
    • Fixed large ||- and &&-group matching, matching continues from the beginning on term match (#85)
    • Fixed checking that value has var() occurrences when value is a string (such values can't be matched on syntax currently and fail with specific error that can be used for ignorance in validation tools)
    • Fixed <declaration-value> and <any-value> matching when a value contains a function, parentheses or braces
lahmatiy
published 1.0.0-alpha.30 •

Changelog

Source

1.0.0-alpha.30 (July 3, 2019)

  • Bumped mdn/data to ~2.0.3
    • Removed type removals from mdn/data due to lack of some generic types and specific lexer restictions (since lexer was reworked, see below)
    • Reduced and updated patches
  • Tokenizer
    • Reworked tokenizer itself to compliment CSS Syntax Module Level 3
    • Tokenizer class splitted into several abstractions:
      • Added TokenStream class
      • Added OffsetToLocation class
      • Added tokenize() function that creates TokenStream instance for given string or updates a TokenStream instance passed as second parameter
      • Removed Tokenizer class
    • Removed Raw token type
    • Renamed Identifier token type to Ident
    • Added token types: Hash, BadString, BadUrl, Delim, Percentage, Dimension, Colon, Semicolon, Comma, LeftSquareBracket, RightSquareBracket, LeftParenthesis, RightParenthesis, LeftCurlyBracket, RightCurlyBracket
    • Replaced Punctuator with Delim token type, that excludes specific characters with its own token type like Colon, Semicolon etc
    • Removed findCommentEnd, findStringEnd, findDecimalNumberEnd, findNumberEnd, findEscapeEnd, findIdentifierEnd and findUrlRawEnd helper function
    • Removed SYMBOL_TYPE, PUNCTUATION and STOP_URL_RAW dictionaries
    • Added isDigit, isHexDigit, isUppercaseLetter, isLowercaseLetter, isLetter, isNonAscii, isNameStart, isName, isNonPrintable, isNewline, isWhiteSpace, isValidEscape, isIdentifierStart, isNumberStart, consumeEscaped, consumeName, consumeNumber and consumeBadUrlRemnants helper functions
  • Parser
    • Changed parsing algorithms to work with new token type set
    • Changed HexColor consumption in way to relax checking a value, i.e. now value is a sequence of one or more name chars
    • Added & as a property hack
    • Relaxed var() parsing to only check that a first arguments is an identifier (not a custom property name as before)
  • Lexer
    • Reworked syntax matching to relay on token set only (having AST is optional now)
    • Extended Lexer#match(), Lexer#matchType() and Lexer#matchProperty() methods to take a string as value, beside AST as a value
    • Extended Lexer#match() method to take a string as a syntax, beside of syntax descriptor
    • Reworked generic types:
      • Removed <attr()>, <url> (moved to patch) and <progid> types
      • Added types:
        • Related to token types: <ident-token>, <function-token>, <at-keyword-token>, <hash-token>, <string-token>, <bad-string-token>, <url-token>, <bad-url-token>, <delim-token>, <number-token>, <percentage-token>, <dimension-token>, <whitespace-token>, <CDO-token>, <CDC-token>, <colon-token>, <semicolon-token>, <comma-token>, <[-token>, <]-token>, <(-token>, <)-token>, <{-token> and <}-token>
        • Complex types: <an-plus-b>, <urange>, <custom-property-name>, <declaration-value>, <any-value> and <zero>
      • Renamed <unicode-range> to <urange> as per spec
      • Renamed <expression> (IE legacy extension) to <-ms-legacy-expression> and may to be removed in next releases
lahmatiy
published 1.0.0-alpha.29 •

Changelog

Source

1.0.0-alpha.29 (May 30, 2018)

  • Lexer
    • Syntax matching was completely reworked. Now it's token-based and uses state machine. Public API has not changed. However, some internal data structures have changed. Most significal change in syntax match result tree structure, it's became token-based instead of node-based.
    • Grammar
      • Changed grammar tree format:
        • Added Token node type to represent a single code point (<delim-token>)
        • Added Multiplier that wraps a single node (term property)
        • Added AtKeyword to represent <at-keyword-token>
        • Removed Slash and Percent node types, they are replaced for a node with Token type
        • Changed Function to represent <function-token> with no children
        • Removed multiplier property from Group
      • Changed generate() method:
        • Method takes an options as second argument now (generate(node, forceBraces, decorator) -> generate(node, options)). Two options are supported: forceBraces and decorator
        • When a second parameter is a function it treats as decorate option value, i.e. generate(node, fn) -> generate(node, { decorate: fn })
        • Decorate function invokes with additional parameter – a reference to a node
  • Tokenizer
    • Renamed Atrule const to AtKeyword
lahmatiy
published 1.0.0-alpha.28 •

Changelog

Source

1.0.0-alpha.28 (February 19, 2018)

  • Renamed lexer.grammar.translate() method into generate()
  • Fixed <'-webkit-font-smoothing'> and <'-moz-osx-font-smoothing'> syntaxes (#75)
  • Added vendor keywords for <'overflow'> property syntax (#76)
  • Pinned mdn-data to ~1.1.0 and fixed issues with some updated property syntaxes
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc