UNPKG

@vladmandic/face-api

Version:

FaceAPI: AI-powered Face Detection & Rotation Tracking, Face Description & Recognition, Age & Gender & Emotion Prediction for Browser and NodeJS using TensorFlow/JS

18 lines (15 loc) 334 B
export type WithAge<TSource> = TSource & { age: number } export function isWithAge(obj: any): obj is WithAge<{}> { return typeof obj.age === 'number'; } export function extendWithAge< TSource >( sourceObj: TSource, age: number, ): WithAge<TSource> { const extension = { age }; return { ...sourceObj, ...extension }; }