Skip to content

Commit

Permalink
fix: invalid regular expressions (#104)
Browse files Browse the repository at this point in the history
Co-authored-by: chulanovskyi-bs <56116665+chulanovskyi-bs@users.noreply.github.com>
  • Loading branch information
AlikRakhmonov and chulanovskyi-bs authored Jul 16, 2024
1 parent dd51fde commit ff3bec4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion forward_engineering/helpers/commentIfDeactivated.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const BEFORE_DEACTIVATED_STATEMENT = '-- ';
const REG_FOR_MULTYLINE_COMMENT = /(\n\/\*\n[\s\S]*?\n\s\*\/\n)$|(\n\/\*\n[\s\S]*?\n\s\*\/)$/gi;
const REG_FOR_MULTYLINE_COMMENT = /(\n\/\*\n[\s\S]*?\n\s\*\/\n)|((\n\/\*\n[\s\S]*?\n\s\*\/)$)/gi;

const commentIfDeactivated = (statement, data, isPartOfLine) => {
if (data?.hasOwnProperty('isActivated') && !data.isActivated) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ const handleDefault = (typeObject, value) => {

const validValue = {
numeric: Number(value.replace(/(^\(\()|(\)\)$)/g, '')),
char: value.replace(/(^\(')$|('\))$/g, ''),
xml: value.replace(/(^\(N')$|('\))$/g, ''),
char: value.replace(/(^\(')|(('\))$)/g, ''),
xml: value.replace(/(^\(N')|(('\))$)/g, ''),
}[typeObject.type];

return { default: validValue !== undefined ? validValue : value };
Expand Down Expand Up @@ -102,7 +102,7 @@ const handleColumnProperty = (column, propertyName, value) => {
case 'COLUMN_DEFAULT':
return handleDefault(handleType(column['DATA_TYPE']), value);
case 'IS_NULLABLE':
return { required: value === 'NO' ? true : false };
return { required: value === 'NO' };
case 'DATETIME_PRECISION':
return { fractSecPrecision: !isNaN(value) ? value : '' };
case 'NUMERIC_SCALE':
Expand Down

0 comments on commit ff3bec4

Please sign in to comment.