feat(editor): Expose View Execution links for erroneous sub-executions (#13185)

This commit is contained in:
Charlie Kolb
2025-02-13 09:44:52 +01:00
committed by GitHub
parent 85deff0b7f
commit 11cf1cd23a
14 changed files with 261 additions and 13 deletions

View File

@@ -276,3 +276,10 @@ export function randomString(minLength: number, maxLength?: number): string {
.map((byte) => ALPHABET[byte % ALPHABET.length])
.join('');
}
/**
* Checks if a value is an object with a specific key and provides a type guard for the key.
*/
export function hasKey<T extends PropertyKey>(value: unknown, key: T): value is Record<T, unknown> {
return value !== null && typeof value === 'object' && value.hasOwnProperty(key);
}