brisky-struct
Advanced tools
Comparing version 0.0.15 to 0.0.16
@@ -18,3 +18,9 @@ const get = t => t.val !== void 0 ? t.val : t.inherits && get(t.inherits) | ||
if (type === 'object') { | ||
if (val.inherits) { val = compute(val) || val } | ||
if (val.inherits) { | ||
const v = val | ||
val = compute(val) | ||
if (val === void 0) { | ||
val = v | ||
} | ||
} | ||
} else if (type === 'function') { | ||
@@ -21,0 +27,0 @@ val = val(val, passon || t) |
{ | ||
"name": "brisky-struct", | ||
"description": "An observable data structure", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -28,3 +28,5 @@ const test = require('tape') | ||
t.equal(a.get('bye').compute(x), '100?', 'chain to compute') | ||
x.set(void 0) | ||
t.equal(a.compute(x), x, 'undefined when passed a value will return the struct') | ||
t.end() | ||
}) |
340168
6310