Comparing version 0.12.3 to 0.13.0
@@ -6,2 +6,21 @@ # Changelog | ||
## 0.13.0 | ||
### New Feature | ||
* Expose `OptionBase` to TypeScript's type definition. | ||
* __NOTICE__: | ||
* In general purpose, __you must not use this object__. | ||
* You can only this object if you need to cooperate with some libralies | ||
like `React.PropTypes` which are use `instanceof` checking to work together with | ||
others in the pure JavaScript world. | ||
The typical case is [TSX (TypeScript JSX) syntax](https://github.com/Microsoft/TypeScript/wiki/JSX). | ||
* Our basic stance is that _you don't use this and need not it in almost case_. | ||
* See also [#77](https://github.com/saneyuki/option-t.js/pull/77) | ||
### Internal | ||
* Support Node.js v4. [#79](https://github.com/saneyuki/option-t.js/pull/79) | ||
## 0.12.3 | ||
@@ -8,0 +27,0 @@ |
@@ -168,3 +168,24 @@ /** | ||
class Some<T> implements Option<T> { | ||
/** | ||
* The base object of `Some<T>` and `None<T>`. | ||
* | ||
* XXX: | ||
* In general case, __we must not use this base object__. | ||
* __Use `Option<T>` interface strongly__. | ||
* | ||
* You can only this object if you need to cooperate with some libralies | ||
* like `React.PropTypes` which are use `instanceof` checking to work together with | ||
* others in the pure JavaScript world. | ||
* | ||
* The typical case is TSX (TypeScript JSX) syntax. | ||
* https://github.com/Microsoft/TypeScript/wiki/JSX | ||
* | ||
* Our basic stance is that _you don't use this and need not it in almost case_. | ||
* | ||
* See also: | ||
* https://github.com/saneyuki/option-t.js/pull/77 | ||
*/ | ||
class OptionBase {} | ||
class Some<T> extends OptionBase implements Option<T> { | ||
constructor(val: T); | ||
@@ -189,3 +210,3 @@ isSome: boolean; | ||
class None<T> implements Option<T> { | ||
class None<T> extends OptionBase implements Option<T> { | ||
constructor(); | ||
@@ -192,0 +213,0 @@ isSome: boolean; |
{ | ||
"name": "option-t", | ||
"version": "0.12.3", | ||
"version": "0.13.0", | ||
"description": "Option type implementation whose APIs are inspired by Rust's `Option<T>`.", | ||
@@ -14,2 +14,6 @@ "main": "src/index.js", | ||
], | ||
"engines": { | ||
"node": ">=0.10", | ||
"iojs": ">=1.0 <4.0" | ||
}, | ||
"scripts": { | ||
@@ -16,0 +20,0 @@ "lint": "eslint ./src/", |
Sorry, the diff of this file is not supported yet
29642
542