@holz/pattern-filter 0.8.3-rc.154 → 0.8.3-rc.155

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.
@@ -1,24 +1,27 @@
1
- import { LogProcessor } from '@holz/core';
2
- /**
3
- * Only forwards logs who's origin matches the given pattern. It works the
4
- * same as the popular `debug` module.
5
- *
6
- * Patterns allow wildcards and negation. For example, the pattern `my-app*`
7
- * will match all logs with the origin `my-app` or `my-app:foo` or
8
- * `my-app:foo:bar`. The pattern `*, -my-app` will match all logs except those
9
- * with the origin `my-app`.
10
- *
11
- * @example
12
- * createPatternFilter({
13
- * pattern: 'my-app*, -spammy:library',
14
- * processor: backend,
15
- * })
16
- */
17
- export declare const createPatternFilter: ({ processor, pattern, }: Config) => LogProcessor;
18
- interface Config {
19
- /** A set of patterns to test against `log.origin`. */
20
- pattern: string;
21
- /** Where to send logs if they pass the filter. */
22
- processor: LogProcessor;
23
- }
24
- export {};
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 const createPatternFilter: ({ processor, pattern, }: Config) => LogProcessor;
26
+
27
+ export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holz/pattern-filter",
3
- "version": "0.8.3-rc.154+3f5148e",
3
+ "version": "0.8.3-rc.155+ca9302f",
4
4
  "description": "Only print log messages that match a pattern",
5
5
  "type": "module",
6
6
  "repository": {
@@ -40,7 +40,8 @@
40
40
  "@holz/core": "^0.8.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@holz/core": "^0.8.3-rc.154+3f5148e",
43
+ "@holz/core": "^0.8.3-rc.155+ca9302f",
44
+ "@microsoft/api-extractor": "^7.58.8",
44
45
  "@vitest/coverage-v8": "^4.0.0",
45
46
  "typescript": "^6.0.0",
46
47
  "vite": "^8.0.0",
@@ -48,5 +49,5 @@
48
49
  "vite-tsconfig-paths": "^6.0.0",
49
50
  "vitest": "^4.0.0"
50
51
  },
51
- "gitHead": "3f5148eb94bb1d7200d4b4993c95ea30db76b0c4"
52
+ "gitHead": "ca9302f8b1709bb57058eb0dc73af0ed2021ddfd"
52
53
  }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export { createPatternFilter } from './pattern-filter';
@@ -1,16 +0,0 @@
1
- /**
2
- * Parse a string of multiple patterns into a set of regular expressions. We
3
- * use a pattern string (instead of regexes) because it's easier to persist in
4
- * storage or specify through a CLI.
5
- *
6
- * Special thanks to `debug-js` for the inspiration. I read their code as
7
- * a guide for this implementation.
8
- */
9
- export declare const parse: (input: string) => PatternFilters;
10
- /** Detect if a string matches a set of patterns. */
11
- export declare const matches: (filters: PatternFilters, input: string) => boolean;
12
- interface PatternFilters {
13
- include: Array<RegExp>;
14
- exclude: Array<RegExp>;
15
- }
16
- export {};