feat: implement disabled, immutable and generate (#2280)

* feat: implement `disabled`, `immutable` and `generate`

* chore: remove unnecessary code

* chore: add generate to textarea and implement immutable

* no generate for textarea

---------

Co-authored-by: Matt Hill <matthewonthemoon@gmail.com>
This commit is contained in:
Alex Inkin
2023-05-22 23:40:06 +04:00
committed by Aiden McClelland
parent 4d1c7a3884
commit 8aa19e6420
26 changed files with 215 additions and 85 deletions

View File

@@ -62,6 +62,7 @@ export * from './util/base-64'
export * from './util/copy-to-clipboard'
export * from './util/get-new-entries'
export * from './util/get-pkg-id'
export * from './util/invert'
export * from './util/misc.util'
export * from './util/rpc.util'
export * from './util/to-local-iso-string'

View File

@@ -0,0 +1,12 @@
export function invert<
T extends string | number | symbol,
D extends string | number | symbol,
>(obj: Record<T, D>): Record<D, T> {
const result = {} as Record<D, T>
for (const key in obj) {
result[obj[key]] = key
}
return result
}