Skip to content
Snippets Groups Projects
Commit f965766a authored by michael.minelli's avatar michael.minelli
Browse files

Toolbox => Add isString function

parent 021300d2
No related branches found
No related tags found
No related merge requests found
...@@ -51,6 +51,10 @@ class Toolbox { ...@@ -51,6 +51,10 @@ class Toolbox {
public getKeysWithPrefix(obj: object, prefix: string): Array<string> { public getKeysWithPrefix(obj: object, prefix: string): Array<string> {
return Object.keys(obj).filter(key => key.startsWith(prefix)); return Object.keys(obj).filter(key => key.startsWith(prefix));
} }
public isString(value: unknown): value is string {
return typeof value === 'string' || value instanceof String;
}
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment