@holz/pattern-filter 0.6.1 → 0.7.0-rc.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.
@@ -0,0 +1,27 @@
1
+ import { LogProcessor } from '@holz/core';
2
+
3
+ declare interface Config {
4
+ /** A set of patterns to test against `log.origin`. */
5
+ pattern: string;
6
+ /** Where to send logs if they pass the filter. */
7
+ processor: LogProcessor;
8
+ }
9
+
10
+ /**
11
+ * Only forwards logs who's origin matches the given pattern. It works the
12
+ * same as the popular `debug` module.
13
+ *
14
+ * Patterns allow wildcards and negation. For example, the pattern `my-app*`
15
+ * will match all logs with the origin `my-app` or `my-app:foo` or
16
+ * `my-app:foo:bar`. The pattern `*, -my-app` will match all logs except those
17
+ * with the origin `my-app`.
18
+ *
19
+ * @example
20
+ * createPatternFilter({
21
+ * pattern: 'my-app*, -spammy:library',
22
+ * processor: backend,
23
+ * })
24
+ */
25
+ export declare function createPatternFilter({ processor, pattern, }: Config): LogProcessor;
26
+
27
+ export { }
package/package.json CHANGED
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "name": "@holz/pattern-filter",
3
- "version": "0.6.1",
3
+ "version": "0.7.0-rc.1",
4
4
  "description": "Only print log messages that match a pattern",
5
5
  "type": "module",
6
- "main": "./dist/holz-pattern-filter.cjs",
7
- "module": "./dist/holz-pattern-filter.js",
8
- "types": "./src/index.ts",
9
6
  "repository": {
10
7
  "type": "git",
11
8
  "url": "https://github.com/PsychoLlama/holz",
@@ -13,6 +10,7 @@
13
10
  },
14
11
  "exports": {
15
12
  ".": {
13
+ "types": "./dist/holz-pattern-filter.d.ts",
16
14
  "require": "./dist/holz-pattern-filter.cjs",
17
15
  "import": "./dist/holz-pattern-filter.js"
18
16
  }
@@ -40,13 +38,16 @@
40
38
  "test:types": "tsc"
41
39
  },
42
40
  "peerDependencies": {
43
- "@holz/core": "0.6.0"
41
+ "@holz/core": "0.7.0-rc.1"
44
42
  },
45
43
  "devDependencies": {
46
- "@holz/core": "^0.6.0",
47
- "@vitest/coverage-v8": "^0.33.0",
44
+ "@holz/core": "^0.7.0-rc.1",
45
+ "@vitest/coverage-v8": "^3.0.8",
48
46
  "typescript": "^5.0.0",
49
- "vite": "^4.0.0",
50
- "vitest": "^0.33.0"
51
- }
47
+ "vite": "^6.0.0",
48
+ "vite-plugin-dts": "^4.5.3",
49
+ "vite-tsconfig-paths": "^5.1.4",
50
+ "vitest": "^3.0.8"
51
+ },
52
+ "stableVersion": "0.6.1"
52
53
  }