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

fix: regular expressions are invalid #74

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -9,8 +9,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] || value;

return { default: validValue };
Expand Down Expand Up @@ -59,7 +59,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
Loading