@kravc/dos 1.9.1 → 1.9.2
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 +1 -1
- package/src/Document.js +12 -2
- package/src/Document.spec.js +3 -0
package/package.json
CHANGED
package/src/Document.js
CHANGED
|
@@ -150,8 +150,18 @@ class Document extends Component {
|
|
|
150
150
|
return { objects, ...rest }
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
static
|
|
154
|
-
|
|
153
|
+
static async indexAll(context, query, options) {
|
|
154
|
+
return this.index(context, query, options)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
static _index(query) {
|
|
158
|
+
const filter = item =>
|
|
159
|
+
Object.keys(query).every(key => item[key] === query[key])
|
|
160
|
+
|
|
161
|
+
const items = Object
|
|
162
|
+
.values(STORE[this.name] || {})
|
|
163
|
+
.filter(filter)
|
|
164
|
+
.map(cloneDeep)
|
|
155
165
|
|
|
156
166
|
return { items, count: items.length }
|
|
157
167
|
}
|
package/src/Document.spec.js
CHANGED