Comparing version 1.1.0 to 2.0.0
10
index.js
@@ -30,3 +30,3 @@ const Strategy = require('@tangle/strategy') | ||
this.isValidProps = InputValidator('props', this.spec.props.composition) | ||
this.isValidProps = InputValidator('props', this.spec.props._composition) | ||
} | ||
@@ -46,3 +46,3 @@ | ||
try { | ||
propsT = this.spec.props.humanToTransform( | ||
propsT = this.spec.props.mapFromInput( | ||
this.spec.props.identity(), | ||
@@ -84,3 +84,3 @@ props | ||
states: tangle.tips | ||
.map(({ key, T }) => ({ key, ...this.spec.props.reify(T) })) | ||
.map(({ key, T }) => ({ key, ...this.spec.props.mapToOutput(T) })) | ||
} | ||
@@ -106,3 +106,3 @@ | ||
...this.spec.props.humanToTransform( | ||
...this.spec.props.mapFromInput( | ||
tip.T, | ||
@@ -153,3 +153,3 @@ props | ||
else if (key === 'allowPublic') acc.allowPublic = value | ||
else if (key in props.composition) acc.props[key] = value | ||
else if (key in props._composition) acc.props[key] = value | ||
else if (key in staticProps) acc.staticProps[key] = value | ||
@@ -156,0 +156,0 @@ else acc.unknown[key] = value |
const pull = require('pull-stream') | ||
const reduce = require('@tangle/reduce') | ||
const Reduce = require('@tangle/reduce') | ||
@@ -40,3 +40,4 @@ module.exports = function tangleTips (server, spec, id, cb) { | ||
const msgs = [root, ...updates] | ||
const reduction = reduce(msgs, spec.props, { | ||
const reduce = new Reduce(spec.props, { | ||
nodes: msgs, | ||
getBacklinks: m => m.value.content.tangles[spec.tangle].previous, | ||
@@ -52,3 +53,3 @@ getTransformation: spec.getTransformation, | ||
const tips = Object.entries(reduction) | ||
const tips = Object.entries(reduce.state) | ||
.map(([key, T]) => ({ key, T })) | ||
@@ -55,0 +56,0 @@ .sort((A, B) => timestamps[B.key] - timestamps[A.key]) |
{ | ||
"name": "ssb-crut", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "easy CRUT methods for secure scuttlebutt", | ||
@@ -29,4 +29,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"@tangle/reduce": "^1.0.3", | ||
"@tangle/strategy": "^1.4.1", | ||
"@tangle/reduce": "^3.0.1", | ||
"@tangle/strategy": "^2.0.1", | ||
"is-my-ssb-valid": "^1.1.0", | ||
@@ -38,4 +38,4 @@ "lodash.merge": "^4.6.2", | ||
"devDependencies": { | ||
"@tangle/complex-set": "^1.2.1", | ||
"@tangle/overwrite": "^1.2.0", | ||
"@tangle/complex-set": "^2.0.0", | ||
"@tangle/overwrite": "^2.0.0", | ||
"scuttle-testbot": "^1.5.1", | ||
@@ -45,4 +45,4 @@ "ssb-backlinks": "^2.1.1", | ||
"ssb-recps-guard": "^2.1.0", | ||
"ssb-tribes": "^0.4.1", | ||
"standard": "^16.0.1", | ||
"ssb-tribes": "^1.1.0", | ||
"standard": "^16.0.3", | ||
"tap-spec": "^5.0.0", | ||
@@ -49,0 +49,0 @@ "tape": "^4.13.3" |
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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
45285
1237
0
+ Added@tangle/graph@2.1.0(transitive)
+ Added@tangle/reduce@3.1.0(transitive)
+ Added@tangle/strategy@2.0.1(transitive)
- Removed@tangle/graph@1.3.1(transitive)
- Removed@tangle/reduce@1.0.3(transitive)
- Removed@tangle/strategy@1.4.1(transitive)
Updated@tangle/reduce@^3.0.1
Updated@tangle/strategy@^2.0.1