Skip to content

Commit 681c74c

Browse files
committed
parseSnak: replace InconsistentDataType with @ts-expect-error
following suggestions in #122 (comment) #122 (comment)
1 parent e9327be commit 681c74c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/helpers/parse_snak.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ for (const [ datatype, parser ] of Object.entries(parsers)) {
109109
}
110110

111111
export function parseSnak (datatype: DataType | void, datavalue: SnakValue, options: SimplifySnakOptions) {
112-
// Known case of missing datatype: form.claims, sense.claims, mediainfo.statements
113-
datatype = (datatype || datavalue.type) as DataType
112+
// @ts-expect-error Known case of missing datatype: form.claims, sense.claims, mediainfo.statements
113+
datatype = datatype || datavalue.type
114114

115115
try {
116116
// Known case requiring normalization

src/types/claim.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import type { parsers } from '../helpers/parse_snak.js'
55
export type Rank = 'normal' | 'preferred' | 'deprecated'
66
export type SnakType = 'value' | 'somevalue' | 'novalue'
77

8-
export type InconsistentDataType = 'globecoordinate' | 'musical notation'
9-
export type DataType = keyof typeof parsers | InconsistentDataType
8+
export type DataType = keyof typeof parsers
109

1110
export interface Claim {
1211
id: Guid

0 commit comments

Comments
 (0)