mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: better blacklist
This commit is contained in:
1 parent
42f920d25c
commit
0676cc0a27
9 files changed
+21
-90
No files matched your search
@@ -57,7 +57,7 @@ const replacer = (k, v) => {
|
||||
class Nunjucks extends nunjucks.Environment {
|
||||
constructor() {
|
||||
super(new Loader(), { autoescape: true, trimBlocks: true });
|
||||
this.addFilter('json', (self) => JSON.stringify(self, replacer));
|
||||
this.addFilter('json', (self) => (self ? JSON.stringify(self, replacer) : ''));
|
||||
this.addFilter('parseYaml', (self) => yaml.load(self));
|
||||
this.addFilter('dumpYaml', (self) => yaml.dump(self));
|
||||
this.addFilter('serialize', (self, ignoreFunction = true) => serialize(self, { ignoreFunction }));
|
||||
|
||||
Reference in new issue
Block a user