Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: improve custom filters readability with optional chaining #1275

Merged
Prev Previous commit
Next Next commit
Update suggestions for apps/nunjucks-filters/src/customFilters.js
change the file to the suggestions

Co-authored-by: Lukasz Gornicki <lpgornicki@gmail.com>
  • Loading branch information
ManikantaMandala and derberg authored Oct 7, 2024
commit d4a610a92ec7edc26c8e9536e7f9b5621d082a18
2 changes: 1 addition & 1 deletion apps/nunjucks-filters/src/customFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function docline(field, fieldName, scopePropName) {
const getType = (f) => f.type() ? f.type() : 'string';
const getDescription = (f) => f.description() ? ` - ${f.description().replace(/\r?\n|\r/g, '')}` : '';
const getDefault = (f, type) => (f.default() && type === 'string') ? `'${f.default()}'` : f.default();
const getPName = (pName) => pName ? `${pName}.` : ``;
const getPName = (pName) => pName ? `${pName}.` : '';

const buildLine = (f, fName, pName) => {
const type = getType(f);
Expand Down
Loading