Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "String/Format"

Index

Type aliases

Type aliases

Format

Format<S, fmt>: { 'b': { 1: Boolean; 0: S extends "false" ? 0 : 1; }[string extends S ? 1 : 0]; 'n': IterationOf<S>[3]; 's': S; }[fmt]

Change the format of a string

Type parameters

  • S: string

    to transform

  • fmt: Formats

returns

string | number | boolean

example

import {S} from 'ts-toolbelt'

type test0 = S.Format<'30', 'b'> // True
type test1 = S.Format<'30', 'n'> // 30

Made with ❤️ by pirix-gh. Documentation generated by TypeDoc.