Skip to content

Commit 3fb8538

Browse files
Eprince-hubporsager
authored andcommitted
Add condition inline
1 parent f9beb8b commit 3fb8538

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/types.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ export const types = {
3939
}
4040
}
4141

42-
const allowList = {
43-
object: typeof Object
44-
}
45-
4642
class NotTagged { then() { notTagged() } catch() { notTagged() } finally() { notTagged() }}
4743

4844
export class Identifier extends NotTagged {
@@ -329,7 +325,7 @@ export const fromKebab = x => x.replace(/-/g, '_')
329325

330326
function createJsonTransform(fn) {
331327
return function jsonTransform(x, column) {
332-
return (x && typeof x in allowList) && (column.type === 114 || column.type === 3802)
328+
return typeof x === 'object' && x !== null && (column.type === 114 || column.type === 3802)
333329
? Array.isArray(x)
334330
? x.map(x => jsonTransform(x, column))
335331
: Object.entries(x).reduce((acc, [k, v]) => Object.assign(acc, { [fn(k)]: v }), {})

0 commit comments

Comments
 (0)