Comparing version 7.0.3 to 7.1.0
(function() { | ||
'use strict'; | ||
var CND, Cupofjoe, Datom, LFT, LFT_nofreeze, MAIN, Multimix, assign, badge, copy, debug, defaults, echo, help, info, isa, jr, p1, p2, rpr, type_of, urge, validate, warn, whisper, | ||
var CND, Cupofjoe, Datom, MAIN, Multimix, assign, badge, copy, debug, defaults, echo, help, info, isa, jr, p1, p2, rpr, type_of, urge, validate, warn, whisper, | ||
indexOf = [].indexOf; | ||
@@ -36,44 +36,7 @@ | ||
LFT = require('letsfreezethat'); | ||
LFT_nofreeze = LFT.nofreeze; | ||
this._copy = LFT_nofreeze._copy.bind(LFT); | ||
({Cupofjoe} = require('cupofjoe')); | ||
//----------------------------------------------------------------------------------------------------------- | ||
this.freeze = function(d) { | ||
if (this.settings.freeze) { | ||
return LFT.freeze(d); | ||
} else { | ||
return LFT_nofreeze.freeze(d); | ||
} | ||
}; | ||
this.thaw = function(d) { | ||
if (this.settings.freeze) { | ||
return LFT.thaw(d); | ||
} else { | ||
return LFT_nofreeze.thaw(d); | ||
} | ||
}; | ||
//----------------------------------------------------------------------------------------------------------- | ||
this.lets = function(original, modifier) { | ||
var draft; | ||
if (!this.settings.freeze) { | ||
draft = this._copy(original); | ||
if (modifier != null) { | ||
modifier(draft); | ||
/* TAINT simplify logic by rewriting as single term without double negatives */ | ||
if (this.settings.dirty) { | ||
if (draft.$dirty === original.dirty) { | ||
draft.$dirty = true; | ||
} | ||
} | ||
} | ||
return draft; | ||
} | ||
//......................................................................................................... | ||
draft = this.thaw(original); | ||
@@ -209,11 +172,5 @@ if (modifier != null) { | ||
this.wrap_datom = function($key, $value) { | ||
var R; | ||
/* TAINT code duplication */ | ||
validate.datom_key($key); | ||
validate.datom_datom($value); | ||
R = assign({}, {$key, $value}); | ||
while ((isa.object(R.$)) && (isa.object(R.$.$))) { | ||
R.$ = copy(R.$.$); | ||
} | ||
return this.freeze(R); | ||
return this.freeze({$key, $value}); | ||
}; | ||
@@ -445,3 +402,6 @@ | ||
validate.datom_settings(settings = {...defaults.settings, ...settings}); | ||
this.settings = LFT.freeze(settings); | ||
this.LFT = require(settings.freeze ? 'letsfreezethat' : 'letsfreezethat/nofreeze'); | ||
this.freeze = this.LFT.freeze; | ||
this.thaw = this.LFT.thaw; | ||
this.settings = this.freeze(settings); | ||
this.VNR = require('./vnr'); | ||
@@ -448,0 +408,0 @@ this.Datom = Datom; |
@@ -1,5 +0,4 @@ | ||
// Generated by CoffeeScript 2.5.1 | ||
(function() { | ||
'use strict'; | ||
var CND, LFT, MAIN, Multimix, Vnr, assign, badge, debug, defaults, echo, help, info, isa, jr, rpr, types, urge, validate, warn, whisper; | ||
var CND, MAIN, Multimix, Vnr, assign, badge, debug, defaults, echo, help, info, isa, jr, rpr, types, urge, validate, warn, whisper; | ||
@@ -36,12 +35,11 @@ //########################################################################################################### | ||
LFT = require('letsfreezethat'); | ||
//----------------------------------------------------------------------------------------------------------- | ||
this.new_vnr = function(source = null) { | ||
if (source != null) { | ||
if (source == null) { | ||
return [0]; | ||
} | ||
if (this.settings.validate) { | ||
validate.vnr(source); | ||
} else { | ||
source = [0]; | ||
} | ||
return assign([], source); | ||
return [...source]; | ||
}; | ||
@@ -92,3 +90,3 @@ | ||
} | ||
R = assign([], d); | ||
R = [...d]; | ||
R[d.length - 1] += delta; | ||
@@ -219,3 +217,3 @@ return R; | ||
} | ||
return (assign([], vnrs)).sort(this._cmp); | ||
return [...vnrs].sort(this._cmp); | ||
}; | ||
@@ -234,3 +232,3 @@ | ||
validate.datom_vnr_settings(settings = {...defaults.vnr_settings, ...settings}); | ||
this.settings = LFT.freeze(settings); | ||
this.settings = (require('letsfreezethat')).freeze(settings); | ||
this.Vnr = Vnr; | ||
@@ -245,4 +243,2 @@ this._cmp = (function() { | ||
return this.cmp_total.bind(this); | ||
default: | ||
throw new Error(`^409883^ internal error: illegal value for settings.ordering: ${rpr(this.settings.ordering)}`); | ||
} | ||
@@ -267,2 +263,2 @@ }).call(this); | ||
//# sourceMappingURL=vnr.js.map | ||
//# sourceMappingURL=vnr.js.map |
{ | ||
"name": "datom", | ||
"version": "7.0.3", | ||
"version": "7.1.0", | ||
"description": "standardized immutable objects in the spirit of datomic, especially suited for use in data pipelines", | ||
@@ -34,6 +34,5 @@ "main": "lib/main.js", | ||
"intertype": "^7.0.2", | ||
"letsfreezethat": "^2.2.5", | ||
"letsfreezethat": "^3.0.3", | ||
"multimix": "^4.1.0" | ||
}, | ||
"devDependencies": {} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
158389
860
1
1
- Removedletsfreezethat@2.2.5(transitive)
Updatedletsfreezethat@^3.0.3