Socket
Socket
Sign inDemoInstall

@fp-ts/optic

Package Overview
Dependencies
Maintainers
3
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fp-ts/optic - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

5

data/Chunk.d.ts

@@ -1,2 +0,5 @@

import type { Chunk } from "@fp-ts/data/Chunk";
/**
* @since 1.0.0
*/
import type { Chunk } from "@effect/data/Chunk";
import type { Optional, PolyPrism, Prism } from "@fp-ts/optic";

@@ -3,0 +6,0 @@ /**

6

data/Chunk.js

@@ -7,6 +7,6 @@ "use strict";

exports.tail = exports.index = exports.head = exports.cons = void 0;
var C = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Chunk"));
var E = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Either"));
var _Function = /*#__PURE__*/require("@fp-ts/core/Function");
var O = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Option"));
var C = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Chunk"));
var Optic = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/optic"));

@@ -16,6 +16,2 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

/**
* @since 1.0.0
*/
/**
* An optic that accesses the specified index of a `Chunk`.

@@ -22,0 +18,0 @@ *

/**
* @since 1.0.0
*/
import type { HashMap } from "@effect/data/HashMap";
import type { Option } from "@fp-ts/core/Option";
import type { HashMap } from "@fp-ts/data/HashMap";
import type { At } from "@fp-ts/optic/typeclass/At";

@@ -7,0 +7,0 @@ import type { Index } from "@fp-ts/optic/typeclass/Index";

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

exports.getIndex = exports.getAt = void 0;
var HM = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/HashMap"));
var _Function = /*#__PURE__*/require("@fp-ts/core/Function");
var O = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Option"));
var HM = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/HashMap"));
var Optic = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/optic"));

@@ -12,0 +12,0 @@ var _Index = /*#__PURE__*/require("@fp-ts/optic/typeclass/Index");

/**
* @since 1.0.0
*/
import * as SM from "@effect/data/SortedMap";
import type { SortedMap } from "@effect/data/SortedMap";
import type { Option } from "@fp-ts/core/Option";
import * as SM from "@fp-ts/data/SortedMap";
import type { SortedMap } from "@fp-ts/data/SortedMap";
import type { At } from "@fp-ts/optic/typeclass/At";

@@ -8,0 +8,0 @@ import type { Index } from "@fp-ts/optic/typeclass/Index";

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

exports.getIndex = exports.getAt = void 0;
var SM = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/SortedMap"));
var _Function = /*#__PURE__*/require("@fp-ts/core/Function");
var O = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Option"));
var SM = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/SortedMap"));
var Optic = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/optic"));

@@ -12,0 +12,0 @@ var _Index = /*#__PURE__*/require("@fp-ts/optic/typeclass/Index");

@@ -20,3 +20,3 @@ "use strict";

*/
const prismComposition = that => self => new Builder("prism", getWhole => (0, _Function.pipe)(self.getOptic(getWhole), E.flatMap(getPiece => (0, _Function.pipe)(that.getOptic(getPiece), E.catchAll(([GetError1, SetPiece]) => (0, _Function.pipe)(self.setOptic(SetPiece)(getWhole), E.match(([_, SetWholeAfter]) => E.left([GetError1, SetWholeAfter]), SetWholeAfter => E.left([GetError1, SetWholeAfter]))))))), SetPiece1 => SetWholeBefore => (0, _Function.pipe)(that.setOptic(SetPiece1)(undefined), E.match(([SetError1, SetPiece]) => (0, _Function.pipe)(self.setOptic(SetPiece)(SetWholeBefore), E.match(([_, SetWholeAfter]) => E.left([SetError1, SetWholeAfter]), SetWholeAfter => E.left([SetError1, SetWholeAfter]))), SetPiece => self.setOptic(SetPiece)(SetWholeBefore))));
const prismComposition = that => self => new Builder("prism", getWhole => (0, _Function.pipe)(self.getOptic(getWhole), E.flatMap(getPiece => (0, _Function.pipe)(that.getOptic(getPiece), E.orElse(([GetError1, SetPiece]) => (0, _Function.pipe)(self.setOptic(SetPiece)(getWhole), E.match(([_, SetWholeAfter]) => E.left([GetError1, SetWholeAfter]), SetWholeAfter => E.left([GetError1, SetWholeAfter]))))))), SetPiece1 => SetWholeBefore => (0, _Function.pipe)(that.setOptic(SetPiece1)(undefined), E.match(([SetError1, SetPiece]) => (0, _Function.pipe)(self.setOptic(SetPiece)(SetWholeBefore), E.match(([_, SetWholeAfter]) => E.left([SetError1, SetWholeAfter]), SetWholeAfter => E.left([SetError1, SetWholeAfter]))), SetPiece => self.setOptic(SetPiece)(SetWholeBefore))));
/**

@@ -26,3 +26,3 @@ * Compose two optics when the piece of the whole returned by the first

*/
const lensComposition = that => self => new Builder("lens", s => (0, _Function.pipe)(self.getOptic(s), E.flatMap(a => (0, _Function.pipe)(that.getOptic(a), E.catchAll(([de, b]) => (0, _Function.pipe)(self.setOptic(b)(s), E.match(([_ee, t]) => E.left([de, t]), t => E.left([de, t]))))))), d => s => (0, _Function.pipe)(self.getOptic(s), E.flatMap(a => (0, _Function.pipe)(that.setOptic(d)(a), E.match(([ee, b]) => (0, _Function.pipe)(self.setOptic(b)(s), E.match(([_, t]) => E.left([ee, t]), t => E.left([ee, t]))), b => self.setOptic(b)(s))))));
const lensComposition = that => self => new Builder("lens", s => (0, _Function.pipe)(self.getOptic(s), E.flatMap(a => (0, _Function.pipe)(that.getOptic(a), E.orElse(([de, b]) => (0, _Function.pipe)(self.setOptic(b)(s), E.match(([_ee, t]) => E.left([de, t]), t => E.left([de, t]))))))), d => s => (0, _Function.pipe)(self.getOptic(s), E.flatMap(a => (0, _Function.pipe)(that.setOptic(d)(a), E.match(([ee, b]) => (0, _Function.pipe)(self.setOptic(b)(s), E.match(([_, t]) => E.left([ee, t]), t => E.left([ee, t]))), b => self.setOptic(b)(s))))));
const at = key => lens(s => s[key], b => s => {

@@ -203,3 +203,3 @@ if (Array.isArray(s)) {

exports.traversal = traversal;
const get = optic => s => (0, _Function.pipe)(optic.getOptic(s), E.getOrThrow(_Function.identity));
const get = optic => s => (0, _Function.pipe)(optic.getOptic(s), E.getOrThrowWith(_Function.identity));
/**

@@ -224,3 +224,3 @@ * @since 1.0.0

exports.decode = decode;
const encode = optic => SetPiece => (0, _Function.pipe)(optic.setOptic(SetPiece)(undefined), E.getOrThrow(_Function.identity));
const encode = optic => SetPiece => (0, _Function.pipe)(optic.setOptic(SetPiece)(undefined), E.getOrThrowWith(_Function.identity));
/**

@@ -227,0 +227,0 @@ * @since 1.0.0

{
"name": "@fp-ts/optic",
"version": "0.1.0",
"version": "0.2.0",
"license": "MIT",

@@ -10,4 +10,4 @@ "repository": {

"dependencies": {
"@fp-ts/core": "~0.1.1",
"@fp-ts/data": "~0.1.0"
"@effect/data": "^0.1.2",
"@fp-ts/core": "~0.2.1"
},

@@ -14,0 +14,0 @@ "main": "./index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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