mirror of
https://github.com/strapi/strapi.git
synced 2025-12-11 23:15:15 +00:00
Rename Contains to Includes
This commit is contained in:
parent
fef81ec261
commit
a59719cc3c
@ -51,7 +51,7 @@ export type Keys<R, U extends UID.Any = UID.Any> = Extract<keyof R, U>;
|
||||
* type T = keyof WhereKeys<Registry, { namespace: Namespace.Plugin | Namespace.Admin }>;
|
||||
* // ^ "plugin::foo.bar" | "admin::foo" | "admin::bar"
|
||||
*
|
||||
* type T = keyof WhereKeys<Registry, { namespace: Namespace.API; name: Utils.Contains<'b'> }>;
|
||||
* type T = keyof WhereKeys<Registry, { namespace: Namespace.API; name: Utils.Includes<'b'> }>;
|
||||
* // ^ "api::foo.bar" | "api::foo.baz"
|
||||
*/
|
||||
export type WhereKeys<T, Q extends Partial<UID.Parsed>, U extends UID.Any = UID.Any> = {
|
||||
|
||||
4
packages/core/strapi/lib/types/utils.d.ts
vendored
4
packages/core/strapi/lib/types/utils.d.ts
vendored
@ -10,9 +10,9 @@
|
||||
export type Literal = string | number | bigint | boolean;
|
||||
|
||||
/**
|
||||
* Used to check if a string contains a given literal
|
||||
* Used to check if a string includes a given literal
|
||||
*/
|
||||
export type Contains<S extends Literal> = `${string}${S}${string}`;
|
||||
export type Includes<S extends Literal> = `${string}${S}${string}`;
|
||||
|
||||
/**
|
||||
* Used to make sure the given string is not empty
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user