Compare commits

...

5 Commits
6.3.3 ... 6.3.4

Author SHA1 Message Date
Konstantin Pogorelov
d18316fee8 bump 6.3.4 2021-02-22 15:21:48 +01:00
Konstantin Pogorelov
ccb74f99b0 add an a sample with actual RegExp in advanced-example.js, relates to #80 2021-02-22 15:15:37 +01:00
Konstantin Pogorelov
2e093bc14d fix codestyle in types to keep dtslint happy, relates to #80 2021-02-22 15:15:00 +01:00
Konstantin Pogorelov
3f6b2746b9 Merge pull request #80 from thewizarodofoz/patch-1
urlValueParser extra and replace masks can be regexp
2021-02-22 14:59:11 +01:00
Oz Weiss
83ee0ce06e urlValueParser extra and replace masks can be regexp
https://github.com/disjunction/url-value-parser/blob/master/src/ValueDetector.js#L39

`replaceMasks` and `extraMasks` which are passed down to `url-value-parser` can be either string or RegExp.
2021-02-22 10:48:58 +02:00
4 changed files with 6 additions and 5 deletions

View File

@@ -19,7 +19,8 @@ const bundle = promBundle({
urlValueParser: {
minHexLength: 5,
extraMasks: [
"^[0-9]+\\.[0-9]+\\.[0-9]+$" // replace dot-separated dates with #val
"^[0-9]+\\.[0-9]+\\.[0-9]+$", // replace dot-separated dates with #val, (regex as string)
/^[0-9]+\-[0-9]+\-[0-9]+$/ // replace dash-separated dates with #val (actual regex)
]
},
normalizePath: [

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "express-prom-bundle",
"version": "6.3.3",
"version": "6.3.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "express-prom-bundle",
"version": "6.3.3",
"version": "6.3.4",
"description": "express middleware with popular prometheus metrics in one bundle",
"main": "src/index.js",
"keywords": [

4
types/index.d.ts vendored
View File

@@ -43,8 +43,8 @@ declare namespace express_prom_bundle {
urlValueParser?: {
minHexLength?: number;
minBase64Length?: number;
replaceMasks?: string[];
extraMasks?: string[];
replaceMasks?: Array<RegExp | string>;
extraMasks?: Array<RegExp | string>;
};
}