type JsonPrimitive = boolean | Date | null | number | string
+// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
export type JsonObject = {
[key in string]?: JsonType
}
changedValue = Number.parseInt(value)
}
if (isNaN(changedValue)) {
- throw new Error(`Cannot convert to integer: '${String(value)}'`)
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
+ throw new Error(`Cannot convert to integer: '${value.toString()}'`)
}
return changedValue
}
changedValue = Number.parseFloat(value)
}
if (isNaN(changedValue)) {
- throw new Error(`Cannot convert to float: '${String(value)}'`)
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
+ throw new Error(`Cannot convert to float: '${value.toString()}'`)
}
return changedValue
}
changedValue = Number.parseInt(value)
}
if (isNaN(changedValue)) {
- throw new Error(`Cannot convert to integer: '${String(value)}'`)
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
+ throw new Error(`Cannot convert to integer: '${value.toString()}'`)
}
return changedValue
}
type JsonPrimitive = boolean | Date | null | number | string
+// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
export type JsonObject = { [key in string]?: JsonType }
export type JsonType = JsonObject | JsonPrimitive | JsonType[]