-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed RE of indexes and functions from PostgreSQL:10
- Loading branch information
1 parent
b04051b
commit 2c74008
Showing
14 changed files
with
1,596 additions
and
1,537 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
const getJsonSchema = columns => { | ||
const properties = columns.reduce((properties, column) => { | ||
if (column.properties) { | ||
return { | ||
...properties, | ||
[column.name]: { | ||
...column, | ||
...getJsonSchema(column.properties), | ||
}, | ||
}; | ||
} | ||
const properties = columns.reduce((properties, column) => { | ||
if (column.properties) { | ||
return { | ||
...properties, | ||
[column.name]: { | ||
...column, | ||
...getJsonSchema(column.properties), | ||
}, | ||
}; | ||
} | ||
|
||
return { | ||
...properties, | ||
[column.name]: column, | ||
}; | ||
}, {}); | ||
return { | ||
...properties, | ||
[column.name]: column, | ||
}; | ||
}, {}); | ||
|
||
const required = Object.entries(properties) | ||
.filter(([filedName, field]) => field.required) | ||
.map(([fieldName]) => fieldName); | ||
const required = Object.entries(properties) | ||
.filter(([filedName, field]) => field.required) | ||
.map(([fieldName]) => fieldName); | ||
|
||
return { properties, required }; | ||
return { properties, required }; | ||
}; | ||
|
||
module.exports = { | ||
getJsonSchema, | ||
getJsonSchema, | ||
}; |
Oops, something went wrong.