Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support parse and stringify with comments #247

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Commits on Mar 13, 2024

  1. feat: add support to save comments

    parse(data, { preserveComments: true } )
    parse(data, { commentsKey: ‘internalComments’, preserveComments: true } )
    stringify(data, { preserveComments: true })
    stringify(data, { commentsKey: ‘internalComments’, preserveComments: true } )
    
    opt in to save comments when parsing and stringify
    save comments to internal object key upon parsing,
    add the option to save when stringifying data
    store comments internally upon parse and stringify to avoid conflicts
    when parsing and stringify multiple documents
    use platform eol
    include tests in default /test/foo.js
    lheberlie committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    3e3d9e2 View commit details
    Browse the repository at this point in the history
  2. chore: add test for preserving comments

    Test option for reading (parse) and saving (stringify) comments in
    configuration file.
    
    Test option for reading (parse) and saving (stringify) comments in
    configuration file using a custom commentsKey.
    lheberlie committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    6e2190c View commit details
    Browse the repository at this point in the history
  3. docs: add option to preserve comments

    Option for reading (parse) and saving (stringify) comments in
    configuration file.
    lheberlie committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    2e835c4 View commit details
    Browse the repository at this point in the history

Commits on Mar 14, 2024

  1. fix: simplify commentsRegEx

    '{1,}' can be simplified to '+'
    lheberlie committed Mar 14, 2024
    Configuration menu
    Copy the full SHA
    bd7f21e View commit details
    Browse the repository at this point in the history
  2. fix: code scan on commentsRegEx

    Code scanning / CodeQL
    Polynomial regular expression used on uncontrolled data
    https://codeql.github.com/codeql-query-help/javascript/js-polynomial-redos/
    lheberlie committed Mar 14, 2024
    Configuration menu
    Copy the full SHA
    77b762a View commit details
    Browse the repository at this point in the history
  3. fix: code scan on commentsRegEx

    Code scanning / CodeQL
    Polynomial regular expression used on uncontrolled data
    https://codeql.github.com/codeql-query-help/javascript/js-polynomial-redos/
    lheberlie committed Mar 14, 2024
    Configuration menu
    Copy the full SHA
    c199a7e View commit details
    Browse the repository at this point in the history
  4. fix: simplify commentsRegEx

    If line starts with comment character ; or #
    match line string and push line into line comment array
    lheberlie committed Mar 14, 2024
    Configuration menu
    Copy the full SHA
    79f6d72 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    69c7264 View commit details
    Browse the repository at this point in the history
  6. fix: remove option to specify commentsKey

    Comments will be stored using the ‘comments’ key
    Removes security vulnerability
    lheberlie committed Mar 14, 2024
    Configuration menu
    Copy the full SHA
    9c83f30 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    040639c View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2024

  1. fix: remove preserveComments from decode

    ini.js
    foo.js
    lheberlie committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    8ae5a06 View commit details
    Browse the repository at this point in the history
  2. fix: preserveComments doc

    lheberlie committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    f17c0ee View commit details
    Browse the repository at this point in the history
  3. feat: store comments data as Symbol

    parse/decode - store comments as a symbol on object
    stringify/encode - restore comments using preserveComments flag
    lheberlie committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    4213a94 View commit details
    Browse the repository at this point in the history