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

[Snyk] Upgrade lowdb from 0.14.0 to 7.0.1 #4

Merged

Conversation

YoutacRandS-VA
Copy link
Owner

This PR was automatically created by Snyk using the credentials of a real user.


![snyk-top-banner](https://github.com/andygongea/OWASP-Benchmark/assets/818805/c518c423-16fe-447e-b67f-ad5a49b5d123)

Snyk has created this PR to upgrade lowdb from 0.14.0 to 7.0.1.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


⚠️ Warning: This PR contains major version upgrade(s), and may be a breaking change.

  • The recommended version is 33 versions ahead of your current version.

  • The recommended version was released on 6 months ago.

Release notes
Package name: lowdb
  • 7.0.1 - 2023-12-26

    7.0.1

  • 7.0.0 - 2023-12-26

    🚀 Simplified syntax with db.update, new adapter for more file format, consistent presets, automatic write error retry, and a TS error fix!

    What's New

    • Simplified Syntax: Introducing db.update for easier updates and writes.
    • Flexible Adapters: Added DataFile adapters for supporting various formats like YAML , JSON5, ... and adding features like encryption with minimal code.
    • Automatic Retry: Resolves write errors, especially for Windows users.

    Breaking Changes

    • Node 16 Dropped: discontinued support for Node 16.
    • Consistent Naming: Renamed presets for consistency:
      • JSONPreset to JSONFilePreset
      • JSONSyncPreset to JSONFileSyncPreset.

    Code Examples

    If you were using the JSONPreset, please rename it

    - import { JSONPreset } from 'lowdb/node'
    + import { JSONFilePreset } from 'lowdb/node'

    Enjoy the simplified syntax with db.update

    - db.data.posts.push(newPost)
    - await db.write()
    + await db.update(({ posts }) => posts.push(newPost))

    Easily support other formats:

    const yamlAdapter = new DataFile('db.yaml', {
      parse: YAML.parse,
      stringify: YAML.stringify
    })
    const db = new Low(yamlAdapter, { posts: [] })

    Sponsors

    Special thanks to lowdb's current sponsor: Mockend.

    Your support is essential, you can sponsor this project on GitHub Sponsors ❤️

  • 6.1.1 - 2023-10-23
    • Fix JSONPreset and JSONSyncPreset
  • 6.1.0 - 2023-10-14

    New presets

    Before

    import { Low } from 'lowdb'
    import { JSONFile } from 'lowdb/node'

    const adapter = new JSONFile(file)
    const defaultData = { posts: [] }
    const db = new Low(adapter, defaultData)

    await db.read()

    Now

    import { JSONPreset } from 'lowdb/node'

    const defaultData = { posts: [] }
    const db = await JSONPreset('db.json', defaultData)

    This will also use the Memory adapter automatically when NODE_ENV=test making tests faster.

    TypeScript

    Lowdb now supports the broader fs.PathLike type which lets you use URL type in addition to string. This is useful for ESM.

    // Read from 'db.json' relatively to the current module path using URL
    JSONPreset(new URL('db.json', import.meta.url), defaultData)
  • 6.0.1 - 2023-04-28

    What's Changed

    • fix: imported subpaths types correctly by @ Krak798 in #569

    New Contributors

    • @ Krak798 made their first contribution in #569

    Full Changelog: v6.0.0...v6.0.1

  • 6.0.0 - 2023-04-19

    What's Changed

    • Drop Node 14 support
    • Require defaultData parameter for Low and LowSync constructors to improve TypeScript experience
    • Move examples from Markdown to real TypeScript files

    How to upgrade:

    // v5
    const defaultData = { posts: [] }
    const db = new Low(adapter)
    db.data ||= defaultData

    function add() {
    db.data.posts.push('title') // TS error
    }

    // v6
    const defaultData = { posts: [] }
    const db = new Low(adapter, defaultData)

    function add() {
    db.data.posts.push('title') // No TS error
    }

    If you like lowdb, please sponsor my work. If you cannot, a star or tweet is always appreciated.
    Thank you!

  • 5.1.0 - 2023-02-02

    What's Changed

    New Contributors

    Full Changelog: v5.0.4...v5.1.0

  • 5.0.5 - 2022-10-23

    5.0.4

  • 5.0.3 - 2022-10-22

    5.0.3

  • 5.0.2 - 2022-10-22
  • 5.0.1 - 2022-10-22
  • 5.0.0 - 2022-10-22
  • 4.0.1 - 2022-10-21
  • 4.0.0 - 2022-10-17
  • 3.0.0 - 2021-09-13
  • 2.1.0 - 2021-05-24
  • 2.0.3 - 2021-05-21
  • 2.0.2 - 2021-05-21
  • 2.0.1 - 2021-05-20
  • 2.0.0 - 2021-05-20
  • 1.0.0 - 2017-08-31
  • 0.17.2 - 2017-08-23
  • 0.17.1 - 2017-08-20
  • 0.17.0 - 2017-08-20
  • 0.16.2 - 2017-04-09
  • 0.16.1 - 2017-04-09
  • 0.16.0 - 2017-03-09
  • 0.15.5 - 2017-02-15
  • 0.15.4 - 2017-02-08
  • 0.15.3 - 2017-02-08
  • 0.15.2 - 2017-02-08
  • 0.15.1 - 2017-02-07
  • 0.15.0 - 2017-02-07
  • 0.14.0 - 2016-10-25
from lowdb GitHub release notes

Important

  • Warning: This PR contains a major version upgrade, and may be a breaking change.
  • Check the changes in this PR to ensure they won't cause issues with your project.
  • This PR was automatically created by Snyk using the credentials of a real user.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

For more information:

Snyk has created this PR to upgrade lowdb from 0.14.0 to 7.0.1.

See this package in npm:
lowdb

See this project in Snyk:
https://app.snyk.io/org/youtacrands-va/project/b10d0171-0ec4-4c2b-b616-f514bc2f1a93?utm_source=github&utm_medium=referral&page=upgrade-pr
@YoutacRandS-VA YoutacRandS-VA merged commit 8f086c1 into master Sep 27, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants