Skip to content

Commit 72d6218

Browse files
committed
fix(): handle combination of strict and no-with
1 parent 4d51fb1 commit 72d6218

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

bin/cli.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ function run() {
148148
vals[p] = envVars[p];
149149
}
150150

151+
// strict implies no-with
152+
if (argv['strict']) {
153+
argv['no-with'] = true;
154+
}
155+
151156
let opts = {
152157
filename: path.resolve(process.cwd(), templatePath),
153158
rmWhitespace: argv['rm-whitespace'],
@@ -157,13 +162,8 @@ function run() {
157162
delimiter: argv['delimiter'],
158163
openDelimiter: argv['open-delimiter'],
159164
closeDelimiter: argv['close-delimiter'],
165+
_with: !argv['no-with'],
160166
};
161-
if (opts['strict']) {
162-
opts.noWith = true;
163-
}
164-
if (argv['no-with']) {
165-
opts._with = false;
166-
}
167167

168168
let template = fs.readFileSync(opts.filename).toString();
169169
let output = ejs.render(template, vals, opts);

0 commit comments

Comments
 (0)