Comparing version 0.4.2 to 0.4.3
@@ -16,2 +16,7 @@ # Changelog | ||
# 0.4.3 | ||
* **New Feature** | ||
* Add n-ary alts combinator, fixes #12 (@danr) | ||
# 0.4.2 | ||
@@ -18,0 +23,0 @@ |
@@ -37,2 +37,3 @@ import { Monoid } from 'fp-ts/lib/Monoid'; | ||
export declare const alt: <A>(fx: Parser<A>, fy: Parser<A>) => Parser<A>; | ||
export declare const alts: <A>(...fs: Parser<A>[]) => Parser<A>; | ||
export declare const zero: <A>() => Parser<A>; | ||
@@ -39,0 +40,0 @@ export declare const emptyString: Parser<string>; |
@@ -50,2 +50,9 @@ "use strict"; | ||
exports.alt = function (fx, fy) { return fx.alt(fy); }; | ||
exports.alts = function () { | ||
var fs = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
fs[_i] = arguments[_i]; | ||
} | ||
return fs.reduce(function (fx, fy) { return fx.alt(fy); }, exports.fail); | ||
}; | ||
exports.zero = function () { return exports.fail; }; | ||
@@ -52,0 +59,0 @@ exports.emptyString = exports.of(''); |
{ | ||
"name": "parser-ts", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "String parser combinators for TypeScript", | ||
@@ -12,3 +12,3 @@ "files": ["lib"], | ||
"typings-checker --allow-expect-error --project typings-checker/tsconfig.json typings-checker/index.ts", | ||
"mocha": "mocha -r ts-node/register test/*.ts", | ||
"mocha": "TS_NODE_CACHE=false mocha -r ts-node/register test/*.ts", | ||
"prettier": | ||
@@ -15,0 +15,0 @@ "prettier --no-semi --single-quote --print-width 120 --parser typescript --list-different \"{src,test}/**/*.ts\"", |
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
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
43997
595