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 / _typings / helpers.ts

/**
 * Turn all properties of T into strings
 */
export type Stringify<T> = { [P in keyof T]: string }

export type ObjValue<T> = T[keyof T]

// @note - use Partial<ReverseObjKeyValue<Type>> to make each key optional
export type ReverseObjKeyValue<T = any> = {
  // goes through each VALUE => key
  // each KEY (keyof) as VALUE
  [Key in ObjValue<T>]: keyof T
}

// function eh<Type = any>(arg: Type): ReverseObjKeyValue<Type> {}
// var flip = eh<{eh: 'coolio'}>({eh: 'coolio'})
// var values: ObjValue<{eh: 'coolio'}> = 'coolio'
// flip.coolio === values[0]