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

parser-ts

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

parser-ts - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

8

CHANGELOG.md

@@ -15,2 +15,10 @@ # Changelog

# 0.1.0
- **Breaking Change**
- upgrade to latest `fp-ts` (`parser-ts` APIs are not changed though) (@gcanti)
- drop `lib-jsnext` folder
- **Polish**
- use fp-ts's `applySecond` (@gcanti)
# 0.0.2

@@ -17,0 +25,0 @@

5

lib/index.d.ts

@@ -14,6 +14,6 @@ import { FantasyMonad } from 'fp-ts/lib/Monad';

export declare type URI = typeof URI;
export declare type ParseFailure = {
export interface ParseFailure {
remaining: string;
message: string;
};
}
export declare type ParseSuccess<A> = [A, string];

@@ -25,2 +25,3 @@ export declare type ParseResult<A> = Either<ParseFailure, ParseSuccess<A>>;

static zero: typeof zero;
readonly _A: A;
readonly _URI: URI;

@@ -27,0 +28,0 @@ constructor(value: (s: string) => ParseResult<A>);

8

lib/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var function_1 = require("fp-ts/lib/function");
var Apply_1 = require("fp-ts/lib/Apply");
var Either_1 = require("fp-ts/lib/Either");

@@ -230,6 +230,2 @@ var NonEmptyArray_1 = require("fp-ts/lib/NonEmptyArray");

exports.sepBy = sepBy;
// to remove when lending in fp-ts
function applySecond(apply) {
return function (fa, fb) { return apply.ap(apply.map(function () { return function_1.identity; }, fa), fb); };
}
/** Matches both parsers and return the value of the second

@@ -239,3 +235,3 @@ */

return new Parser(function (s) {
return applySecond({ URI: exports.URI, map: map, ap: ap })(pa, pb).run(s);
return Apply_1.applySecond({ URI: exports.URI, map: map, ap: ap })(pa, pb).run(s);
});

@@ -242,0 +238,0 @@ }

import { HKT, HKTS } from 'fp-ts/lib/HKT';
import { Option } from 'fp-ts/lib/Option';
import { StaticFoldable } from 'fp-ts/lib/Foldable';
import { Foldable } from 'fp-ts/lib/Foldable';
import { Parser } from '.';

@@ -16,3 +16,3 @@ /** Matches the given parser zero or more times, returning a string of the

export declare function string(prefix: string): Parser<string>;
export declare function oneOfF<F extends HKTS>(foldable: StaticFoldable<F>): (fs: HKT<string>[F]) => Parser<string>;
export declare function oneOfF<F extends HKTS>(foldable: Foldable<F>): (fs: HKT<string>[F]) => Parser<string>;
/** Matches one of a list of strings. */

@@ -19,0 +19,0 @@ export declare function oneOf(ss: Array<string>): Parser<string>;

{
"name": "parser-ts",
"version": "0.0.2",
"version": "0.1.0",
"description": "String parser combinators for TypeScript",
"files": [
"lib",
"lib-jsnext"
"lib"
],
"main": "lib/index.js",
"jsnext:main": "lib-jsnext/index.js",
"typings": "lib/index.d.ts",

@@ -17,4 +15,4 @@ "scripts": {

"test": "npm run lint && npm run typings-checker && npm run mocha",
"clean": "rm -rf lib/* && rm -rf lib-jsnext/*",
"build": "npm run clean && tsc && tsc -m es6 --outDir lib-jsnext"
"clean": "rm -rf lib/*",
"build": "npm run clean && tsc"
},

@@ -32,3 +30,3 @@ "repository": {

"dependencies": {
"fp-ts": "^0.2.0"
"fp-ts": "^0.3.0"
},

@@ -42,3 +40,3 @@ "devDependencies": {

"tslint-config-standard": "4.0.0",
"typescript": "2.2.0",
"typescript": "2.3.3",
"typings-checker": "1.1.2"

@@ -45,0 +43,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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