@bjornstar/tomes
Advanced tools
Comparing version 1.0.0-beta.5 to 1.0.0
#Tomes Release Notes | ||
##1.0.0 | ||
* Repeated calls to unTome return the same object | ||
##1.0.0-beta.5 | ||
@@ -4,0 +7,0 @@ * Tomes now have a destroy method |
12
index.js
@@ -72,2 +72,3 @@ // Copyright (C) 2012 Wizcorp, Inc. <info@wizcorp.jp> | ||
__root__: { writable: true, value: hasParentTome ? parent.__root__ : this }, | ||
__untomed__: { writable: true, value: { version: 0, cached: undefined } }, | ||
_events: { configurable: true, writable: true }, | ||
@@ -631,3 +632,12 @@ _eventsCount: { configurable: true, writable: true }, | ||
Tome.prototype.unTome = function () { | ||
return Tome.unTome(this); | ||
if (this.__dirty__ === this.__untomed__.version) { | ||
return this.__untomed__.cached; | ||
} | ||
var cached = Tome.unTome(this); | ||
this.__untomed__.version = this.__dirty__; | ||
this.__untomed__.cached = cached; | ||
return cached; | ||
}; | ||
@@ -634,0 +644,0 @@ |
{ | ||
"name": "@bjornstar/tomes", | ||
"description": "Evented Storage Agnostic Data API", | ||
"version": "1.0.0-beta.5", | ||
"version": "1.0.0", | ||
"author": "Bjorn Stromberg <bjornstar@gmail.com>", | ||
@@ -6,0 +6,0 @@ "maintainers": [ |
@@ -108,1 +108,19 @@ var trueName = require('rumplestiltskin').trueName; | ||
}; | ||
exports.unTomeSelfCache = function (test) { | ||
test.expect(3); | ||
var a = { a: '1', b: false, c: null, d: 1234.5667 }; | ||
var b = Tome.conjure(a); | ||
var c = b.unTome(); | ||
var d = b.unTome(); | ||
test.strictEqual(c, d); | ||
test.notEqual(a, c); | ||
b.set('e', []); | ||
var e = b.unTome(); | ||
test.notEqual(d, e); | ||
test.done(); | ||
}; |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
248234
4898
1