nunjucks: override default dump filter to allow circular dependencies
This commit is contained in:
parent
21b7def9e4
commit
b179afdaf5
@ -6,6 +6,7 @@ import Controller from "../Controller";
|
|||||||
import {ServerError} from "../HttpError";
|
import {ServerError} from "../HttpError";
|
||||||
import * as querystring from "querystring";
|
import * as querystring from "querystring";
|
||||||
import {ParsedUrlQueryInput} from "querystring";
|
import {ParsedUrlQueryInput} from "querystring";
|
||||||
|
import * as util from "util";
|
||||||
|
|
||||||
export default class NunjucksComponent extends ApplicationComponent<void> {
|
export default class NunjucksComponent extends ApplicationComponent<void> {
|
||||||
public static getPreviousURL(req: Request, defaultUrl?: string): string {
|
public static getPreviousURL(req: Request, defaultUrl?: string): string {
|
||||||
@ -52,6 +53,9 @@ export default class NunjucksComponent extends ApplicationComponent<void> {
|
|||||||
.addGlobal('app_version', this.app!.getVersion())
|
.addGlobal('app_version', this.app!.getVersion())
|
||||||
.addGlobal('core_version', coreVersion)
|
.addGlobal('core_version', coreVersion)
|
||||||
.addGlobal('querystring', querystring)
|
.addGlobal('querystring', querystring)
|
||||||
|
.addFilter('dump', (val) => {
|
||||||
|
return util.inspect(val);
|
||||||
|
})
|
||||||
.addFilter('hex', (v: number) => {
|
.addFilter('hex', (v: number) => {
|
||||||
return v.toString(16);
|
return v.toString(16);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user