@fp-ts/optic
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -8,5 +8,5 @@ "use strict"; | ||
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 E = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Either")); | ||
var _Function = /*#__PURE__*/require("@effect/data/Function"); | ||
var O = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Option")); | ||
var Optic = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/optic")); | ||
@@ -13,0 +13,0 @@ 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 | ||
*/ | ||
import type { Either } from "@fp-ts/core/Either"; | ||
import type { Either } from "@effect/data/Either"; | ||
import type { PolyPrism, Prism } from "@fp-ts/optic"; | ||
@@ -6,0 +6,0 @@ /** |
@@ -7,3 +7,3 @@ "use strict"; | ||
exports.right = exports.left = void 0; | ||
var E = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Either")); | ||
var E = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Either")); | ||
var Optic = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/optic")); | ||
@@ -10,0 +10,0 @@ 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); } |
@@ -5,3 +5,3 @@ /** | ||
import type { HashMap } from "@effect/data/HashMap"; | ||
import type { Option } from "@fp-ts/core/Option"; | ||
import type { Option } from "@effect/data/Option"; | ||
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 _Function = /*#__PURE__*/require("@effect/data/Function"); | ||
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 O = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Option")); | ||
var Optic = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/optic")); | ||
@@ -12,0 +12,0 @@ var _Index = /*#__PURE__*/require("@fp-ts/optic/typeclass/Index"); |
@@ -1,2 +0,2 @@ | ||
import type { Option } from "@fp-ts/core/Option"; | ||
import type { Option } from "@effect/data/Option"; | ||
import type { Prism } from "@fp-ts/optic"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -7,4 +7,4 @@ "use strict"; | ||
exports.none = void 0; | ||
var E = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Either")); | ||
var O = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Option")); | ||
var E = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Either")); | ||
var O = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Option")); | ||
var Optic = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/optic")); | ||
@@ -11,0 +11,0 @@ 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 | ||
*/ | ||
import type { NonEmptyReadonlyArray } from "@fp-ts/core/ReadonlyArray"; | ||
import type { NonEmptyReadonlyArray } from "@effect/data/ReadonlyArray"; | ||
import type { Iso, PolyIso } from "@fp-ts/optic"; | ||
@@ -6,0 +6,0 @@ /** |
@@ -7,3 +7,3 @@ "use strict"; | ||
exports.consNonEmpty = void 0; | ||
var RA = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/ReadonlyArray")); | ||
var RA = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/ReadonlyArray")); | ||
var Optic = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/optic")); | ||
@@ -10,0 +10,0 @@ 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 | ||
*/ | ||
import type { Option } from "@effect/data/Option"; | ||
import * as SM from "@effect/data/SortedMap"; | ||
import type { SortedMap } from "@effect/data/SortedMap"; | ||
import type { Option } from "@fp-ts/core/Option"; | ||
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 _Function = /*#__PURE__*/require("@effect/data/Function"); | ||
var O = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Option")); | ||
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 Optic = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/optic")); | ||
@@ -12,0 +12,0 @@ var _Index = /*#__PURE__*/require("@fp-ts/optic/typeclass/Index"); |
@@ -7,4 +7,4 @@ "use strict"; | ||
exports.index = void 0; | ||
var E = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Either")); | ||
var String = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/String")); | ||
var E = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Either")); | ||
var String = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/String")); | ||
var Optic = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/optic")); | ||
@@ -11,0 +11,0 @@ 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); } |
@@ -1,3 +0,3 @@ | ||
import type { Kind, TypeLambda } from "@fp-ts/core/HKT"; | ||
import type { Applicative } from "@fp-ts/core/typeclass/Applicative"; | ||
import type { Kind, TypeLambda } from "@effect/data/HKT"; | ||
import type { Applicative } from "@effect/data/typeclass/Applicative"; | ||
import type { Lens, PolyOptional } from "@fp-ts/optic"; | ||
@@ -4,0 +4,0 @@ /** |
@@ -9,4 +9,4 @@ "use strict"; | ||
exports.zoom = void 0; | ||
var E = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Either")); | ||
var _Function = /*#__PURE__*/require("@fp-ts/core/Function"); | ||
var E = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Either")); | ||
var _Function = /*#__PURE__*/require("@effect/data/Function"); | ||
var Optic = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/optic")); | ||
@@ -13,0 +13,0 @@ 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 | ||
*/ | ||
import type { Either } from "@fp-ts/core/Either"; | ||
import * as O from "@fp-ts/core/Option"; | ||
import type { Option } from "@fp-ts/core/Option"; | ||
import type { Predicate, Refinement } from "@fp-ts/core/Predicate"; | ||
import type { ReadonlyRecord } from "@fp-ts/core/ReadonlyRecord"; | ||
import type { Either } from "@effect/data/Either"; | ||
import * as O from "@effect/data/Option"; | ||
import type { Option } from "@effect/data/Option"; | ||
import type { Predicate, Refinement } from "@effect/data/Predicate"; | ||
import type { ReadonlyRecord } from "@effect/data/ReadonlyRecord"; | ||
/** | ||
@@ -10,0 +10,0 @@ * @since 1.0.0 |
14
index.js
@@ -7,8 +7,8 @@ "use strict"; | ||
exports.traversal = exports.tail = exports.reversedPrism = exports.reversedFilter = exports.replaceOption = exports.replace = exports.prism = exports.polyTraversal = exports.polyReversedPrism = exports.polyPrism = exports.polyOptional = exports.optional = exports.modify = exports.lens = exports.iso = exports.indexes = exports.id = exports.head = exports.getOrModify = exports.getOption = exports.get = exports.findFirst = exports.encode = exports.decode = exports.cons = void 0; | ||
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 RA = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/ReadonlyArray")); | ||
var RR = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/ReadonlyRecord")); | ||
var S = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Struct")); | ||
var E = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Either")); | ||
var _Function = /*#__PURE__*/require("@effect/data/Function"); | ||
var O = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Option")); | ||
var RA = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/ReadonlyArray")); | ||
var RR = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/ReadonlyRecord")); | ||
var S = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Struct")); | ||
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); } | ||
@@ -123,3 +123,3 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
exports.prism = prism; | ||
const cons = () => prism(s => RA.isNonEmpty(s) ? E.right([s[0], s.slice(1)]) : E.left(new Error("Expected a non empty array")), ([head, tail]) => [head, ...tail]); | ||
const cons = () => prism(s => RA.isNonEmptyReadonlyArray(s) ? E.right([s[0], s.slice(1)]) : E.left(new Error("Expected a non empty array")), ([head, tail]) => [head, ...tail]); | ||
/** | ||
@@ -126,0 +126,0 @@ * @since 1.0.0 |
{ | ||
"name": "@fp-ts/optic", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"license": "MIT", | ||
@@ -10,4 +10,3 @@ "repository": { | ||
"dependencies": { | ||
"@effect/data": "^0.1.2", | ||
"@fp-ts/core": "~0.2.1" | ||
"@effect/data": "^0.2.0" | ||
}, | ||
@@ -14,0 +13,0 @@ "main": "./index.js", |
@@ -33,3 +33,3 @@ <h3 align="center"> | ||
- **Unified Representation Of Optics**. All optics compose the same way because they are all instances of the same data type (`Optic`) | ||
- **Integration**. Built-in optics for `@fp-ts/core` data structures, like `Option` and `Either`. | ||
- **Integration**. Built-in optics for `@effect/data` data structures, like `Option` and `Either`. | ||
@@ -40,3 +40,3 @@ ## Introduction | ||
`@fp-ts/optic` features a unified representation of optics, deep `@fp-ts/core` integration, helpful error messages. | ||
`@fp-ts/optic` features a unified representation of optics, deep `@effect/data` integration, helpful error messages. | ||
@@ -90,3 +90,3 @@ # Credits and sponsorship | ||
```ts | ||
import * as O from "@fp-ts/core/Option"; | ||
import * as O from "@effect/data/Option"; | ||
@@ -144,3 +144,3 @@ interface Street { | ||
import * as StringOptic from "@fp-ts/optic/data/String"; | ||
import * as String from "@fp-ts/core/String"; | ||
import * as String from "@effect/data/String"; | ||
@@ -325,3 +325,3 @@ const _firstChar: Optic.Optional<Employee, string> = Optic.id<Employee>() | ||
```ts | ||
import { pipe } from "@fp-ts/core/Function"; | ||
import { pipe } from "@effect/data/Function"; | ||
import * as Optic from "@fp-ts/optic"; | ||
@@ -364,3 +364,3 @@ | ||
```ts | ||
import { pipe } from "@fp-ts/core/Function"; | ||
import { pipe } from "@effect/data/Function"; | ||
import * as Optic from "@fp-ts/optic"; | ||
@@ -403,3 +403,3 @@ | ||
```ts | ||
import { pipe } from "@fp-ts/core/Function"; | ||
import { pipe } from "@effect/data/Function"; | ||
import * as Optic from "@fp-ts/optic"; | ||
@@ -445,3 +445,3 @@ | ||
```ts | ||
import { pipe } from "@fp-ts/core/Function"; | ||
import { pipe } from "@effect/data/Function"; | ||
import * as Optic from "@fp-ts/optic"; | ||
@@ -486,5 +486,5 @@ | ||
```ts | ||
import { pipe } from "@fp-ts/core/Function"; | ||
import { pipe } from "@effect/data/Function"; | ||
import * as Optic from "@fp-ts/optic"; | ||
import type { Option } from "@fp-ts/core/Option"; | ||
import type { Option } from "@effect/data/Option"; | ||
@@ -526,5 +526,5 @@ // This is the type of the data structure that the prism will be operating on. | ||
```ts | ||
import { pipe } from "@fp-ts/core/Function"; | ||
import { pipe } from "@effect/data/Function"; | ||
import * as Optic from "@fp-ts/optic"; | ||
import type { Option } from "@fp-ts/core/Option"; | ||
import type { Option } from "@effect/data/Option"; | ||
@@ -544,4 +544,4 @@ const _nonNullString: Optic.Prism<string | null, string> = Optic.id< | ||
```ts | ||
import { pipe } from "@fp-ts/core/Function"; | ||
import * as O from "@fp-ts/core/Option"; | ||
import { pipe } from "@effect/data/Function"; | ||
import * as O from "@effect/data/Option"; | ||
import * as Optic from "@fp-ts/optic"; | ||
@@ -566,5 +566,5 @@ | ||
```ts | ||
import { pipe } from "@fp-ts/core/Function"; | ||
import { pipe } from "@effect/data/Function"; | ||
import * as Optic from "@fp-ts/optic"; | ||
import type { Option } from "@fp-ts/core/Option"; | ||
import type { Option } from "@effect/data/Option"; | ||
@@ -588,4 +588,4 @@ const _index2: Optic.Optional<ReadonlyArray<number>, number> = Optic.id< | ||
```ts | ||
import { pipe } from "@fp-ts/core/Function"; | ||
import type { Option } from "@fp-ts/core/Option"; | ||
import { pipe } from "@effect/data/Function"; | ||
import type { Option } from "@effect/data/Option"; | ||
import * as Optic from "@fp-ts/optic"; | ||
@@ -592,0 +592,0 @@ |
/** | ||
* @since 1.0.0 | ||
*/ | ||
import type { Option } from "@fp-ts/core/Option"; | ||
import type { Option } from "@effect/data/Option"; | ||
import type { Lens } from "@fp-ts/optic"; | ||
@@ -6,0 +6,0 @@ /** |
@@ -7,3 +7,3 @@ "use strict"; | ||
exports.remove = void 0; | ||
var O = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Option")); | ||
var O = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Option")); | ||
var Optic = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/optic")); | ||
@@ -10,0 +10,0 @@ 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 | ||
*/ | ||
import type { Option } from "@fp-ts/core/Option"; | ||
import type { Option } from "@effect/data/Option"; | ||
import type { Optional } from "@fp-ts/optic"; | ||
@@ -6,0 +6,0 @@ import type { At } from "@fp-ts/optic/typeclass/At"; |
@@ -7,4 +7,4 @@ "use strict"; | ||
exports.fromAt = void 0; | ||
var E = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Either")); | ||
var _Function = /*#__PURE__*/require("@fp-ts/core/Function"); | ||
var E = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Either")); | ||
var _Function = /*#__PURE__*/require("@effect/data/Function"); | ||
var Optic = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/optic")); | ||
@@ -11,0 +11,0 @@ 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); } |
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
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
Sorry, the diff of this file is not supported yet
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
164510
1
+ Added@effect/data@0.2.0(transitive)
- Removed@fp-ts/core@~0.2.1
- Removed@effect/data@0.1.3(transitive)
- Removed@fp-ts/core@0.2.1(transitive)
Updated@effect/data@^0.2.0