fix: raw lens renderer download option uses direct arraybuffer binary value instead of text

This commit is contained in:
Andrew Bastin
2022-03-01 02:03:30 +05:30
parent f3f9a3a226
commit e9dc7769ac
3 changed files with 39 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
import { pipe } from "fp-ts/function"
import cloneDeep from "lodash/cloneDeep"
import isEqual from "lodash/isEqual"
export const objRemoveKey =
<T, K extends keyof T>(key: K) =>
@@ -8,3 +9,12 @@ export const objRemoveKey =
delete e[key]
return e
})
export const objFieldMatches =
<T, K extends keyof T, V extends T[K]>(
fieldName: K,
matches: ReadonlyArray<V>
) =>
// eslint-disable-next-line no-unused-vars
(obj: T): obj is T & { [_ in K]: V } =>
matches.findIndex((x) => isEqual(obj[fieldName], x)) !== -1