Home > @idealeap/pipeline > isRecordOfString
isRecordOfString() function
Determines if a variable is a plain object with string values.
Signature:
typescript
export declare function isRecordOfString(variable: any): variable is Record<string, string>;
export declare function isRecordOfString(variable: any): variable is Record<string, string>;
Parameters
Parameter | Type | Description |
---|---|---|
variable | any | The variable to check. |
Returns:
variable is Record<string, string>
true
if the variable is a plain object and all its values are strings, otherwise returns false
.
Example
isRecordOfString({ a: 'hello', b: 'world' }); // Returns true isRecordOfString({ a: 'hello', b: 123 }); // Returns false