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

boywithkeyboard/typemap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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