@bscotch/gcdata
Advanced tools
Comparing version 0.15.0 to 0.16.0
@@ -29,6 +29,6 @@ import { Pathy } from '@bscotch/pathy'; | ||
get schemas(): PackedData['schemas']; | ||
visitMoteData(moteId: string | Mote, | ||
visitMoteData<R>(moteId: string | Mote, | ||
/** Function to call on every node in the mote data */ | ||
visitor: (ctx: MoteVisitorCtx) => void): void; | ||
visitMoteData<Store>(moteId: string | Mote, visitor: (ctx: MoteVisitorCtx<Store>) => void, store: Store): void; | ||
visitor: (ctx: MoteVisitorCtx, priorVisitorReturn?: R | undefined) => R): R; | ||
visitMoteData<Store, R>(moteId: string | Mote, visitor: (ctx: MoteVisitorCtx<Store>, priorVisitorReturn?: R | undefined) => R, store: Store): R; | ||
getAncestors(ofMoteId: Mote | string, options?: { | ||
@@ -35,0 +35,0 @@ /** If true, circularity will cause an early return of the parents rather than throwing. */ |
@@ -40,5 +40,5 @@ import { pathy } from '@bscotch/pathy'; | ||
}; | ||
const visit = (ctx) => { | ||
const visit = (ctx, priorResult) => { | ||
// Call on this node! | ||
visitor(ctx); | ||
priorResult = visitor(ctx, priorResult); | ||
// Then visit the children | ||
@@ -65,7 +65,7 @@ // Get each data field (there are no arrays, so that simplifies things!) | ||
}; | ||
visit(newCtx); | ||
visit(newCtx, priorResult); | ||
} | ||
} | ||
}; | ||
visit(initialCtx); | ||
visit(initialCtx, undefined); | ||
} | ||
@@ -72,0 +72,0 @@ getAncestors(ofMoteId, options) { |
{ | ||
"name": "@bscotch/gcdata", | ||
"version": "0.15.0", | ||
"version": "0.16.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -0,0 +0,0 @@ # GameChanger Data |
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
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
2652314
107
78959