#Use isNullOrUndefined from utils

1 messages · Page 1 of 1 (latest)

prime urchin
#

I'm importing it at the top import isNullOrUndefined from "@bookwave/utils";

#

Do I need to do something else?

ionic tiger
#

perhaps you meant import { isNullOrUndefined } from "@bookwave/utils";?

prime urchin
#

Am I suppose to declare it as a function somewhere?

#

Because when I import it like that, it imports from "node:util", which is saying is deprecrated

#

@ionic tiger thanks for your reply

ancient lance
#

You can write it very easily

#
function isNullOrUndefined(u: unknown): u is null | undefined {
    return u === null || u === undefined
}
ionic tiger
#

does it not already exist in your @bookwave/utils module? i assumed it did and that's why you tried to import from there originally

ancient lance
#

seems to be a private/local module or alias FYI

ionic tiger
#

yeah, that's what i figured

prime urchin
#

I added it manually