persona-community-5/.pnpm-store/v3/files/db/142f5250b50a0f28db3f4956ee4301277aa96cc2dd7db5f7fbc41080b09f0b31a3d13954b9e75c6bbe40e4639022537140115da41256e8d4530fbf73b887a0
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 {ReadonlyKeysOf} from './readonly-keys-of';
/**
Creates a type that represents `true` or `false` depending on whether the given type has any readonly fields.
This is useful when you want to create an API whose behavior depends on the presence or absence of readonly fields.
@example
```
import type {HasReadonlyKeys, ReadonlyKeysOf} from 'type-fest';
type UpdateService<Entity extends object> = {
removeField: HasReadonlyKeys<Entity> extends true
? (field: ReadonlyKeysOf<Entity>) => Promise<void>
: never
}
```
@category Utilities
*/
export type HasReadonlyKeys<BaseType extends object> = ReadonlyKeysOf<BaseType> extends never ? false : true;