Skip to content

Commit

Permalink
fix: fixed unthrown template exception issue
Browse files Browse the repository at this point in the history
  • Loading branch information
BlvckBytes committed Nov 7, 2021
1 parent b6a059b commit 45e3ce2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ctor-ensure",
"author": "BlvckBytes",
"version": "1.0.10",
"version": "1.0.11",
"license": "GPL-3.0",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/description-template.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import UnknownLanguageException from './unknown-language.exception';
import { pluralize, strOpt, ternaryString } from './util';

// Helper formatter to get the full env key from a template name
export const key = (name: string, lang = ''): string => `CTOR_ENSURE_${name.toUpperCase()}${strOpt(lang, lang !== '')}_DESC`;
export const key = (name: string, lang = ''): string => `CTOR_ENSURE_${name.toUpperCase()}${strOpt(`--${lang}`, lang !== '')}_DESC`;

// A template function is a function that takes any
// number of arguments and returns a string
Expand Down
4 changes: 1 addition & 3 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ export const evalDesc = (input: (() => string) | string | TemplateParameters, te
// Template
if (typeof input === 'object')
return template(
// Append language suffix if provided
`${input.name}${strOpt(`--${templateLang}`, templateLang !== '')}`,
input.vars, input.funcs,
input.name, input.vars, input.funcs, templateLang,
);

// Immediate value
Expand Down

0 comments on commit 45e3ce2

Please sign in to comment.