hide-a-bed 5.1.3 → 5.1.4

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/README.md CHANGED
@@ -40,9 +40,23 @@ A convience method to bind the config, so you dont need to pass it in.
40
40
  ```
41
41
  import { bindConfig } from 'hide-a-bed'
42
42
  const db = bindConfig(process.env)
43
+ const services = { db } // see example below
43
44
  const doc = await db.get('doc-123')
44
45
  ```
45
46
 
47
+ If you need to force autocompletion/type-checking, you can add the following jsdoc to help your editor
48
+
49
+ ```
50
+ function doSomething (services)
51
+ /** @type { import('hide-a-bed/index.mjs').DB} db */
52
+ const db = services.db;
53
+ ```
54
+
55
+ Here is an example of compiler warnings:
56
+
57
+ ![jsdoc type def](docs/compiler.png)
58
+
59
+
46
60
  ##### Config Overrides
47
61
 
48
62
  You also can quickly change one (or more) config settings for a particular call with the db.config(options)
Binary file
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "hide-a-bed",
3
- "version": "5.1.3",
3
+ "version": "5.1.4",
4
4
  "description": "An abstraction over couchdb calls that includes easy mock/stubs with pouchdb",
5
5
  "module": "index.mjs",
6
6
  "main": "cjs/index.cjs",
7
7
  "type": "module",
8
+ "types": "index.d.mts",
8
9
  "exports": {
9
10
  "require": "./cjs/index.cjs",
10
11
  "import": "./index.mjs",
@@ -57,4 +58,4 @@
57
58
  "node": "20.17.0",
58
59
  "npm": "10.8.2"
59
60
  }
60
- }
61
+ }