Comparing version 1.1.4 to 1.1.5
287
CHANGELOG.md
@@ -5,9 +5,9 @@ # Changelog | ||
> | ||
> * [New Feature] | ||
> * [Bug Fix] | ||
> * [Breaking Change] | ||
> * [Documentation] | ||
> * [Internal] | ||
> * [Polish] | ||
> * [Experimental] | ||
> - [New Feature] | ||
> - [Bug Fix] | ||
> - [Breaking Change] | ||
> - [Documentation] | ||
> - [Internal] | ||
> - [Polish] | ||
> - [Experimental] | ||
@@ -17,92 +17,99 @@ **Note**: Gaps between patch versions are faulty/broken releases. **Note**: A feature tagged as Experimental is in a | ||
# 1.1.5 | ||
- **Bug Fix** | ||
- partial combinator should preserve additional properties while encoding, fixes #179 (@gcanti) | ||
- **Polish** | ||
- use `useIdentity` when possible (@gcanti) | ||
# 1.1.4 | ||
* **Internal** | ||
* fix broken build with `typescript@2.9.1`, closes #174 (@gcanti) | ||
- **Internal** | ||
- fix broken build with `typescript@2.9.1`, closes #174 (@gcanti) | ||
# 1.1.3 | ||
* **Internal** | ||
* upgrade to `typings-checker@2.0.0` (@gcanti) | ||
- **Internal** | ||
- upgrade to `typings-checker@2.0.0` (@gcanti) | ||
# 1.1.2 | ||
* **Bug Fix** | ||
* fix `alias` implementation (@gcanti) | ||
* handle exact types in `isTagged` (@gcanti) | ||
- **Bug Fix** | ||
- fix `alias` implementation (@gcanti) | ||
- handle exact types in `isTagged` (@gcanti) | ||
# 1.1.1 | ||
* **Experimental** | ||
* add `clean` / `alias` functions, closes #149 (@gcanti) | ||
* add `exact` combinator (@gcanti) | ||
* the `strict` combinator is deprecated | ||
* remove `optional` combinator (@gcanti) | ||
* it doesn't play well with advanced combinators, see [here](https://github.com/gcanti/io-ts/issues/140) for a discussion | ||
- **Experimental** | ||
- add `clean` / `alias` functions, closes #149 (@gcanti) | ||
- add `exact` combinator (@gcanti) | ||
- the `strict` combinator is deprecated | ||
- remove `optional` combinator (@gcanti) | ||
- it doesn't play well with advanced combinators, see [here](https://github.com/gcanti/io-ts/issues/140) for a discussion | ||
# 1.0.6 | ||
* **Bug Fix** | ||
* `taggedUnion` fails to decode when tag values are not string literals, fix #161 (@gcanti) | ||
- **Bug Fix** | ||
- `taggedUnion` fails to decode when tag values are not string literals, fix #161 (@gcanti) | ||
# 1.0.5 | ||
* **Bug Fix** | ||
* workaround for upstream TypeScript bug 14041 (wrong generated declarations) (@gcanti) | ||
* **Internal** | ||
* optimize InterfaceType.encode (@gcanti) | ||
* use definite assignment assertion for phantom fields (@gcanti) | ||
- **Bug Fix** | ||
- workaround for upstream TypeScript bug 14041 (wrong generated declarations) (@gcanti) | ||
- **Internal** | ||
- optimize InterfaceType.encode (@gcanti) | ||
- use definite assignment assertion for phantom fields (@gcanti) | ||
# 1.0.4 | ||
* **Bug Fix** | ||
* make `Context` readonly (@gcanti) | ||
* **Internal** | ||
* optimizations, #137 (@gcanti, @sledorze) | ||
- **Bug Fix** | ||
- make `Context` readonly (@gcanti) | ||
- **Internal** | ||
- optimizations, #137 (@gcanti, @sledorze) | ||
# 1.0.3 | ||
* **Internal** | ||
* optimizations, #134 (@gcanti, @sledorze) | ||
- **Internal** | ||
- optimizations, #134 (@gcanti, @sledorze) | ||
# 1.0.2 | ||
* **Bug Fix** | ||
* fix `OutputOfPartialProps` name (@gcanti) | ||
- **Bug Fix** | ||
- fix `OutputOfPartialProps` name (@gcanti) | ||
# 1.0.1 | ||
* **Bug Fix** | ||
* fix `AnyType` by extending `Type<any>` (@gcanti) | ||
- **Bug Fix** | ||
- fix `AnyType` by extending `Type<any>` (@gcanti) | ||
# 1.0.0 | ||
* **Breaking Change** | ||
* upgrade to `fp-ts@1.0.0` | ||
* see https://github.com/gcanti/io-ts/pull/112 (@gcanti) | ||
- **Breaking Change** | ||
- upgrade to `fp-ts@1.0.0` | ||
- see https://github.com/gcanti/io-ts/pull/112 (@gcanti) | ||
# 0.9.8 | ||
* **New Feature** | ||
* add decode and deprecate top level validate (@gcanti) | ||
* **Internal** | ||
* when checking validations use methods instead of top level functions (@gcanti) | ||
- **New Feature** | ||
- add decode and deprecate top level validate (@gcanti) | ||
- **Internal** | ||
- when checking validations use methods instead of top level functions (@gcanti) | ||
# 0.9.7 | ||
* **New Feature** | ||
* add `taggedUnion` combinator (@gcanti, @sledorze) | ||
- **New Feature** | ||
- add `taggedUnion` combinator (@gcanti, @sledorze) | ||
# 0.9.6 | ||
* **New Feature** | ||
* `recursive` combinator | ||
* add support for mutually recursive types, closes #114 (@gcanti) | ||
* make it safer: `RT` now must extend `Type<mixed, A>` (@gcanti) | ||
- **New Feature** | ||
- `recursive` combinator | ||
- add support for mutually recursive types, closes #114 (@gcanti) | ||
- make it safer: `RT` now must extend `Type<mixed, A>` (@gcanti) | ||
# 0.9.5 | ||
* **New Feature** | ||
* add `mixed` type (@gcanti) | ||
* replace `any` with `mixed` in all input type parameters (@gcanti) | ||
- **New Feature** | ||
- add `mixed` type (@gcanti) | ||
- replace `any` with `mixed` in all input type parameters (@gcanti) | ||
```diff | ||
@@ -116,111 +123,111 @@ -export class StringType extends Type<any, string> { | ||
* **Bug Fix** | ||
* strict: should succeed validating an undefined field, closes #106 (@gcanti) | ||
- **Bug Fix** | ||
- strict: should succeed validating an undefined field, closes #106 (@gcanti) | ||
# 0.9.3 | ||
* **Bug Fix** | ||
* revert 37c74a5e2038de063a950f9ba8d18b1f132ef450, closes #8 (@gcanti) | ||
- **Bug Fix** | ||
- revert 37c74a5e2038de063a950f9ba8d18b1f132ef450, closes #8 (@gcanti) | ||
# 0.9.2 | ||
* **New Feature** | ||
* add `Decoder` / `Encoder` interfaces (@sledorze, @gcanti) | ||
* **Internal** | ||
* perf optimizations (@sledorze, @gcanti) | ||
- **New Feature** | ||
- add `Decoder` / `Encoder` interfaces (@sledorze, @gcanti) | ||
- **Internal** | ||
- perf optimizations (@sledorze, @gcanti) | ||
# 0.9.1 | ||
* **Bug Fix** | ||
* make all classes "dumb", fix #95 (@gcanti) | ||
- **Bug Fix** | ||
- make all classes "dumb", fix #95 (@gcanti) | ||
# 0.9.0 | ||
* **Breaking Change** | ||
* remove `t.map` and `t.mapWithName` (in general doesn't look serializable, needs more investigation) | ||
* remove `t.prism` (in general doesn't look serializable, needs more investigation) | ||
* change `Type` from interface to class and add `S` type parameter | ||
* remove `t._A` | ||
* add `Type#serialize` | ||
* add `Type#is` (in order to serialize unions and while we're at it, looks useful anyway) | ||
* remove `t.is` (now that there's `Type#is` is misleading) | ||
* **Experimental** | ||
* add Flowtype support (@gcanti) | ||
- **Breaking Change** | ||
- remove `t.map` and `t.mapWithName` (in general doesn't look serializable, needs more investigation) | ||
- remove `t.prism` (in general doesn't look serializable, needs more investigation) | ||
- change `Type` from interface to class and add `S` type parameter | ||
- remove `t._A` | ||
- add `Type#serialize` | ||
- add `Type#is` (in order to serialize unions and while we're at it, looks useful anyway) | ||
- remove `t.is` (now that there's `Type#is` is misleading) | ||
- **Experimental** | ||
- add Flowtype support (@gcanti) | ||
# 0.8.2 | ||
* **New Feature** | ||
* add `object` type, closes #86 (@gcanti) | ||
- **New Feature** | ||
- add `object` type, closes #86 (@gcanti) | ||
# 0.8.1 | ||
* **New Feature** | ||
* add `strict` combinator, closes #84 (@phiresky, @gcanti) | ||
- **New Feature** | ||
- add `strict` combinator, closes #84 (@phiresky, @gcanti) | ||
# 0.8.0 | ||
* **Breaking Change** | ||
* upgrade `fp-ts` dependency (@gcanti) | ||
- **Breaking Change** | ||
- upgrade `fp-ts` dependency (@gcanti) | ||
# 0.7.2 | ||
* **Bug Fix** | ||
* tag recursive types, fix #80 (@gcanti) | ||
- **Bug Fix** | ||
- tag recursive types, fix #80 (@gcanti) | ||
# 0.7.1 | ||
* **Bug Fix** | ||
* incorrect compile time type for dictionary, fix #75 (@gcanti) | ||
- **Bug Fix** | ||
- incorrect compile time type for dictionary, fix #75 (@gcanti) | ||
# 0.7.0 | ||
* **Breaking Change** | ||
* upgrade to latest fp-ts (0.5.1) (@gcanti) | ||
- **Breaking Change** | ||
- upgrade to latest fp-ts (0.5.1) (@gcanti) | ||
# 0.6.2 | ||
* **New Feature** | ||
* add aliases for `null` and `interface`, closes #63 (@gcanti) | ||
- **New Feature** | ||
- add aliases for `null` and `interface`, closes #63 (@gcanti) | ||
# 0.6.1 | ||
* **Internal** | ||
* handle latest fp-ts (0.4.3) (@gcanti) | ||
- **Internal** | ||
- handle latest fp-ts (0.4.3) (@gcanti) | ||
# 0.6.0 | ||
* **Breaking Change** | ||
* upgrade to latest fp-ts (0.4.0) (@gcanti) | ||
* **Internal** | ||
* allow for infinite unions (@gcanti) | ||
- **Breaking Change** | ||
- upgrade to latest fp-ts (0.4.0) (@gcanti) | ||
- **Internal** | ||
- allow for infinite unions (@gcanti) | ||
# 0.5.1 | ||
* **Bug Fix** | ||
* export and rename `interfaceType` to `_interface`, fix #57 (@gcanti) | ||
- **Bug Fix** | ||
- export and rename `interfaceType` to `_interface`, fix #57 (@gcanti) | ||
# 0.5.0 | ||
* **Breaking Change** | ||
* `Type` is now an interface | ||
* types no more own a `is` method, use `t.is` instead | ||
* unions no more own a `fold` method | ||
* `Reporter`, `PathReporter`, `ThrowReporter` are now top level modules | ||
- **Breaking Change** | ||
- `Type` is now an interface | ||
- types no more own a `is` method, use `t.is` instead | ||
- unions no more own a `fold` method | ||
- `Reporter`, `PathReporter`, `ThrowReporter` are now top level modules | ||
# 0.4.0 | ||
* **Breaking Change** | ||
* upgrade to latest `fp-ts` (`io-ts` APIs are not changed though) (@gcanti) | ||
* drop `lib-jsnext` folder | ||
- **Breaking Change** | ||
- upgrade to latest `fp-ts` (`io-ts` APIs are not changed though) (@gcanti) | ||
- drop `lib-jsnext` folder | ||
# 0.3.2 | ||
* **Bug Fix** | ||
* remove excess overloadings, fix #43 (@gcanti) | ||
- **Bug Fix** | ||
- remove excess overloadings, fix #43 (@gcanti) | ||
# 0.3.1 | ||
* **New Feature** | ||
* add mapWithName and Functor instance, fix #37 (@gcanti) | ||
* add prism combinator, fix #41 (@gcanti) | ||
- **New Feature** | ||
- add mapWithName and Functor instance, fix #37 (@gcanti) | ||
- add prism combinator, fix #41 (@gcanti) | ||
@@ -231,19 +238,19 @@ # 0.3.0 | ||
* **Breaking Change** | ||
* upgrade to latest fp-ts v0.2 (@gcanti) | ||
- **Breaking Change** | ||
- upgrade to latest fp-ts v0.2 (@gcanti) | ||
# 0.2.3 | ||
* **Internal** | ||
* upgrade to fp-ts v0.1 (@gcanti) | ||
- **Internal** | ||
- upgrade to fp-ts v0.1 (@gcanti) | ||
# 0.2.2 | ||
* **New Feature** | ||
* add `partial` combinator (makes optional props possible) | ||
* add `readonly` combinator (values are not frozen in production) | ||
* add `readonlyArray` combinator (values are not frozen in production) | ||
* add `never` type | ||
* **Breaking Changes** | ||
* remove `maybe` combinator, can be defined in userland as | ||
- **New Feature** | ||
- add `partial` combinator (makes optional props possible) | ||
- add `readonly` combinator (values are not frozen in production) | ||
- add `readonlyArray` combinator (values are not frozen in production) | ||
- add `never` type | ||
- **Breaking Changes** | ||
- remove `maybe` combinator, can be defined in userland as | ||
```ts | ||
@@ -257,31 +264,31 @@ export function maybe<RT extends t.Any>( | ||
``` | ||
* **Polish** | ||
* export `pathReporterFailure` function from default reporters | ||
* **Bug Fix** | ||
* revert pruning excess properties (see https://github.com/gcanti/io-ts/pull/27 for context) | ||
* revert `intersection` combinator accepting only `InterfaceType`s | ||
* **Experimental** | ||
* Pattern matching / catamorphism for unions | ||
- **Polish** | ||
- export `pathReporterFailure` function from default reporters | ||
- **Bug Fix** | ||
- revert pruning excess properties (see https://github.com/gcanti/io-ts/pull/27 for context) | ||
- revert `intersection` combinator accepting only `InterfaceType`s | ||
- **Experimental** | ||
- Pattern matching / catamorphism for unions | ||
# 0.1.0 | ||
* **New Feature** | ||
- **New Feature** | ||
* add support for jsnext | ||
* add `Integer` type | ||
- add support for jsnext | ||
- add `Integer` type | ||
* **Breaking Changes** | ||
* `t.Object` type. Renamed to `t.Dictionary`, now accepts arrays so is fully equivalent to `{ [key: string]: any }`. | ||
* `t.instanceOf` combinator. Removed. | ||
* `t.object` combinator. Renamed to `t.interface`. `ObjectType` to `InterfaceType`. Excess properties are now pruned. | ||
* `mapping` combinator. Renamed to `dictionary`. `MappingType` to `DictionaryType`. | ||
* `intersection` combinator. Due to the new excess property pruning in `t.interface` now only accept `InterfaceType`s. | ||
* API `isSuccess` removed, use `either.isRight` instead | ||
* API `isFailure` removed, use `either.isLeft` instead | ||
* API `fromValidation` removed | ||
- **Breaking Changes** | ||
- `t.Object` type. Renamed to `t.Dictionary`, now accepts arrays so is fully equivalent to `{ [key: string]: any }`. | ||
- `t.instanceOf` combinator. Removed. | ||
- `t.object` combinator. Renamed to `t.interface`. `ObjectType` to `InterfaceType`. Excess properties are now pruned. | ||
- `mapping` combinator. Renamed to `dictionary`. `MappingType` to `DictionaryType`. | ||
- `intersection` combinator. Due to the new excess property pruning in `t.interface` now only accept `InterfaceType`s. | ||
- API `isSuccess` removed, use `either.isRight` instead | ||
- API `isFailure` removed, use `either.isLeft` instead | ||
- API `fromValidation` removed | ||
# 0.0.2 | ||
* **Bug Fix** | ||
* reverse overloading definitions for unions, intersections and tuples, fix inference bug | ||
- **Bug Fix** | ||
- reverse overloading definitions for unions, intersections and tuples, fix inference bug | ||
@@ -288,0 +295,0 @@ # 0.0.1 |
@@ -483,3 +483,3 @@ "use strict"; | ||
: function (a) { | ||
var s = {}; | ||
var s = __assign({}, a); | ||
for (var i = 0; i < len; i++) { | ||
@@ -593,3 +593,3 @@ var k = keys[i]; | ||
return exports.failures(errors); | ||
}, types.every(function (type) { return type.encode === exports.identity; }) | ||
}, useIdentity(types, len) | ||
? exports.identity | ||
@@ -638,3 +638,3 @@ : function (a) { | ||
return errors.length ? exports.failures(errors) : exports.success(a); | ||
}, types.every(function (type) { return type.encode === exports.identity; }) | ||
}, useIdentity(types, len) | ||
? exports.identity | ||
@@ -700,3 +700,3 @@ : function (a) { | ||
} | ||
}, types.every(function (type) { return type.encode === exports.identity; }) ? exports.identity : function (a) { return types.map(function (type, i) { return type.encode(a[i]); }); }, types); | ||
}, useIdentity(types, len) ? exports.identity : function (a) { return types.map(function (type, i) { return type.encode(a[i]); }); }, types); | ||
} | ||
@@ -880,3 +880,3 @@ exports.tuple = tuple; | ||
} | ||
}, types.every(function (type) { return type.encode === exports.identity; }) ? exports.identity : function (a) { return types[getIndex(a[tag])].encode(a); }, types); | ||
}, useIdentity(types, len) ? exports.identity : function (a) { return types[getIndex(a[tag])].encode(a); }, types); | ||
}; | ||
@@ -883,0 +883,0 @@ // |
{ | ||
"name": "io-ts", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "TypeScript compatible runtime type system for IO validation", | ||
"files": ["lib"], | ||
"files": [ | ||
"lib" | ||
], | ||
"main": "lib/index.js", | ||
@@ -10,13 +12,10 @@ "typings": "lib/index.d.ts", | ||
"lint": "tslint -p tsconfig.json src/**/*.ts test/**/*.ts", | ||
"typings-checker": | ||
"typings-checker --allow-expect-error --project typings-checker/tsconfig.json typings-checker/index.ts", | ||
"jest": "jest", | ||
"prettier": | ||
"prettier --no-semi --single-quote --print-width 120 --parser typescript --list-different \"{src,test}/**/*.ts\"", | ||
"fix-prettier": | ||
"prettier --no-semi --single-quote --print-width 120 --parser typescript --write \"{src,test,examples,exercises}/**/*.ts\"", | ||
"test": "npm run prettier && npm run lint && npm run typings-checker && npm run jest", | ||
"prettier": "prettier --no-semi --single-quote --print-width 120 --parser typescript --list-different \"{src,test}/**/*.ts\"", | ||
"fix-prettier": "prettier --no-semi --single-quote --print-width 120 --parser typescript --write \"{src,test,examples,exercises}/**/*.ts\"", | ||
"test": "npm run prettier && npm run lint && npm run dtslint && npm run jest", | ||
"clean": "rimraf lib/*", | ||
"build": "npm run clean && tsc", | ||
"perf": "node perf/index" | ||
"perf": "node perf/index", | ||
"dtslint": "dtslint dtslint" | ||
}, | ||
@@ -41,4 +40,5 @@ "repository": { | ||
"benchmark": "2.1.4", | ||
"dtslint": "0.3.0", | ||
"jest": "22.4.3", | ||
"prettier": "1.12.1", | ||
"prettier": "1.13.4", | ||
"rimraf": "2.6.2", | ||
@@ -48,7 +48,18 @@ "ts-jest": "22.4.2", | ||
"tslint-config-standard": "7.0.0", | ||
"typescript": "2.9.1", | ||
"typings-checker": "2.0.0" | ||
"typescript": "2.9.1" | ||
}, | ||
"tags": ["typescript", "validation", "inference", "types", "runtime"], | ||
"keywords": ["typescript", "validation", "inference", "types", "runtime"], | ||
"tags": [ | ||
"typescript", | ||
"validation", | ||
"inference", | ||
"types", | ||
"runtime" | ||
], | ||
"keywords": [ | ||
"typescript", | ||
"validation", | ||
"inference", | ||
"types", | ||
"runtime" | ||
], | ||
"jest": { | ||
@@ -65,5 +76,18 @@ "globals": { | ||
"testRegex": "test", | ||
"moduleFileExtensions": ["ts", "js"], | ||
"testPathIgnorePatterns": ["helpers.ts"] | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"js" | ||
], | ||
"testPathIgnorePatterns": [ | ||
"helpers.ts" | ||
], | ||
"coverageThreshold": { | ||
"global": { | ||
"branches": 100, | ||
"functions": 100, | ||
"lines": 100, | ||
"statements": 0 | ||
} | ||
} | ||
} | ||
} |
@@ -13,5 +13,5 @@ [![build status](https://img.shields.io/travis/gcanti/io-ts/master.svg?style=flat-square)](https://travis-ci.org/gcanti/io-ts) | ||
* decode inputs of type `I` (through `decode`) | ||
* encode outputs of type `O` (through `encode`) | ||
* be used as a custom type guard (through `is`) | ||
- decode inputs of type `I` (through `decode`) | ||
- encode outputs of type `O` (through `encode`) | ||
- be used as a custom type guard (through `is`) | ||
@@ -81,3 +81,3 @@ ```ts | ||
The stable version is tested against TypeScript 2.9.x | ||
The stable version is tested against TypeScript 2.7.x+ | ||
@@ -96,4 +96,4 @@ # Error reporters | ||
* `PathReporter: Reporter<Array<string>>` | ||
* `ThrowReporter: Reporter<void>` | ||
- `PathReporter: Reporter<Array<string>>` | ||
- `ThrowReporter: Reporter<void>` | ||
@@ -117,8 +117,8 @@ Example | ||
* [io-ts-types](https://github.com/gcanti/io-ts-types) - A collection of runtime types and combinators for use with | ||
- [io-ts-types](https://github.com/gcanti/io-ts-types) - A collection of runtime types and combinators for use with | ||
io-ts | ||
* [io-ts-reporters](https://github.com/OliverJAsh/io-ts-reporters) - Error reporters for io-ts | ||
* [geojson-iots](https://github.com/pierremarc/geojson-iots) - Runtime types for GeoJSON as defined in rfc7946 made with | ||
- [io-ts-reporters](https://github.com/OliverJAsh/io-ts-reporters) - Error reporters for io-ts | ||
- [geojson-iots](https://github.com/pierremarc/geojson-iots) - Runtime types for GeoJSON as defined in rfc7946 made with | ||
io-ts | ||
* [graphql-to-io-ts](https://github.com/micimize/graphql-to-io-ts) - Generate typescript and cooresponding io-ts types from a graphql | ||
- [graphql-to-io-ts](https://github.com/micimize/graphql-to-io-ts) - Generate typescript and cooresponding io-ts types from a graphql | ||
schema | ||
@@ -383,5 +383,5 @@ | ||
* unique check for free | ||
* better performance | ||
* quick info stays responsive | ||
- unique check for free | ||
- better performance | ||
- quick info stays responsive | ||
@@ -388,0 +388,0 @@ # Known issues |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
2
113338