Variable JsonNumberConst

      JsonNumber: Schema<number>

      The JsonNumber is a schema for representing JSON numbers. It ensures that the provided value is a valid number by filtering out NaN and (+/-) Infinity. This is useful when you want to validate and represent numbers in JSON format.

      Example

      import * as S from "@effect/schema/Schema"

      const is = S.is(S.JsonNumber)

      assert.deepStrictEqual(is(42), true)
      assert.deepStrictEqual(is(Number.NaN), false)
      assert.deepStrictEqual(is(Number.POSITIVE_INFINITY), false)
      assert.deepStrictEqual(is(Number.NEGATIVE_INFINITY), false)

      Since

      1.0.0