persona-community-5/.pnpm-store/v3/files/0c/ed4108e288f7158d9ac7dfe3d99046bd0e9ffa99a2ade630150b63f0596e88cdf80c4009de48a7a6df74e164a8517a4db9ce2b7537380eb87d4b387d2ff13e
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

22 lines
667 B
Plaintext

import type {WritableKeysOf} from './writable-keys-of';
/**
Creates a type that represents `true` or `false` depending on whether the given type has any writable fields.
This is useful when you want to create an API whose behavior depends on the presence or absence of writable fields.
@example
```
import type {HasWritableKeys, WritableKeysOf} from 'type-fest';
type UpdateService<Entity extends object> = {
removeField: HasWritableKeys<Entity> extends true
? (field: WritableKeysOf<Entity>) => Promise<void>
: never
}
```
@category Utilities
*/
export type HasWritableKeys<BaseType extends object> = WritableKeysOf<BaseType> extends never ? false : true;