Skip to content

Commit

Permalink
export and rename interfaceType to _interface, fix #57 (#58)
Browse files Browse the repository at this point in the history
* export and rename `interfaceType` to `_interface`, fix #57

* fix typings checker
  • Loading branch information
gcanti authored Jul 8, 2017
1 parent d9bcfc5 commit e809dfc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 24 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
**Note**: Gaps between patch versions are faulty/broken releases.
**Note**: A feature tagged as Experimental is in a high state of flux, you're at risk of it changing without notice.

# 0.5.1

- **Bug Fix**
- export and rename `interfaceType` to `_interface`, fix #57 (@gcanti)

# 0.5.0

- **Breaking Change**
Expand Down
26 changes: 6 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"name": "io-ts",
"version": "0.5.0",
"version": "0.5.1",
"description": "TypeScript compatible runtime type system for IO validation",
"files": [
"lib"
],
"files": ["lib"],
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"scripts": {
Expand Down Expand Up @@ -33,25 +31,13 @@
"@types/mocha": "2.2.38",
"@types/node": "7.0.4",
"mocha": "3.2.0",
"prettier": "^1.4.2",
"prettier": "1.5.2",
"ts-node": "2.0.0",
"tslint": "4.4.2",
"tslint-config-standard": "4.0.0",
"typescript": "^2.2.0",
"typescript": "2.4.0",
"typings-checker": "1.1.2"
},
"tags": [
"typescript",
"validation",
"inference",
"types",
"runtime"
],
"keywords": [
"typescript",
"validation",
"inference",
"types",
"runtime"
]
"tags": ["typescript", "validation", "inference", "types", "runtime"],
"keywords": ["typescript", "validation", "inference", "types", "runtime"]
}
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ export interface InterfaceType<P extends Props> extends Type<InterfaceOf<P>> {
readonly props: P
}

function interfaceType<P extends Props>(props: P, name?: string): InterfaceType<P> {
export function _interface<P extends Props>(props: P, name?: string): InterfaceType<P> {
return {
_A,
_tag: 'InterfaceType',
Expand Down Expand Up @@ -414,7 +414,7 @@ export function partial<P extends Props>(props: P, name?: string): PartialType<P
for (let k in props) {
partials[k] = union([props[k], undefinedType])
}
const type = interfaceType(partials)
const type = _interface(partials)
return {
_A,
_tag: 'PartialType',
Expand Down Expand Up @@ -680,5 +680,5 @@ export {
undefinedType as undefined,
arrayType as Array,
functionType as Function,
interfaceType as interface
_interface as interface
}
2 changes: 1 addition & 1 deletion typings-checker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const x25: TypeOf<typeof RO1> = { name: 1 }
//

const ROA1 = t.readonlyArray(t.number)
// $ExpectError Type 'string' is not assignable to type 'number'
// $ExpectError Type 'number' is not assignable to type 'string'
const x26: TypeOf<typeof ROA1> = ['s']
const x27: TypeOf<typeof ROA1> = [1]
// $ExpectError Index signature in type 'ReadonlyArray<number>' only permits reading
Expand Down

0 comments on commit e809dfc

Please sign in to comment.