space-lift
Advanced tools
Comparing version 0.8.1 to 0.8.2
@@ -9,3 +9,3 @@ "use strict"; | ||
var result = this.value().slice(); | ||
if (result.length > index) | ||
if (result.length > index && index > -1) | ||
result[index] = lift_1.getValue(updater(result[index])); | ||
@@ -12,0 +12,0 @@ return new lift_1.ArrayOps(result); |
@@ -28,2 +28,3 @@ "use strict"; | ||
self.type = 'none'; | ||
self.Option = OptionObject; | ||
self.get = function () { return undefined; }; | ||
@@ -50,2 +51,3 @@ self.isDefined = function () { return false; }; | ||
type: 'some', | ||
Option: OptionObject, | ||
get: function () { | ||
@@ -91,3 +93,3 @@ return this.value; | ||
toJSON: function () { | ||
return this.value; | ||
return this.value.toJSON ? this.value.toJSON() : this.value; | ||
} | ||
@@ -94,0 +96,0 @@ }; |
@@ -7,3 +7,3 @@ import { ArrayOps, getValue } from '../lift'; | ||
var result = this.value().slice(); | ||
if (result.length > index) | ||
if (result.length > index && index > -1) | ||
result[index] = getValue(updater(result[index])); | ||
@@ -10,0 +10,0 @@ return new ArrayOps(result); |
@@ -26,2 +26,3 @@ import lift, { getValue } from '../lift'; | ||
self.type = 'none'; | ||
self.Option = OptionObject; | ||
self.get = function () { return undefined; }; | ||
@@ -48,2 +49,3 @@ self.isDefined = function () { return false; }; | ||
type: 'some', | ||
Option: OptionObject, | ||
get: function () { | ||
@@ -89,3 +91,3 @@ return this.value; | ||
toJSON: function () { | ||
return this.value; | ||
return this.value.toJSON ? this.value.toJSON() : this.value; | ||
} | ||
@@ -92,0 +94,0 @@ }; |
{ | ||
"name": "space-lift", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"description": "Idiomatic TS array, object utils, Option, Result monads", | ||
@@ -5,0 +5,0 @@ |
163518
4322