Skip to content

Commit

Permalink
Merge pull request #428 from Belphemur/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
kodiakhq[bot] authored Jun 30, 2022
2 parents 5ecc0b3 + 4ee4026 commit 0bf0275
Show file tree
Hide file tree
Showing 14 changed files with 1,965 additions and 1,260 deletions.
35 changes: 35 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"contributors": [
{
"login": "davisjam",
"name": "Jamie Davis",
"avatar_url": "https://avatars.githubusercontent.com/u/22822319?v=4",
"profile": "https://davisjam.github.io/",
"contributions": [
"security"
]
},
{
"login": "sidblommerswork",
"name": "sidblommerswork",
"avatar_url": "https://avatars.githubusercontent.com/u/93680615?v=4",
"profile": "https://github.com/sidblommerswork",
"contributions": [
"code",
"test"
]
}
],
"contributorsPerLine": 7,
"projectName": "node-json-db",
"projectOwner": "Belphemur",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": false,
"commitConvention": "angular"
}
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -50,7 +50,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -64,4 +64,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
16 changes: 8 additions & 8 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ jobs:
- name: Set yarn cache
run: yarn config set cache-folder ${{env.YARN_CACHE}}
- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: yarn
with:
path: ${{env.YARN_CACHE}}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v3.0.0
uses: actions/setup-node@v3.3.0
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run tests
run: yarn test
- name: Upload code coverage
uses: codecov/codecov-action@v2.1.0
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true # optional (default = false)
deploy-pages:
Expand All @@ -49,11 +49,11 @@ jobs:
- name: Set yarn cache
run: yarn config set cache-folder ${{env.YARN_CACHE}}
- name: Setup Node.js
uses: actions/setup-node@v3.0.0
uses: actions/setup-node@v3.3.0
with:
node-version: ${{env.NODEJS}}
- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: yarn
with:
Expand All @@ -64,7 +64,7 @@ jobs:
- name: Build package
run: yarn build:doc
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.2.5
uses: JamesIves/github-pages-deploy-action@v4.3.4
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs # The folder the action should deploy.
Expand All @@ -78,11 +78,11 @@ jobs:
- name: Set yarn cache
run: yarn config set cache-folder ${{env.YARN_CACHE}}
- name: Setup Node.js
uses: actions/setup-node@v3.0.0
uses: actions/setup-node@v3.3.0
with:
node-version: ${{env.NODEJS}}
- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: yarn
with:
Expand Down
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,34 @@ db.getIndex("/arraytest/myarray", "test", "name");

// It's useful if you want to delete some object
db.delete("/arraytest/myarray[" + db.getIndex("/arraytest/myarray", 65464646155) + "]");
```

#### Nesting in Array
```javascript
// You can easily access any nested array and their object
//You can also append to nested array other array
db.push("/arraytest/myarray",
[
[
{
obj: 'test'
},
{
obj: 'hello'
}
],
[
{
obj: 'world'
}
]
]
, true);

//This will return the first object (obj: 'test')

db.getData("/arraytest/myarray[0][0]");

```
### Exception/Error
#### Type
Expand Down Expand Up @@ -269,7 +297,24 @@ db.delete("/arraytest/myarray[" + db.getIndex("/arraytest/myarray", 65464646155)
Please consider the `separator` as a reserved character by node-json-db.


# Thanks
# Contributors

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://davisjam.github.io/"><img src="https://avatars.githubusercontent.com/u/22822319?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jamie Davis</b></sub></a><br /><a href="#security-davisjam" title="Security">🛡️</a></td>
<td align="center"><a href="https://github.com/sidblommerswork"><img src="https://avatars.githubusercontent.com/u/93680615?v=4?s=100" width="100px;" alt=""/><br /><sub><b>sidblommerswork</b></sub></a><br /><a href="https://github.com/Belphemur/node-json-db/commits?author=sidblommerswork" title="Code">💻</a> <a href="https://github.com/Belphemur/node-json-db/commits?author=sidblommerswork" title="Tests">⚠️</a></td>
</tr>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

## Special Thanks

[James Davis](https://github.com/davisjam) for helping to fix a regular expression vulnerable to [catastrophic backtracking](https://docs.microsoft.com/en-us/dotnet/standard/base-types/backtracking-in-regular-expressions).

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@
"@semantic-release/git": "^10.0.0",
"@types/jest": "^27.0.0",
"@types/mkdirp": "^1.0.1",
"@types/node": "^17.0.0",
"@types/node": "^18.0.0",
"@types/safe-regex": "^1.1.2",
"cz-conventional-changelog": "^3.3.0",
"husky": "^7.0.0",
"husky": "^8.0.0",
"jest": "^27.2.0",
"last-release-git": "^0.0.3",
"safe-regex": "~2.1.1",
"semantic-release": "^19.0.2",
"travis-deploy-once": "^5.0.11",
"ts-jest": "^27.0.5",
"typedoc": "^0.22.3",
"typedoc": "^0.23.1",
"typescript": "^4.4.3",
"validate-commit-msg": "^2.14.0"
},
Expand Down
Loading

0 comments on commit 0bf0275

Please sign in to comment.