Rename Contains to Includes

This commit is contained in:
Convly 2023-05-26 15:33:09 +02:00
parent fef81ec261
commit a59719cc3c
2 changed files with 3 additions and 3 deletions

View File

@ -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> = {

View File

@ -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