corebasic 1.0.147 → 1.0.148

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/libs/dip.js +13 -0
  2. package/package.json +1 -1
package/libs/dip.js CHANGED
@@ -55,6 +55,19 @@ export const IdempotentDip = () => {
55
55
  }
56
56
 
57
57
 
58
+ export const idip = async (message, callback, cleanup) => {
59
+ let IDip = await IdempotentDip().new(message.meta, message.txn)
60
+ if (!IDip) {
61
+ IDip = IdempotentDip().new(message.meta, message.txn, {blank: true})
62
+ await cleanup(IDip)
63
+ return
64
+ }
65
+ await callback(IDip)
66
+ await IDip.finish()
67
+ await cleanup(IDip)
68
+ }
69
+
70
+
58
71
  export const insertKeys = message => {
59
72
  return {"created": message.date, "updated": message.date, "createdBy": message.user, "updatedBy": message.user}
60
73
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "corebasic",
3
3
  "type": "module",
4
- "version": "1.0.147",
4
+ "version": "1.0.148",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {