Skip to content

Commit

Permalink
Fix deprecated warning for interval.decorator.ts
Browse files Browse the repository at this point in the history
[DEP0056] DeprecationWarning: The `util.isString` API is deprecated.  Please use `typeof arg === "string"` instead.
  • Loading branch information
hkjeffchan committed Sep 13, 2024
1 parent 65d91a4 commit ee56e9b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/decorators/interval.decorator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { applyDecorators, SetMetadata } from '@nestjs/common';
import { isString } from 'util';
import { SchedulerType } from '../enums/scheduler-type.enum';
import {
SCHEDULER_NAME,
Expand All @@ -22,7 +21,7 @@ export function Interval(
nameOrTimeout: string | number,
timeout?: number,
): MethodDecorator {
const [name, intervalTimeout] = isString(nameOrTimeout)
const [name, intervalTimeout] = (typeof nameOrTimeout === "string")
? [nameOrTimeout, timeout]
: [undefined, nameOrTimeout];

Expand Down

0 comments on commit ee56e9b

Please sign in to comment.