Socket
Socket
Sign inDemoInstall

monocle-ts

Package Overview
Dependencies
1
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.1 to 0.4.2

6

CHANGELOG.md

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

# 0.4.2
- **Polish**
- fix Optional laws (@gcanti)
- remove `Endomorphism` type alias (@gcanti)
# 0.4.1

@@ -17,0 +23,0 @@

32

lib/index.d.ts

@@ -7,3 +7,3 @@ import { HKT, HKTS, HKTAs, HKT2S, HKT2As } from 'fp-ts/lib/HKT';

import { Option } from 'fp-ts/lib/Option';
import { Predicate, Endomorphism } from 'fp-ts/lib/function';
import { Predicate } from 'fp-ts/lib/function';
export declare class Iso<S, A> {

@@ -14,3 +14,3 @@ readonly get: (s: S) => A;

constructor(get: (s: S) => A, reverseGet: (a: A) => S);
modify(f: Endomorphism<A>): Endomorphism<S>;
modify(f: (a: A) => A): (s: S) => S;
/** view an Iso as a Lens */

@@ -65,9 +65,9 @@ asLens(): Lens<S, A>;

readonly get: (s: S) => A;
readonly set: (a: A) => Endomorphism<S>;
readonly set: (a: A) => (s: S) => S;
static fromPath: typeof lensFromPath;
readonly _tag: 'Lens';
constructor(get: (s: S) => A, set: (a: A) => Endomorphism<S>);
constructor(get: (s: S) => A, set: (a: A) => (s: S) => S);
/** generate a lens from a type and a prop */
static fromProp<T, P extends keyof T>(prop: P): Lens<T, T[P]>;
modify(f: Endomorphism<A>): Endomorphism<S>;
modify(f: (a: A) => A): (s: S) => S;
/** view a Lens as a Optional */

@@ -107,4 +107,4 @@ asOptional(): Optional<S, A>;

static some<A>(): Prism<Option<A>, A>;
modify(f: Endomorphism<A>): Endomorphism<S>;
modifyOption(f: Endomorphism<A>): (s: S) => Option<S>;
modify(f: (a: A) => A): (s: S) => S;
modifyOption(f: (a: A) => A): (s: S) => Option<S>;
/** view a Prism as a Optional */

@@ -137,7 +137,7 @@ asOptional(): Optional<S, A>;

readonly getOption: (s: S) => Option<A>;
readonly set: (a: A) => Endomorphism<S>;
readonly set: (a: A) => (s: S) => S;
readonly _tag: 'Optional';
constructor(getOption: (s: S) => Option<A>, set: (a: A) => Endomorphism<S>);
modify(f: Endomorphism<A>): Endomorphism<S>;
modifyOption(f: Endomorphism<A>): (s: S) => Option<S>;
constructor(getOption: (s: S) => Option<A>, set: (a: A) => (s: S) => S);
modify(f: (a: A) => A): (s: S) => S;
modifyOption(f: (a: A) => A): (s: S) => Option<S>;
/** view a Optional as a Traversal */

@@ -170,4 +170,4 @@ asTraversal(): Traversal<S, A>;

constructor(modifyF: <F>(F: Applicative<F>) => (f: (a: A) => HKT<F, A>) => (s: S) => HKT<F, S>);
modify(f: Endomorphism<A>): Endomorphism<S>;
set(a: A): Endomorphism<S>;
modify(f: (a: A) => A): (s: S) => S;
set(a: A): (s: S) => S;
/** view a Traversal as a Fold */

@@ -248,6 +248,6 @@ asFold(): Fold<S, A>;

export declare class Setter<S, A> {
readonly modify: (f: Endomorphism<A>) => Endomorphism<S>;
readonly modify: (f: (a: A) => A) => (s: S) => S;
readonly _tag: 'Setter';
constructor(modify: (f: Endomorphism<A>) => Endomorphism<S>);
set(a: A): Endomorphism<S>;
constructor(modify: (f: (a: A) => A) => (s: S) => S);
set(a: A): (s: S) => S;
/** compose a Setter with a Setter */

@@ -254,0 +254,0 @@ compose<B>(ab: Setter<A, B>): Setter<S, B>;

@@ -278,5 +278,5 @@ "use strict";

Laws:
1. getOption(s).fold(identity, a => set(a, s)) = s
2. getOption(set(a, s)) = getOption(s).map(_ => a)
3. set(a, set(a, s)) = set(a, s)
1. getOption(s).fold(() => s, a => set(a)(s)) = s
2. getOption(set(a)(s)) = getOption(s).map(_ => a)
3. set(a)(set(a)(s)) = set(a)(s)
*/

@@ -283,0 +283,0 @@ var Optional = (function () {

{
"name": "monocle-ts",
"version": "0.4.1",
"version": "0.4.2",
"description": "A porting of scala monocle library to TypeScript",

@@ -5,0 +5,0 @@ "files": ["lib"],

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc