Skip to content

Proposal: G.isFinite #108

Open
Open
@motherthestate

Description

@motherthestate

Since isNumber currently only checks if the value is a number or infinity.

function px (value: number | string) {
  if (G.isNumber(value)) return `${value}px`
  return px
}

px(1/0) // "Infinitypx"

// Proposal:
G.isFinite(1/0) // false

To be clear this does not actually add a new type guard since infinity is a number in javascript and typescript does not make the distinction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions