0.1.13 • Published 3 years ago
@thesunny/assert-type v0.1.13
AssertType
Getting Started
yarn add @thesunny/assert-typeWriting AssertType asserts
import { AssertType } from ".."
describe("AssertType", () => {
  describe("AssertType.Equal", () => {
    it("should check if two types are not equal", async () => {
      AssertType.NotEqual<0, 1>(true)
    })
    it("should check if two types are exactly equal", async () => {
      AssertType.Equal<88, 88>(true)
    })
  })
  describe("AssertType.Extends", () => {
    it("should check if a type cannot extend another", async () => {
      AssertType.NotExtends<number, 0>(true)
    })
    it("should check if a type can extend another", async () => {
      AssertType.Extends<0, number>(true)
    })
  })
})