Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tiny-decoders

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiny-decoders - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

5

CHANGELOG.md

@@ -0,1 +1,6 @@

### Version 3.0.1 (2019-08-08)
- Fixed an oversight regarding the recommended type annotation for `autoRecord`
decoders in Flow. No code changes.
### Version 3.0.0 (2019-08-08)

@@ -2,0 +7,0 @@

2

package.json
{
"name": "tiny-decoders",
"version": "3.0.0",
"version": "3.0.1",
"license": "MIT",

@@ -5,0 +5,0 @@ "author": "Simon Lydell",

@@ -136,3 +136,3 @@ # tiny-decoders [![Build Status][travis-badge]][travis-link] ![no dependencies][deps-tiny-decoders] [![minified size][min-tiny-decoders]][bundlephobia-tiny-decoders]

error messages. The following is the recommended way of annotating record
decoders, in both TypeScript and Flow:
decoders in TypeScript:

@@ -178,2 +178,28 @@ ```ts

In Flow, annotate like this:
```js
import { record, autoRecord } from "tiny-decoders";
type Person = {|
name: string,
age: number,
|};
const personDecoder = record((field): Person => ({
name: field("name", string),
age: field("age", number),
}));
// or:
const personDecoder2: Decoder<Person> = record(field => ({
name: field("name", string),
age: field("age", number),
}));
const personDecoderAuto: Decoder<Person> = autoRecord({
name: string,
age: number,
});
```
See the [TypeScript type annotations example][typescript-type-annotations] and

@@ -180,0 +206,0 @@ the [Flow type annotations example][example-type-annotations] for more

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc