@angular-ru/cdk/function
isFunctionLike(val)
class A {}
console.log(isFunctionLike(() => {})); // true
console.log(isFunctionLike(A)); // true
console.log(isFunctionLike({a: 1})); // falsetypeofType
import {typeofType} from '@angular-ru/cdk/function';
import {Exclude, Expose, Type} from 'class-transform';
import {B} from './b';
@Exclude()
export class A {
@Expose() @Type(typeofType(B)) public b: B;
}$args(fnRef)
import {$args} from '@angular-ru/cdk/function';
function hello(name: string, value: number, a?: string[]): string {
return 'world' + name + value + a;
}
console.log($args(hello)); // ['name', 'value', 'a']hasConstructor(ref)
Last updated