Skip to content

Commit

Permalink
CPMKeyValueStore fixed removeKey
Browse files Browse the repository at this point in the history
  • Loading branch information
randilfernando committed Apr 1, 2024
1 parent ea1c783 commit 920a82b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudimpl-inc/cpm",
"version": "2.33.5",
"version": "2.33.6",
"description": "CloudImpl Project Manager",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down
4 changes: 3 additions & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ export const addMapKey = (map: any, key: string[], value: any): void => {

export const removeMapKey = (map: any, key: string[]): void => {
if (key.length == 1) {
delete map[key[0]];
if (map.hasOwnProperty(key[0])) {
delete map[key[0]];
}
} else if (map) {
const m = map[key[0]];
key.shift();
Expand Down

0 comments on commit 920a82b

Please sign in to comment.