Skip to content
This repository has been archived by the owner on Oct 29, 2023. It is now read-only.

Latest commit

 

History

History
21 lines (16 loc) · 368 Bytes

readme.md

File metadata and controls

21 lines (16 loc) · 368 Bytes

typemap

import { v } from 'https://deno.land/x/typemap@v0.2.0/mod.ts'
import type { Static, Schema } from 'https://deno.land/x/typemap@v0.2.0/mod.ts'

const schema = v.object({
  key: v.literal('value')
})

const valid = {
  key: 'value'
}

const invalid = {
  key: 'key'
}

console.log(v(schema, valid)) // true
console.log(v(schema, invalid)) // false