Skip to content

Commit 6327a73

Browse files
author
Christoffer Haglund
committed
Address review comments.
1 parent da006dc commit 6327a73

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "object-basin",
3-
"version": "2.1.0",
3+
"version": "2.2.0",
44
"description": "JavaScript/TypeScript library to stream updates to an object.",
55
"license": "MIT",
66
"repository": {

js/src/index.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,11 @@ export class Basin<T> {
102102
}
103103

104104
if (!cursor.jsonPath!.startsWith('$')) {
105-
cursor.jsonPath = '$.' + cursor.jsonPath
105+
cursor.jsonPath = '$.' + cursor.jsonPath
106106
}
107107

108108
const pathArray = JSONPath.toPathArray(cursor.jsonPath!)
109-
for (const segment of pathArray) {
110-
if (segment !== '$') {
111-
this._keys.set(label, segment)
112-
break
113-
}
114-
}
109+
this._keys.set(label, pathArray[1])
115110
}
116111

117112
/**

0 commit comments

Comments
 (0)