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.0 to 0.3.1

6

lib/ImmutableLens.d.ts

@@ -27,5 +27,9 @@ import { FieldLenses, FieldsUpdater, FieldUpdaters, FieldValues, Lens, UnfocusedLens, Updater } from './Lens';

recompose<Composition>(fieldLenses: FieldLenses<Target, Composition>): Lens<Source, Composition>;
setValue(value: Target): (source: Source) => Source;
setValue(newValue: Target): Updater<Source>;
setValue(): (newValue: Target) => Updater<Source>;
private setValueUpdater(value);
update(updater: Updater<Target>): Updater<Source>;
setFields(newValues: FieldValues<Target>): Updater<Source>;
setFields(): (newValues: FieldValues<Target>) => Updater<Source>;
private setFieldsUpdater(newValues);
updateFields(updaters: FieldUpdaters<Target>): Updater<Source>;

@@ -32,0 +36,0 @@ updatePartial(fieldsUpdater: FieldsUpdater<Target>): Updater<Source>;

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

};
/////////////
// UPDATE //
///////////
ImmutableLens.prototype.setValue = function (value) {
ImmutableLens.prototype.setValue = function (newValue) {
var _this = this;
if (newValue === undefined) {
return function (value) { return _this.setValueUpdater(value); };
}
else {
return this.setValueUpdater(newValue);
}
};
ImmutableLens.prototype.setValueUpdater = function (value) {
var _this = this;
var updater = function (source) {

@@ -129,2 +135,11 @@ var parentTarget = _this.readParentTargetFromSource(source);

var _this = this;
if (newValues === undefined) {
return function (values) { return _this.setFieldsUpdater(values); };
}
else {
return this.setFieldsUpdater(newValues);
}
};
ImmutableLens.prototype.setFieldsUpdater = function (newValues) {
var _this = this;
var updater = function (source) {

@@ -131,0 +146,0 @@ var currentTarget = _this.read(source);

@@ -28,4 +28,6 @@ export interface NotAnArray {

setValue(newValue: Target): Updater<Source>;
setValue(): (newValue: Target) => Updater<Source>;
update(updater: Updater<Target>): Updater<Source>;
setFields(this: Lens<Source, Target & NotAnArray>, newValues: FieldValues<Target>): Updater<Source>;
setFields(this: Lens<Source, Target & NotAnArray>): (newValues: FieldValues<Target>) => Updater<Source>;
updateFields(this: Lens<Source, Target & NotAnArray>, updaters: FieldUpdaters<Target>): Updater<Source>;

@@ -32,0 +34,0 @@ updatePartial(this: Lens<Source, Target & NotAnArray>, fieldsUpdater: FieldsUpdater<Target>): Updater<Source>;

2

package.json
{
"name": "immutable-lens",
"version": "0.3.0",
"version": "0.3.1",
"description": "Type-safe Lens API for immutable updates in complex data structures",

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

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