@rh-support/utils 1.0.6 → 1.0.7
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/lib/cjs/insightRuleInfoUtils.d.ts +1 -1
- package/lib/cjs/insightRuleInfoUtils.d.ts.map +1 -1
- package/lib/cjs/insightRuleInfoUtils.js +8 -2
- package/lib/esm/insightRuleInfoUtils.d.ts +1 -1
- package/lib/esm/insightRuleInfoUtils.d.ts.map +1 -1
- package/lib/esm/insightRuleInfoUtils.js +8 -2
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Details } from '@cee-eng/hydrajs/@types/models/insights';
|
|
2
2
|
export declare function getRuleReasonHtml(ruleReason: string, reportDetails: Details): string;
|
|
3
|
-
export declare function parseDotTemplate(dotString: string, reportDetails: Details):
|
|
3
|
+
export declare function parseDotTemplate(dotString: string, reportDetails: Details): string;
|
|
4
4
|
//# sourceMappingURL=insightRuleInfoUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insightRuleInfoUtils.d.ts","sourceRoot":"","sources":["../../src/insightRuleInfoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AASlE,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,UAI3E;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"insightRuleInfoUtils.d.ts","sourceRoot":"","sources":["../../src/insightRuleInfoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AASlE,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,UAI3E;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,UASzE"}
|
|
@@ -18,8 +18,14 @@ function getRuleReasonHtml(ruleReason, reportDetails) {
|
|
|
18
18
|
}
|
|
19
19
|
exports.getRuleReasonHtml = getRuleReasonHtml;
|
|
20
20
|
function parseDotTemplate(dotString, reportDetails) {
|
|
21
|
-
var
|
|
22
|
-
|
|
21
|
+
var parsedDotString = '';
|
|
22
|
+
try {
|
|
23
|
+
var tempFn = doT_1.default.template(dotString);
|
|
24
|
+
parsedDotString = tempFn(reportDetails);
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
parsedDotString = '';
|
|
28
|
+
}
|
|
23
29
|
return parsedDotString;
|
|
24
30
|
}
|
|
25
31
|
exports.parseDotTemplate = parseDotTemplate;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Details } from '@cee-eng/hydrajs/@types/models/insights';
|
|
2
2
|
export declare function getRuleReasonHtml(ruleReason: string, reportDetails: Details): string;
|
|
3
|
-
export declare function parseDotTemplate(dotString: string, reportDetails: Details):
|
|
3
|
+
export declare function parseDotTemplate(dotString: string, reportDetails: Details): string;
|
|
4
4
|
//# sourceMappingURL=insightRuleInfoUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insightRuleInfoUtils.d.ts","sourceRoot":"","sources":["../../src/insightRuleInfoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AASlE,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,UAI3E;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"insightRuleInfoUtils.d.ts","sourceRoot":"","sources":["../../src/insightRuleInfoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AASlE,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,UAI3E;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,UASzE"}
|
|
@@ -11,7 +11,13 @@ export function getRuleReasonHtml(ruleReason, reportDetails) {
|
|
|
11
11
|
return html;
|
|
12
12
|
}
|
|
13
13
|
export function parseDotTemplate(dotString, reportDetails) {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
let parsedDotString = '';
|
|
15
|
+
try {
|
|
16
|
+
const tempFn = doT.template(dotString);
|
|
17
|
+
parsedDotString = tempFn(reportDetails);
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
parsedDotString = '';
|
|
21
|
+
}
|
|
16
22
|
return parsedDotString;
|
|
17
23
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "> TODO: description ",
|
|
5
5
|
"author": "Vikas Rathee <vrathee@redhat.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"@types/react-dom": "^17.0.9",
|
|
86
86
|
"moment-timezone": "^0.5.32"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "30ff95d969e84721b15571f7dd99a617db8956f8"
|
|
89
89
|
}
|