Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

skava / chain-able-deps   js

Repository URL to install this package:

Version: 6.0.4 

/ src / fp / __tests__ / invertObjKeyVal.test.ts

import { ReverseObjKeyValue } from '../../../_typings'
import invertObj from '../invertObjKeyVal'

type Eh = ReverseObjKeyValue<{ bah: 'humbug' }>
var valid: Eh = { humbug: 'bah' }
var invalid: Eh = { bah: 'humbug' }

const invertedStrong = invertObj<{ eh: 'canada' }>({ eh: 'canada' })
const strong = invertedStrong.eh

const inverted = invertObj({ eh: 'canada' })
const notAutoCompletedOrValidated = inverted.eh
const butHasIntellisense = inverted.canada
const includingTypeValueCheck = inverted.eh === 'canada'