@@ -386,15 +386,19 @@ Note that `constant('string to match')` returns a `Decoder<string>` which fails
386386
387387Providing the type parameter is only necessary for type-literal strings and numbers, as detailed by this table:
388388
389- | Decoder | Type |
390- | ---------------------------- | ----------------- |
391- | constant(true) | Decoder<true> |
392- | constant(false) | Decoder<false> |
393- | constant(null) | Decoder<null> |
394- | constant('alaska') | Decoder<string> |
395- | constant<'alaska'>('alaska') | Decoder<'alaska'> |
396- | constant(50) | Decoder<number> |
397- | constant<50>(50) | Decoder<50> |
389+ | Decoder | Type |
390+ | ---------------------------- | ---------------------|
391+ | constant(true) | Decoder<true> |
392+ | constant(false) | Decoder<false> |
393+ | constant(null) | Decoder<null> |
394+ | constant('alaska') | Decoder<string> |
395+ | constant<'alaska'>('alaska') | Decoder<'alaska'> |
396+ | constant(50) | Decoder<number> |
397+ | constant<50>(50) | Decoder<50> |
398+ | constant([1,2,3]) | Decoder<number[]> |
399+ | constant<[1,2,3]>([1,2,3]) | Decoder<[1,2,3]> |
400+ | constant({x: 't'}) | Decoder<{x: string}> |
401+ | constant<{x: 't'}>({x: 't'}) | Decoder<{x: 't'}> |
398402
399403One place where this happens is when a type-literal is in an interface:
400404
0 commit comments