Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

[Question] why isServer should check global? #352

Description

@manudeli

export function isServer() {
return typeof window === 'undefined' && typeof global !== 'undefined';
}

We reuse isServer many times in slash libraries, but I don't know why we should check global in isServer. could I get slash's intention why check not only window also global please?

No global checking libraries

We can see no global checking in below links

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions