New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

immutable-lens

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

immutable-lens - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

10

lib/ImmutableLens.js

@@ -101,9 +101,13 @@ "use strict";

};
ImmutableLens.prototype.setValue = function (newValue) {
ImmutableLens.prototype.setValue = function () {
var _this = this;
if (newValue === undefined) {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (args.length === 0) {
return function (value) { return _this.setValueUpdater(value); };
}
else {
return this.setValueUpdater(newValue);
return this.setValueUpdater(args[0]);
}

@@ -110,0 +114,0 @@ };

{
"name": "immutable-lens",
"version": "0.3.3",
"version": "0.3.4",
"description": "Type-safe Lens API for immutable updates in complex data structures",

@@ -5,0 +5,0 @@ "keywords": [

@@ -200,7 +200,7 @@ import { cherryPick } from './cherryPick'

public setValue(newValue?: Target) {
if (newValue === undefined) {
public setValue(...args: any[]) {
if (args.length === 0) {
return (value: Target) => this.setValueUpdater(value)
} else {
return this.setValueUpdater(newValue)
return this.setValueUpdater(args[0])
}

@@ -207,0 +207,0 @@ }

@@ -151,2 +151,11 @@ import { expect } from 'chai'

})
it('can set field value to undefined', () => {
const updater = lens.focusPath('user').setValue(undefined)
const updated = updater(source)
expect(updated).to.deep.equal({
...source,
user: undefined,
})
})
})

@@ -153,0 +162,0 @@

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