Releases: tylim88/FirelordJS
2.9.1
2.9.0
2.8.18
2.8.15
2.8.7
fix nested object in mapped type is not partial in update
type DU = MetaTypeCreator<Record<string, { k: Record<`${1 | 2 | 3}`, number> }>, 'abc'>
const du = getFirelord<DU>(getFirestore(), 'abc')
const docRef = du.doc('123')
updateDoc(docRef, { x: { k: { '1': 1 } } }) // unexpected error requires all properties to present, now is fixed2.8.6
fix value of where clause top level field from discriminated unions being never
import {
MetaTypeCreator,
query,
where,
} from 'firelordjs'
type DU = MetaTypeCreator<
{ c: false } | { c: true; v: 0 },
'abc'
>
const du = getFirelord<DU>(getFirestore(), 'abc')
query(du.collection(), where('v', '==', 0)) //should be ok but error2.8.5
-
export
ArrayUnionOrRemovetype -
fix discriminated union value is inferred as
neverinwhereclause
import {
MetaTypeCreator,
query,
where,
} from 'firelordjs'
type DU = MetaTypeCreator<
{ a: { b: 1; c: 2 } | { b: 'a'; d: 'b' } },
'abc'
>
const du = getFirelord<DU>(getFirestore(), 'abc')
query(du.collection(), where('a.b', '==', 2)) // previously no error but is expected to error 2.8.2
2.8.0
now require typescript 5.4.2 and above
also please change your vscode TS version to 5.4.2, guide: https://firelordjs.com/change_ts_version
2.7.0
no longer support full flattened path if the key is string
given this type:
{
a: Record<string,{ b: number, c: { d: string } }>
}previously firelord generates the flattened path that look like:
{
a: Record<string,{ b: number, c: { d: string } }>
[x : `a.${string}`]: { b: number, c: { d: string } }
[x : `a.${string}.b`]: number
[x : `a.${string}.c`]: { d: string }
[x : `a.${string}.c.d`]: string
}the problem is: a.${string}.b, a.${string}.c and a.${string}.c.d will collapsed into a.${string}
to address this issue, firelord now generates:
{
a: Record<string, { b: number, c: { d: string }, `c.d`: string }>
}firelord will not attempt to flatten mapped type, but will still continue to flatten any nested object literal type, in this case it is the c.d
affected operation: all update operations
Remove JSON type
JSON type is now available by accessing meta type instead: Example['readJSON']