superfly-timeline
Advanced tools
Comparing version 8.2.0 to 8.2.1-nightly-20210426-094350-c5ac319.0
import { ResolvedTimelineObject, ResolverCache, ResolverCacheInternal, ResolvedTimeline } from '../api/api'; | ||
export declare function initializeCache(cacheOrg: ResolverCache, resolvedTimeline: ResolvedTimeline): ResolverCacheInternal; | ||
export declare function objectHash(obj: ResolvedTimelineObject): string; | ||
/** Return a "hash-string" which changes whenever anything that affects timing of a timeline-object has changed. */ | ||
export declare function hashTimelineObject(obj: ResolvedTimelineObject): string; | ||
export declare function getObjectReferences(obj: ResolvedTimelineObject): string[]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getObjectReferences = exports.objectHash = exports.initializeCache = void 0; | ||
exports.getObjectReferences = exports.hashTimelineObject = exports.initializeCache = void 0; | ||
function initializeCache(cacheOrg, resolvedTimeline) { | ||
@@ -14,7 +14,7 @@ const cache = cacheOrg; | ||
exports.initializeCache = initializeCache; | ||
function objectHash(obj) { | ||
/** Return a "hash-string" which changes whenever anything that affects timing of a timeline-object has changed. */ | ||
function hashTimelineObject(obj) { | ||
const thingsThatMatter = [ | ||
JSON.stringify(obj.enable), | ||
obj.disabled + '', | ||
// obj.classes && obj.classes.join('_') || '', | ||
obj.priority + '', | ||
@@ -25,6 +25,7 @@ obj.resolved.parentId || '', | ||
obj.layer + '', | ||
obj.seamless + '', | ||
]; | ||
return thingsThatMatter.join(','); | ||
} | ||
exports.objectHash = objectHash; | ||
exports.hashTimelineObject = hashTimelineObject; | ||
function getObjectReferences(obj) { | ||
@@ -31,0 +32,0 @@ return obj.resolved.directReferences; |
@@ -109,3 +109,3 @@ "use strict"; | ||
const oldHash = cache.objHashes[obj.id]; | ||
const newHash = cache_1.objectHash(obj); | ||
const newHash = cache_1.hashTimelineObject(obj); | ||
allNewObjects[obj.id] = true; | ||
@@ -119,2 +119,12 @@ if (!oldHash || oldHash !== newHash) { | ||
} | ||
else { | ||
// No timing-affecting changes detected | ||
// Even though the timeline-properties hasn't changed, | ||
// the content (and other properties) might have: | ||
const oldObj = cache.resolvedTimeline.objects[obj.id]; | ||
cache.resolvedTimeline.objects[obj.id] = { | ||
...obj, | ||
resolved: oldObj.resolved, | ||
}; | ||
} | ||
}); | ||
@@ -121,0 +131,0 @@ if (cache.hasOldData) { |
{ | ||
"name": "superfly-timeline", | ||
"version": "8.2.0", | ||
"version": "8.2.1-nightly-20210426-094350-c5ac319.0", | ||
"description": "A collection of rules as well as a resolver for placing objects on a virtual timeline.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
280528
2800
1