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/bump node #19

Merged
merged 8 commits into from
Dec 11, 2023
Merged

Refactor/bump node #19

merged 8 commits into from
Dec 11, 2023

Conversation

m-kusnierz
Copy link
Contributor

@m-kusnierz m-kusnierz commented Dec 8, 2023

This PR contains:

  • bump of required node version to at least 16.20 and npm at least 8.19
  • use const and let instead of var
  • moved source files to lib directory
  • exported formats as it seems that they are used by the apps requiring this package Such export breaks the idea of having only schemas exported.

lib/index.js Outdated
@@ -124,3 +124,4 @@ function getSchemaForeignKeys(schemaName, foreignKeys) {
}

module.exports = schemagicInit();
module.exports.formats = require('./formats');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added export of formats that was used in other apps through require('schemagic/formats').currency;

Comment on lines +157 to +158
const schemaCopy = clone(schema);
const schemaTraverse = traverse(schemaCopy);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed variables

return callback(null, errors);
});
}
};

function getValuesToCheck(foreignKeys, document) {
var memo = {};
let memo = {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually redefine memo or just add properties?

memo.foo = 'foo';

does not mean we redefined memo and it can be const in this case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do just in the first line of the collapsed code part 😄
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice restructure

package.json Outdated Show resolved Hide resolved
@m-kusnierz m-kusnierz merged commit c768357 into master Dec 11, 2023
1 check passed
@m-kusnierz m-kusnierz deleted the refactor/bump-node branch December 11, 2023 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants