Skip to content

Commit

Permalink
fix(utils): use literal union for ContentEntityType
Browse files Browse the repository at this point in the history
  • Loading branch information
denkristoffer committed Jul 21, 2022
1 parent b02949a commit b73cfa4
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
3 changes: 2 additions & 1 deletion lib/types/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { LiteralUnion } from 'type-fest'
import { ContentTypeFieldValidation } from './entities'

type Sys = {
Expand Down Expand Up @@ -33,7 +34,7 @@ export interface CollectionResponse<T> {
sys: { type: string }
}

export type ContentEntityType = 'Entry' | 'Asset' | string
export type ContentEntityType = LiteralUnion<'Entry' | 'Asset', string>

export interface ContentEntitySys {
space: Link
Expand Down
35 changes: 28 additions & 7 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"sinon-chai": "3.7.0",
"ts-mocha": "10.0.0",
"tslib": "2.4.0",
"type-fest": "^2.17.0",
"typescript": "4.7.4"
},
"lint-staged": {
Expand Down

0 comments on commit b73cfa4

Please sign in to comment.