isAttribute()
Attribute.isAttribute()
Attribute.isAttribute()public static isAttribute<Name extends string, Value extends string>(
value: any,
name?: Name,
val?: Value
): value is Attribute<Name, Value> {
return typeof value === 'object' && value instanceof this
? (typeof name === 'string' ? value.name === name : true) &&
(typeof val === 'string' ? value.value === val : true)
: false;
}Generic type variables
Parameters
Name: type
Description
Returns
Return type
Example usage
Last updated