From a3792251766ed9a87a59c760ea87f64792e54caa Mon Sep 17 00:00:00 2001 From: Shinigami Date: Mon, 24 Jan 2022 19:30:46 +0100 Subject: chore: migrate vendor (#254) --- src/unique.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/unique.ts') diff --git a/src/unique.ts b/src/unique.ts index c077ea58..382d2e2d 100644 --- a/src/unique.ts +++ b/src/unique.ts @@ -1,4 +1,4 @@ -const uniqueExec = require('../vendor/unique'); +import * as uniqueExec from './vendor/unique'; export class Unique { // maximum time unique.exec will attempt to run before aborting @@ -25,17 +25,18 @@ export class Unique { * * @method unique */ - unique( - method: any, - args: any, + unique string, Args extends any[]>( + method: Method, + args: Args, opts?: { startTime?: number; maxTime?: number; maxRetries?: number; currentIterations?: number; - [key: string]: any; + exclude?: string | string[]; + compare?: (obj: Record, key: string) => 0 | -1; } - ): any { + ): string { opts ||= {}; opts.startTime = new Date().getTime(); if (typeof opts.maxTime !== 'number') { -- cgit v1.2.3