change-buffer
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -1,29 +0,26 @@ | ||
"use strict"; | ||
var fp_1 = require('lodash/fp'); | ||
var ChangeBuffer = (function () { | ||
function ChangeBuffer(object) { | ||
import { set, get } from 'lodash/fp'; | ||
export class ChangeBuffer { | ||
constructor(object) { | ||
this.object = this.buffer = object; | ||
} | ||
ChangeBuffer.prototype.isClean = function () { | ||
isClean() { | ||
return this.object === this.buffer; | ||
}; | ||
ChangeBuffer.prototype.isDirty = function () { | ||
} | ||
isDirty() { | ||
return this.object !== this.buffer; | ||
}; | ||
ChangeBuffer.prototype.rollback = function () { | ||
} | ||
rollback() { | ||
this.buffer = this.object; | ||
return this.buffer; | ||
}; | ||
ChangeBuffer.prototype.get = function (path) { | ||
return fp_1.get(path, this.buffer); | ||
}; | ||
ChangeBuffer.prototype.set = function (path, newValue) { | ||
this.buffer = fp_1.set(path, newValue, this.buffer); | ||
}; | ||
ChangeBuffer.prototype.apply = function () { | ||
} | ||
get(path) { | ||
return get(path, this.buffer); | ||
} | ||
set(path, newValue) { | ||
this.buffer = set(path, newValue, this.buffer); | ||
} | ||
apply() { | ||
return this.buffer; | ||
}; | ||
return ChangeBuffer; | ||
}()); | ||
exports.ChangeBuffer = ChangeBuffer; | ||
} | ||
} | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "change-buffer", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Immutable Change Buffers", | ||
@@ -8,5 +8,10 @@ "main": "dist/cjs/index.js", | ||
"typings": "dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"clean": "rm -rf build dist", | ||
"compile": "npm run clean && tsc -p tsconfig-prod.json", | ||
"compile": "npm run clean && npm run build:cjs && npm run build:es6", | ||
"build:cjs": "tsc -p tsconfig-prod.json --outDir dist/cjs", | ||
"build:es6": "tsc -p tsconfig-prod.json -t es6 -m es2015", | ||
"test": "rm -rf build && tsc && ava", | ||
@@ -13,0 +18,0 @@ "test:watch": "npm run test -- --watch" |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
6459
9
101
1