@australiangreens/ag-internal-components 0.1.10 → 0.1.11

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,20 @@
1
+ type SupressionFilter = RegExp | ((...data: unknown[]) => boolean);
2
+ type ConsoleFn = 'log' | 'error' | 'warn' | 'info' | 'debug';
3
+ /**
4
+ * If called, will replace the underlying console function with a wrapper that
5
+ * will prevent the original from being called if a filter matches. A filter can
6
+ * either be a regex or a function that returns true on a match.
7
+ *
8
+ * Motivation: Originally implemented to provide a way to supress the harmless
9
+ * MUI warnings generated by SingleAutocomplete component
10
+ */
11
+ export declare function supressConsole(fn: ConsoleFn, filters: SupressionFilter[]): void;
12
+ /**
13
+ * Reset console[fn] to original. If fn is not specified, resets all functions
14
+ * (log, error, warn, info, debug)
15
+ *
16
+ * NOTE: Unsure if this will work in most cases
17
+ */
18
+ export declare function unsupressConsole(fn?: ConsoleFn): void;
19
+ export {};
20
+ //# sourceMappingURL=consoleSupression.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consoleSupression.d.ts","sourceRoot":"","sources":["../../src/utils/consoleSupression.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,GAAG,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,CAAC;AAEnE,KAAK,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAW7D;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAiBxE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,CAAC,EAAE,SAAS,QAQ9C"}
@@ -1,2 +1,3 @@
1
+ export * from './consoleSupression';
1
2
  export * from './simpleHashCode';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@australiangreens/ag-internal-components",
3
3
  "private": false,
4
- "version": "0.1.10",
4
+ "version": "0.1.11",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/australiangreens/ag-internal-components#readme",
7
7
  "license": "MIT",