weavedb-node-client 0.19.4 → 0.20.1

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.
Files changed (2) hide show
  1. package/index.js +10 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -89,12 +89,19 @@ class SDK extends Base {
89
89
  async write(func, query, nocache, bundle, relay = false) {
90
90
  if (!includes(func)(this.reads)) {
91
91
  if (relay) return query
92
- nocache = !nocache
92
+ if (is(Boolean, nocache)) {
93
+ nocache = !nocache
94
+ } else if (is(Object, nocache)) {
95
+ query.dryWrite = nocache
96
+ nocache = false
97
+ query ||= {}
98
+ }
99
+ } else {
100
+ query ||= []
93
101
  }
94
- let params = query || []
95
102
  const request = {
96
103
  method: `${func}@${this.contractTxId}`,
97
- query: JSON.stringify(params),
104
+ query: JSON.stringify(query),
98
105
  nocache,
99
106
  }
100
107
  const _query = () =>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weavedb-node-client",
3
- "version": "0.19.4",
3
+ "version": "0.20.1",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "engines": {