/* * Copyright (c) 2019. Mario Studio. All right reserved. */ import { Pipe, PipeTransform, } from '@angular/core'; import { Dictionary, List, NumericDictionary, sampleSize, } from 'lodash'; @Pipe({ name: 'sampleSize', }) export class SampleSizePipe implements PipeTransform { transform ( collection: List | Dictionary | NumericDictionary | null | undefined, n?: number, ): T[] { return sampleSize(collection, n); } }