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

partial.lenses

Package Overview
Dependencies
Maintainers
1
Versions
180
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

partial.lenses - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

20

lib/partial.lenses.js

@@ -8,2 +8,4 @@ "use strict";

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };

@@ -211,3 +213,19 @@

L.augment = function (template) {
return _ramda2.default.lens(toPartial(function (x) {
var z = _extends({}, x);
for (var k in template) {
z[k] = template[k](x);
}return z;
}), toConserve(function (y, c) {
if (y === undefined) return undefined;
var z = {};
for (var k in y) {
if (!(k in template)) z[k] = y[k];else if (k in c) z[k] = c[k];
}
return z;
}));
};
exports.default = L;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9wYXJ0aWFsLmxlbnNlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFJQSxJQUFNLFlBQVksU0FBWixTQUFZLENBQUMsQ0FBRCxFQUFJLENBQUosRUFBVTtBQUMxQixNQUFJLE1BQU0sU0FBTixJQUFtQixFQUFFLEtBQUssQ0FBTCxDQUFGLEVBQ3JCLE9BQU8sQ0FBUCxDQURGO0FBRUEsTUFBSSxhQUFKLENBSDBCO0FBSTFCLE9BQUssSUFBTSxDQUFOLElBQVcsQ0FBaEIsRUFBbUI7QUFDakIsUUFBSSxNQUFNLENBQU4sRUFBUztBQUNYLFVBQUksY0FB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Ft4XSwgeHMuc2xpY2UoaSsxKSlcbiAgfVxufSlcblxuTC5hcHBlbmQgPSBSLmxlbnMoKCkgPT4ge30sICh4LCB4cykgPT5cbiAgeCA9PT0gdW5kZWZpbmVkID8geHMgOiB4cyA9PT0gdW5kZWZpbmVkID8gW3hdIDogeHMuY29uY2F0KFt4XSkpXG5cbkwuZmlsdGVyID0gcCA9PiBSLmxlbnMoeHMgPT4geHMgJiYgeHMuZmlsdGVyKHApLCAoeXMsIHhzKSA9PlxuICBjb25zZXJ2ZSh4cywgZHJvcHBlZChSLmNvbmNhdCh5cyB8fCBbXSwgKHhzIHx8IFtdKS5maWx0ZXIoUi5jb21wbGVtZW50KHApKSkpKSlcblxuTC5hdWdtZW50ID0gdGVtcGxhdGUgPT4gUi5sZW5zKFxuICB0b1BhcnRpYWwoeCA9PiB7XG4gICAgY29uc3QgeiA9IHsuLi54fVxuICAgIGZvciAoY29uc3QgayBpbiB0ZW1wbGF0ZSlcbiAgICAgIHpba10gPSB0ZW1wbGF0ZVtrXSh4KVxuICAgIHJldHVybiB6XG4gIH0pLFxuICB0b0NvbnNlcnZlKCh5LCBjKSA9PiB7XG4gICAgaWYgKHkgPT09IHVuZGVmaW5lZClcbiAgICAgIHJldHVybiB1bmRlZmluZWRcbiAgICBjb25zdCB6ID0ge31cbiAgICBmb3IgKGNvbnN0IGsgaW4geSkge1xuICAgICAgaWYgKCEoayBpbiB0ZW1wbGF0ZSkpXG4gICAgICAgIHpba10gPSB5W2tdXG4gICAgICBlbHNlXG4gICAgICAgIGlmIChrIGluIGMpXG4gICAgICAgICAgeltrXSA9IGNba11cbiAgICB9XG4gICAgcmV0dXJuIHpcbiAgfSkpXG5cbmV4cG9ydCBkZWZhdWx0IExcbiJdfQ==

2

package.json
{
"name": "partial.lenses",
"version": "1.0.0",
"version": "1.1.0",
"description": "Ramda compatible lenses",

@@ -5,0 +5,0 @@ "main": "lib/partial.lenses.js",

@@ -277,2 +277,10 @@ [ [Tutorial](#tutorial) | [Reference](#reference) | [Background](#background) ]

#### L.augment({prop: obj => val, ...props})
`L.augment({prop: obj => val, ...props})` is given a template of functions to
compute new properties. When viewing or setting undefined, the result is
undefined. When viewing a defined object, the object is extended with the
computed properties. When set with a defined object, the extended properties
are removed.
#### L.choose(maybeValue => PartialLens)

@@ -279,0 +287,0 @@

@@ -43,3 +43,3 @@ import R from "ramda"

const toConserve = f => (y, c0) => conserve(c0, f(y, c0))
const toConserve = f => (y, c0) => conserve(c0, f(y, c0))

@@ -132,2 +132,23 @@ //

L.augment = template => R.lens(
toPartial(x => {
const z = {...x}
for (const k in template)
z[k] = template[k](x)
return z
}),
toConserve((y, c) => {
if (y === undefined)
return undefined
const z = {}
for (const k in y) {
if (!(k in template))
z[k] = y[k]
else
if (k in c)
z[k] = c[k]
}
return z
}))
export default L

@@ -134,1 +134,8 @@ import R from "ramda"

})
describe("L.augment", () => {
testEq('L.view(L.augment({y: c => c.x+1, z: c => c.x-1}), {x: 0})', {x: 0, y: 1, z: -1})
testEq('L.view(L.augment({y: c => c.x+1}), {x: 2, y: -1})', {x: 2, y: 3})
testEq('L.set(L.augment({y: c => c.x+1}), {x: 1, y: 1}, {x: 0})', {x: 1})
testEq('L.set(L.augment({y: c => c.x+1}), {x: 2, y: 1}, {x: 0, y: -1})', {x: 2, y: -1})
})

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