@nxtedition/deepstream.io-client-js 24.1.22 → 24.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -504,7 +504,10 @@ class RecordHandler {
|
|
|
504
504
|
|
|
505
505
|
if (
|
|
506
506
|
idx < args.length &&
|
|
507
|
-
(args[idx] == null ||
|
|
507
|
+
(args[idx] == null ||
|
|
508
|
+
typeof args[idx] === 'string' ||
|
|
509
|
+
Array.isArray(args[idx]) ||
|
|
510
|
+
typeof args[idx] === 'function')
|
|
508
511
|
) {
|
|
509
512
|
path = args[idx++]
|
|
510
513
|
}
|
package/src/record/record.js
CHANGED
|
@@ -125,7 +125,15 @@ class Record {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
get(path) {
|
|
128
|
-
|
|
128
|
+
if (!path) {
|
|
129
|
+
return this._data
|
|
130
|
+
} else if (typeof path === 'string' || Array.isArray(path)) {
|
|
131
|
+
return path ? jsonPath.get(this._data, path) : this._data
|
|
132
|
+
} else if (typeof path === 'function') {
|
|
133
|
+
return path(this._data)
|
|
134
|
+
} else {
|
|
135
|
+
throw new Error('invalid argument: path')
|
|
136
|
+
}
|
|
129
137
|
}
|
|
130
138
|
|
|
131
139
|
set(pathOrData, dataOrNil) {
|