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

Update fork #1

Merged
merged 61 commits into from
Sep 21, 2020
Merged
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
c0f6e38
Update all non-major dependencies
renovate-bot May 25, 2020
59e3d50
Update typescript-eslint monorepo to v3 (major) (#634)
renovate[bot] May 25, 2020
1b433d1
Update all non-major dependencies
renovate-bot Jun 1, 2020
cafa509
Keep this bind in logger methods (#638)
dolezel Jun 2, 2020
d1454ec
Updated changelog
dolezel Jun 2, 2020
4e640e3
5.0.1
dolezel Jun 2, 2020
f18d32b
Fix alter column collation (#641)
dolezel Jun 5, 2020
75aabfb
Updated changelog
dolezel Jun 5, 2020
545fe7d
5.0.2
dolezel Jun 5, 2020
c552488
Ability to specify own template file (#642)
dolezel Jun 5, 2020
bd68b10
Updated changelog
dolezel Jun 5, 2020
470ee0b
5.1.0
dolezel Jun 5, 2020
333cd4a
Update all non-major dependencies
renovate-bot Jun 8, 2020
075c681
Fix creating migration (#646)
dolezel Jun 8, 2020
afedbfe
Updated changelog
dolezel Jun 8, 2020
6c6f1e5
5.1.1
dolezel Jun 8, 2020
638def7
Update all non-major dependencies
renovate-bot Jun 15, 2020
e0eebff
Update dependency mocha to v8 (#650)
renovate[bot] Jun 15, 2020
4d3e84d
Update all non-major dependencies
renovate-bot Jun 22, 2020
9a6380c
View options (#656)
dolezel Jun 26, 2020
00564fd
Updated changelog
dolezel Jun 26, 2020
2f93dff
5.2.0
dolezel Jun 26, 2020
97c5d36
Update all non-major dependencies
renovate-bot Jun 29, 2020
fe796dc
Update all non-major dependencies
renovate-bot Jul 6, 2020
925f7fa
Update all non-major dependencies
renovate-bot Jul 13, 2020
7b60acb
Update dependency @types/mocha to v8 (#662)
renovate[bot] Jul 13, 2020
9937845
let console.error display all the properties on an err object, which …
jhillacre Jul 13, 2020
09fb554
Updated changelog
dolezel Jul 13, 2020
f8c5f90
5.3.0
dolezel Jul 13, 2020
4275b83
Updated dependencies (#663)
dolezel Jul 13, 2020
4a8a006
Update all non-major dependencies
renovate-bot Jul 20, 2020
5a2a660
Update all non-major dependencies
renovate-bot Jul 27, 2020
058a70a
Update all non-major dependencies
renovate-bot Aug 3, 2020
0b355e0
docs: fixed small error (#666)
0xflotus Aug 3, 2020
1ba6609
Update isExternalClient check (#664)
jondb Aug 5, 2020
7c65595
Updated changelog
dolezel Aug 5, 2020
92503ef
5.4.0
dolezel Aug 5, 2020
99661f5
Update all non-major dependencies
renovate-bot Aug 10, 2020
9d931e6
Regenerated package-lock.json (#674)
dolezel Aug 10, 2020
f6e8213
Allow opclass and sort per column in indexes (#671)
dolezel Aug 10, 2020
3742a40
Updated changelog
dolezel Aug 10, 2020
7982295
5.5.0
dolezel Aug 10, 2020
84c8220
Update all non-major dependencies
renovate-bot Aug 17, 2020
b8e9594
Update all non-major dependencies Docker tags
renovate-bot Aug 17, 2020
813c956
Do not try to unlock DB if connection failed (#677)
dolezel Aug 18, 2020
f304c83
Updated changelog
dolezel Aug 18, 2020
f02fffa
5.5.1
dolezel Aug 18, 2020
05be999
PgLiteral can be serialized (#678)
dolezel Aug 19, 2020
f87992e
Updated changelog
dolezel Aug 19, 2020
47aac05
5.6.0
dolezel Aug 19, 2020
9db481b
Using pg client in custom runner test (#679)
dolezel Aug 19, 2020
8896c95
Update all non-major dependencies
renovate-bot Aug 24, 2020
b0b2b40
Update dependency ts-node to v9 (#681)
renovate[bot] Aug 24, 2020
f79c1d7
Update dependency typescript to v4 (#682)
renovate[bot] Aug 24, 2020
4d255c5
Update all non-major dependencies
renovate-bot Aug 31, 2020
6c8fbb1
Update all non-major dependencies
renovate-bot Sep 7, 2020
74f3664
Update all non-major dependencies
renovate-bot Sep 14, 2020
8decc89
Update dependency yargs to v16 (#691)
renovate[bot] Sep 14, 2020
5783b6f
Eslint config (#692)
dolezel Sep 15, 2020
a6a43c5
Update all non-major dependencies
renovate-bot Sep 21, 2020
9b72b62
Bump node-fetch from 2.6.0 to 2.6.1 (#689)
dependabot[bot] Sep 21, 2020
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
Prev Previous commit
Next Next commit
Update dependency typescript to v4 (salsita#682)
* Update dependency typescript to v4

* Refactored type computing

* Regenerated dependencies

Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: Jan Dolezel <[email protected]>
3 people authored Aug 24, 2020
commit f79c1d7169f58f7e5f5a77aee67cf66e01271758
94 changes: 47 additions & 47 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -83,7 +83,7 @@
"sinon": "9.0.3",
"sinon-chai": "3.5.0",
"ts-node": "9.0.0",
"typescript": "3.9.7"
"typescript": "4.0.2"
},
"peerDependencies": {
"pg": ">=4.3.0 <9.0.0"
19 changes: 10 additions & 9 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -83,6 +83,11 @@ const defaultTypeShorthands: ColumnDefinitions = {
export const applyTypeAdapters = (type: string): string =>
type in typeAdapters ? typeAdapters[type as keyof typeof typeAdapters] : type

const toType = (type: string | ColumnDefinition): ColumnDefinition => (typeof type === 'string' ? { type } : type)

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const removeType = ({ type, ...rest }: Partial<ColumnDefinition>) => rest

export const applyType = (
type: Type,
extendingTypeShorthands: ColumnDefinitions = {},
@@ -91,28 +96,24 @@ export const applyType = (
...defaultTypeShorthands,
...extendingTypeShorthands,
}
const options = typeof type === 'string' ? { type } : type
const options = toType(type)
let ext: ColumnDefinition | null = null
const types: string[] = [options.type]
while (typeShorthands[types[types.length - 1]]) {
if (ext) {
delete ext.type
ext = {
...toType(typeShorthands[types[types.length - 1]]),
...(ext === null ? {} : removeType(ext)),
}
const t = typeShorthands[types[types.length - 1]]
ext = { ...(typeof t === 'string' ? { type: t } : t), ...(ext === null ? {} : ext) }
if (types.includes(ext.type)) {
throw new Error(`Shorthands contain cyclic dependency: ${types.join(', ')}, ${ext.type}`)
} else {
types.push(ext.type)
}
}
if (!ext) {
ext = { type: options.type }
}
return {
...ext,
...options,
type: applyTypeAdapters(ext.type),
type: applyTypeAdapters(ext?.type ?? options.type),
}
}