@graffy/logger 0.19.0 → 0.19.1-alpha.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.
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export default function (): (store: any) => void;
package/index.js ADDED
@@ -0,0 +1,16 @@
1
+ export default function () {
2
+ return (store) => {
3
+ store.on('read', (query, options, next) => {
4
+ console.log('Read', query, options);
5
+ return next(query);
6
+ });
7
+ store.on('write', (change, options, next) => {
8
+ console.log('Write', change, options);
9
+ return next(change);
10
+ });
11
+ store.on('watch', (query, options, next) => {
12
+ console.log('Watch', query, options);
13
+ return next(query);
14
+ });
15
+ };
16
+ }
package/package.json CHANGED
@@ -2,14 +2,19 @@
2
2
  "name": "@graffy/logger",
3
3
  "description": "Graffy module providing operation logging.",
4
4
  "author": "aravind (https://github.com/aravindet)",
5
- "version": "0.19.0",
6
- "main": "./index.cjs",
5
+ "version": "0.19.1-alpha.1",
6
+ "main": "./cjs/index.js",
7
7
  "exports": {
8
- "import": "./index.mjs",
9
- "require": "./index.cjs"
8
+ ".": {
9
+ "import": "./index.js",
10
+ "types": "./index.d.ts"
11
+ },
12
+ "./*": {
13
+ "import": "./*.js",
14
+ "types": "./*.d.ts"
15
+ }
10
16
  },
11
- "module": "./index.mjs",
12
- "types": "./types/index.d.ts",
17
+ "types": "./index.d.ts",
13
18
  "repository": {
14
19
  "type": "git",
15
20
  "url": "git+https://github.com/usegraffy/graffy.git"
package/index.cjs DELETED
@@ -1,18 +0,0 @@
1
- "use strict";
2
- function index() {
3
- return (store) => {
4
- store.on("read", (query, options, next) => {
5
- console.log("Read", query, options);
6
- return next(query);
7
- });
8
- store.on("write", (change, options, next) => {
9
- console.log("Write", change, options);
10
- return next(change);
11
- });
12
- store.on("watch", (query, options, next) => {
13
- console.log("Watch", query, options);
14
- return next(query);
15
- });
16
- };
17
- }
18
- module.exports = index;
package/index.mjs DELETED
@@ -1,19 +0,0 @@
1
- function index() {
2
- return (store) => {
3
- store.on("read", (query, options, next) => {
4
- console.log("Read", query, options);
5
- return next(query);
6
- });
7
- store.on("write", (change, options, next) => {
8
- console.log("Write", change, options);
9
- return next(change);
10
- });
11
- store.on("watch", (query, options, next) => {
12
- console.log("Watch", query, options);
13
- return next(query);
14
- });
15
- };
16
- }
17
- export {
18
- index as default
19
- };
package/types/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export default function _default(): (store: any) => void;