Skip to content

Loosen semver ranges on 3rd-party typings #166

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

Closed
wants to merge 2 commits into from
Closed
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 lib/annotations/Column.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function annotate(target: any,
};
} else {

options = Object.assign({}, optionsOrDataType);
options = Object.assign({}, <IPartialDefineAttributeColumnOptions>optionsOrDataType);

if (!options.type) {
options.type = getSequelizeTypeByDesignType(target, propertyName);
Expand Down
7 changes: 6 additions & 1 deletion lib/services/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,15 @@ export function getSequelizeTypeByDesignType(target: any, propertyName: string):
*/
export function getModels(arg: Array<typeof Model | string>): Array<typeof Model> {

if (arg && typeof arg[0] === 'string') {
if (arg) {

return arg.reduce((models: any[], dir) => {

if (typeof dir !== 'string') {
Copy link
Contributor

Choose a reason for hiding this comment

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

@RobinBuschmann do we have tests on this method? (I don't think I saw any in model.spec.ts?) This would be good to have some tests. (array with Model and String elems / only string elems / only Model elems / empty array / null / object).

Copy link
Member

Choose a reason for hiding this comment

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

@snewell92 No, we don't have any for this method only. @schmod Can you add some tests as a part of this PR? This would also increase coverage :)

models.push(dir);
return models;
}

const _models = fs
.readdirSync(dir as string)
.filter(isImportable)
Expand Down
Loading