Fixing issue with TS definitions.
This commit is contained in:
parent
e7d6298647
commit
eaf808b190
|
@ -33,13 +33,13 @@ export function generateRowIdField(keyProps: any[] = []) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// should always return an array
|
// should always return an array
|
||||||
export function breakRowIdField(_id: string) {
|
export function breakRowIdField(_id: string): any[] {
|
||||||
if (!_id) {
|
if (!_id) {
|
||||||
return null
|
return []
|
||||||
}
|
}
|
||||||
// have to replace on the way back as we swapped out the double quotes
|
// have to replace on the way back as we swapped out the double quotes
|
||||||
// when encoding, but JSON can't handle the single quotes
|
// when encoding, but JSON can't handle the single quotes
|
||||||
const decoded = decodeURIComponent(_id).replace(/'/g, '"')
|
const decoded: string = decodeURIComponent(_id).replace(/'/g, '"')
|
||||||
const parsed = JSON.parse(decoded)
|
const parsed = JSON.parse(decoded)
|
||||||
return Array.isArray(parsed) ? parsed : [parsed]
|
return Array.isArray(parsed) ? parsed : [parsed]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue