mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
fix(ejs): add missing options property (#42422)
* fix(ejs): add missing options property - `outputFunctionName` configuration option - test updated Thanks! * Update types/ejs/index.d.ts Resolve PR comments Co-Authored-By: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> * Update types/ejs/index.d.ts Resolve PR comments Co-Authored-By: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> * Update types/ejs/index.d.ts Resolve PR comments Co-Authored-By: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> * Update authors as per PR comment Co-authored-by: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>
This commit is contained in:
parent
21df3e7084
commit
039151ba67
4
types/ejs/index.d.ts
vendored
4
types/ejs/index.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
// Project: http://ejs.co/, https://github.com/mde/ejs
|
||||
// Definitions by: Ben Liddicott <https://github.com/benliddicott>
|
||||
// ExE Boss <https://github.com/ExE-Boss>
|
||||
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
@ -415,6 +416,9 @@ export interface Options {
|
||||
* @default ejs.localsName
|
||||
*/
|
||||
localsName?: string;
|
||||
|
||||
/** Set to a string (e.g., 'echo' or 'print') for a function to print output inside scriptlet tags. */
|
||||
outputFunctionName?: string;
|
||||
}
|
||||
|
||||
export interface Cache {
|
||||
|
||||
@ -24,6 +24,7 @@ const SimpleCallback = (err: any, html: string) => {
|
||||
result = ejs.render(template);
|
||||
result = ejs.render(template, data);
|
||||
result = ejs.render(template, data, options);
|
||||
ejs.render('<% echo(\'foo\'); %>', {}, { outputFunctionName: 'echo' });
|
||||
|
||||
result = ejs.renderFile(fileName, SimpleCallback);
|
||||
result = ejs.renderFile(fileName, data, SimpleCallback);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user