New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

superfly-timeline

Package Overview
Dependencies
Maintainers
2
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

superfly-timeline - npm Package Compare versions

Comparing version 8.2.2-nightly-20211022-093328-5753576.0 to 8.2.2-nightly-20211022-100922-2e7a125.0

4

dist/index.js

@@ -5,4 +5,4 @@ "use strict";

const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./api/enums"), exports);
tslib_1.__exportStar(require("./api/api"), exports);
(0, tslib_1.__exportStar)(require("./api/enums"), exports);
(0, tslib_1.__exportStar)(require("./api/api"), exports);
var resolver_1 = require("./resolver/resolver");

@@ -9,0 +9,0 @@ Object.defineProperty(exports, "Resolver", { enumerable: true, get: function () { return resolver_1.Resolver; } });

@@ -44,8 +44,2 @@ import { InstanceEvent, TimelineObjectInstance, ResolveOptions, ValueWithReference, Cap } from './api/api';

export declare function operateOnArrays(array0: Array<TimelineObjectInstance> | ValueWithReference | null, array1: Array<TimelineObjectInstance> | ValueWithReference | null, operate: (a: ValueWithReference | null, b: ValueWithReference | null) => ValueWithReference | null): Array<TimelineObjectInstance> | ValueWithReference | null;
/**
* Like operateOnArrays, but will multiply the number of elements in array0, with the number of elements in array1
* @param array0
* @param array1
* @param operate
*/
export declare function applyRepeatingInstances(instances: TimelineObjectInstance[], repeatTime0: ValueWithReference | null, options: ResolveOptions): TimelineObjectInstance[];

@@ -52,0 +46,0 @@ /**

@@ -333,40 +333,2 @@ "use strict";

exports.operateOnArrays = operateOnArrays;
/**
* Like operateOnArrays, but will multiply the number of elements in array0, with the number of elements in array1
* @param array0
* @param array1
* @param operate
*/
/*export function operateOnArraysMulti (
array0: Array<TimelineObjectInstance> | Reference | null,
array1: Array<TimelineObjectInstance> | Reference | null,
operate: (a: Reference | null, b: Reference | null) => Reference | null
) {
if (array0 === null) return null
if (_.isArray(array1)) {
let resultArray: Array<TimelineObjectInstance> = []
_.each(array1, (array1Val) => {
const result = operateOnArrays(array0, { value: array1Val.start, references: array1Val.references } , operate)
if (_.isArray(result)) {
resultArray = resultArray.concat(result)
} else if (result !== null) {
resultArray.push({
id: getId(),
start: result.value,
end: (
array1Val.end !== null ?
result.value + (array1Val.end - array1Val.start) :
null
),
references: result.references
})
}
})
return resultArray
} else {
return operateOnArrays(array0, array1, operate)
}
}
*/
function applyRepeatingInstances(instances, repeatTime0, options) {

@@ -373,0 +335,0 @@ if (repeatTime0 === null || !repeatTime0.value)

@@ -25,2 +25,10 @@ "use strict";

obj.seamless + '',
/*
Note: The following properties are ignored, as they don't affect timing or resolving:
* id
* children
* keyframes
* isGroup
* content
*/
];

@@ -27,0 +35,0 @@ return thingsThatMatter.join(',');

@@ -9,3 +9,3 @@ "use strict";

function interpretExpression(expression) {
if (lib_1.isNumeric(expression)) {
if ((0, lib_1.isNumeric)(expression)) {
return parseFloat(expression);

@@ -15,3 +15,3 @@ }

const expressionString = expression;
return lib_1.cacheResult(expressionString, () => {
return (0, lib_1.cacheResult)(expressionString, () => {
const expr = expressionString.replace(new RegExp('([' + REGEXP_OPERATORS + '\\(\\)])', 'g'), ' $1 '); // Make sure there's a space between every operator & operand

@@ -57,3 +57,3 @@ const words = _.compact(expr.split(' '));

const r = simplifyExpression(expr.r);
if (lib_1.isConstant(l) && lib_1.isConstant(r) && _.isNumber(l) && _.isNumber(r)) {
if ((0, lib_1.isConstant)(l) && (0, lib_1.isConstant)(r) && _.isNumber(l) && _.isNumber(r)) {
// The operands can be combined:

@@ -60,0 +60,0 @@ return o === '+'

@@ -23,4 +23,4 @@ "use strict";

throw new Error('resolveTimeline: parameter options missing');
validate_1.validateTimeline(timeline, false);
lib_1.resetId();
(0, validate_1.validateTimeline)(timeline, false);
(0, lib_1.resetId)();
const resolvedTimeline = {

@@ -45,3 +45,3 @@ options: { ...options },

throw Error(`All timelineObjects must be unique! (duplicate: "${obj.id}")`);
const o = lib_1.extendMandadory(_.clone(obj), {
const o = (0, lib_1.extendMandadory)(_.clone(obj), {
resolved: {

@@ -62,3 +62,3 @@ resolved: false,

o.resolved.isKeyframe = true;
common_1.addObjectToResolvedTimeline(resolvedTimeline, o);
(0, common_1.addObjectToResolvedTimeline)(resolvedTimeline, o);
// Add children:

@@ -75,3 +75,3 @@ if (obj.isGroup && obj.children) {

const keyframe = obj.keyframes[i];
const kf2 = lib_1.extendMandadory(_.clone(keyframe), {
const kf2 = (0, lib_1.extendMandadory)(_.clone(keyframe), {
layer: '',

@@ -90,3 +90,3 @@ });

// Figure out which objects has changed since last time
const cache = cache_1.initializeCache(options.cache, resolvedTimeline);
const cache = (0, cache_1.initializeCache)(options.cache, resolvedTimeline);
// Go through all new objects, and determine whether they have changed:

@@ -114,3 +114,3 @@ const allNewObjects = {};

const oldHash = cache.objHashes[obj.id];
const newHash = cache_1.hashTimelineObject(obj);
const newHash = (0, cache_1.hashTimelineObject)(obj);
allNewObjects[obj.id] = true;

@@ -180,3 +180,3 @@ if (!oldHash || oldHash !== newHash) {

// it'll be invalidated anyway
const dependOnReferences = cache_1.getObjectReferences(cachedObj);
const dependOnReferences = (0, cache_1.getObjectReferences)(cachedObj);
for (let i = 0; i < dependOnReferences.length; i++) {

@@ -232,3 +232,3 @@ const ref = dependOnReferences[i];

static resolveAllStates(resolvedTimeline, cache) {
return state_1.resolveStates(resolvedTimeline, cache);
return (0, state_1.resolveStates)(resolvedTimeline, cache);
}

@@ -244,3 +244,3 @@ /**

static getState(resolved, time, eventLimit) {
return state_1.getState(resolved, time, eventLimit);
return (0, state_1.getState)(resolved, time, eventLimit);
}

@@ -262,3 +262,3 @@ }

let newInstances = [];
const repeatingExpr = enable.repeating !== undefined ? expression_1.interpretExpression(enable.repeating) : null;
const repeatingExpr = enable.repeating !== undefined ? (0, expression_1.interpretExpression)(enable.repeating) : null;
const lookedRepeating = lookupExpression(resolvedTimeline, obj, repeatingExpr, 'duration');

@@ -277,3 +277,3 @@ const lookedupRepeating = lookedRepeating.instances;

}
const startExpr = expression_1.simplifyExpression(start);
const startExpr = (0, expression_1.simplifyExpression)(start);
let parentInstances = null;

@@ -284,6 +284,6 @@ let hasParent = false;

hasParent = true;
const lookup = lookupExpression(resolvedTimeline, obj, expression_1.interpretExpression(`#${obj.resolved.parentId}`), 'start');
const lookup = lookupExpression(resolvedTimeline, obj, (0, expression_1.interpretExpression)(`#${obj.resolved.parentId}`), 'start');
parentInstances = lookup.instances; // a start-reference will always return an array, or null
directReferences = directReferences.concat(lookup.allReferences);
if (lib_1.isConstant(startExpr)) {
if ((0, lib_1.isConstant)(startExpr)) {
// Only use parent if the expression resolves to a number (ie doesn't contain any references)

@@ -297,3 +297,3 @@ startRefersToParent = true;

if (startRefersToParent) {
lookedupStarts = lib_1.applyParentInstances(parentInstances, lookedupStarts);
lookedupStarts = (0, lib_1.applyParentInstances)(parentInstances, lookedupStarts);
}

@@ -307,3 +307,3 @@ if (enable.while) {

{
id: lib_1.getId(),
id: (0, lib_1.getId)(),
start: lookedupStarts.value,

@@ -337,3 +337,3 @@ end: null,

instance: {
id: lib_1.getId(),
id: (0, lib_1.getId)(),
start: lookedupStarts.value,

@@ -349,6 +349,6 @@ end: null,

if (enable.end !== undefined) {
const endExpr = expression_1.interpretExpression(enable.end);
const endExpr = (0, expression_1.interpretExpression)(enable.end);
let endRefersToParent = false;
if (obj.resolved.parentId) {
if (lib_1.isConstant(endExpr)) {
if ((0, lib_1.isConstant)(endExpr)) {
// Only use parent if the expression resolves to a number (ie doesn't contain any references)

@@ -364,3 +364,3 @@ endRefersToParent = true;

if (endRefersToParent) {
lookedupEnds = lib_1.applyParentInstances(parentInstances, lookedupEnds);
lookedupEnds = (0, lib_1.applyParentInstances)(parentInstances, lookedupEnds);
}

@@ -384,3 +384,3 @@ if (_.isArray(lookedupEnds)) {

instance: {
id: lib_1.getId(),
id: (0, lib_1.getId)(),
start: lookedupEnds.value,

@@ -397,3 +397,3 @@ end: null,

else if (enable.duration !== undefined) {
const durationExpr = expression_1.interpretExpression(enable.duration);
const durationExpr = (0, expression_1.interpretExpression)(enable.duration);
const lookupDuration = lookupExpression(resolvedTimeline, obj, durationExpr, 'duration');

@@ -421,3 +421,3 @@ let lookedupDuration = lookupDuration.instances;

const time = e.time + tmpLookedupDuration.value;
const references = lib_1.joinReferences(e.references, tmpLookedupDuration.references);
const references = (0, lib_1.joinReferences)(e.references, tmpLookedupDuration.references);
events.push({

@@ -441,3 +441,3 @@ time: time,

}
newInstances = lib_1.convertEventsToInstances(events, false);
newInstances = (0, lib_1.convertEventsToInstances)(events, false);
}

@@ -455,3 +455,3 @@ if (hasParent) {

// If the child refers to its parent, there should be one specific instance to cap into
const cappedInstance = lib_1.capInstances([instance], [referredParentInstance])[0];
const cappedInstance = (0, lib_1.capInstances)([instance], [referredParentInstance])[0];
if (cappedInstance) {

@@ -472,3 +472,3 @@ if (!cappedInstance.caps)

const parentInstance = parentInstances[i];
const cappedInstance = lib_1.capInstances([instance], [parentInstance])[0];
const cappedInstance = (0, lib_1.capInstances)([instance], [parentInstance])[0];
if (cappedInstance) {

@@ -492,3 +492,3 @@ if (parentInstance) {

}
newInstances = lib_1.applyRepeatingInstances(newInstances, lookedupRepeating, resolvedTimeline.options);
newInstances = (0, lib_1.applyRepeatingInstances)(newInstances, lookedupRepeating, resolvedTimeline.options);
instances = instances.concat(newInstances);

@@ -500,3 +500,3 @@ }

if (ids[instance.id]) {
instance.id = `${instance.id}_${lib_1.getId()}`;
instance.id = `${instance.id}_${(0, lib_1.getId)()}`;
}

@@ -506,3 +506,3 @@ ids[instance.id] = true;

if (obj.seamless && instances.length > 1) {
instances = lib_1.cleanInstances(instances, true, false);
instances = (0, lib_1.cleanInstances)(instances, true, false);
}

@@ -570,3 +570,3 @@ obj.resolved.resolved = true;

return { instances: null, allReferences: [] };
if (_.isString(expr) && lib_1.isNumeric(expr)) {
if (_.isString(expr) && (0, lib_1.isNumeric)(expr)) {
return {

@@ -591,3 +591,3 @@ instances: {

expr = expr.trim();
if (lib_1.isConstant(expr)) {
if ((0, lib_1.isConstant)(expr)) {
if (expr.match(/^true$/i)) {

@@ -698,3 +698,3 @@ return {

value: duration,
references: lib_1.joinReferences(referencedObj.id, firstInstance.references),
references: (0, lib_1.joinReferences)(referencedObj.id, firstInstance.references),
});

@@ -740,6 +740,6 @@ }

if (invert) {
returnInstances = lib_1.invertInstances(returnInstances);
returnInstances = (0, lib_1.invertInstances)(returnInstances);
}
else {
returnInstances = lib_1.cleanInstances(returnInstances, true, true);
returnInstances = (0, lib_1.cleanInstances)(returnInstances, true, true);
}

@@ -777,3 +777,3 @@ if (ignoreFirstIfZero) {

return {
instances: lib_1.invertInstances(lookupExpr.r),
instances: (0, lib_1.invertInstances)(lookupExpr.r),
allReferences: allReferences,

@@ -826,3 +826,3 @@ };

addEvents(lookupExpr.r, false);
events = lib_1.sortEvents(events);
events = (0, lib_1.sortEvents)(events);
const calcResult = lookupExpr.o === '&'

@@ -835,4 +835,4 @@ ? (left, right) => !!(left && right)

};
let leftValue = lib_1.isReference(lookupExpr.l) ? !!lookupExpr.l.value : false;
let rightValue = lib_1.isReference(lookupExpr.r) ? !!lookupExpr.r.value : false;
let leftValue = (0, lib_1.isReference)(lookupExpr.l) ? !!lookupExpr.l.value : false;
let rightValue = (0, lib_1.isReference)(lookupExpr.r) ? !!lookupExpr.r.value : false;
let leftInstance = null;

@@ -845,3 +845,3 @@ let rightInstance = null;

instances.push({
id: lib_1.getId(),
id: (0, lib_1.getId)(),
start: time,

@@ -861,3 +861,3 @@ end: null,

};
updateInstance(0, resultValue, lib_1.joinReferences(lib_1.isReference(lookupExpr.l) ? lookupExpr.l.references : [], lib_1.isReference(lookupExpr.r) ? lookupExpr.r.references : []), []);
updateInstance(0, resultValue, (0, lib_1.joinReferences)((0, lib_1.isReference)(lookupExpr.l) ? lookupExpr.l.references : [], (0, lib_1.isReference)(lookupExpr.r) ? lookupExpr.r.references : []), []);
for (let i = 0; i < events.length; i++) {

@@ -878,3 +878,3 @@ const e = events[i];

if (newResultValue !== resultValue) {
updateInstance(e.time, newResultValue, lib_1.joinReferences(leftInstance ? leftInstance.references : [], rightInstance ? rightInstance.references : []), resultCaps);
updateInstance(e.time, newResultValue, (0, lib_1.joinReferences)(leftInstance ? leftInstance.references : [], rightInstance ? rightInstance.references : []), resultCaps);
resultValue = newResultValue;

@@ -891,3 +891,3 @@ }

value: a.value + b.value,
references: lib_1.joinReferences(a.references, b.references),
references: (0, lib_1.joinReferences)(a.references, b.references),
};

@@ -899,3 +899,3 @@ }

value: a.value - b.value,
references: lib_1.joinReferences(a.references, b.references),
references: (0, lib_1.joinReferences)(a.references, b.references),
};

@@ -907,3 +907,3 @@ }

value: a.value * b.value,
references: lib_1.joinReferences(a.references, b.references),
references: (0, lib_1.joinReferences)(a.references, b.references),
};

@@ -915,3 +915,3 @@ }

value: a.value / b.value,
references: lib_1.joinReferences(a.references, b.references),
references: (0, lib_1.joinReferences)(a.references, b.references),
};

@@ -923,3 +923,3 @@ }

value: a.value % b.value,
references: lib_1.joinReferences(a.references, b.references),
references: (0, lib_1.joinReferences)(a.references, b.references),
};

@@ -933,3 +933,3 @@ }

};
const result = lib_1.operateOnArrays(lookupExpr.l, lookupExpr.r, operate);
const result = (0, lib_1.operateOnArrays)(lookupExpr.l, lookupExpr.r, operate);
return { instances: result, allReferences: allReferences };

@@ -936,0 +936,0 @@ }

@@ -212,3 +212,3 @@ "use strict";

// Cap the old instance, so it'll end at this point in time:
lib_1.setInstanceEndTime(prevObj.instance, time);
(0, lib_1.setInstanceEndTime)(prevObj.instance, time);
// Update activeObjIds:

@@ -241,3 +241,3 @@ delete activeObjIds[prevObj.id];

};
common_1.addObjectToResolvedTimeline(resolvedStates, newObj);
(0, common_1.addObjectToResolvedTimeline)(resolvedStates, newObj);
}

@@ -393,3 +393,3 @@ const newInstance = {

if (parent) {
obj.resolved.instances = lib_1.cleanInstances(lib_1.capInstances(obj.resolved.instances, parent.resolved.instances), false, false);
obj.resolved.instances = (0, lib_1.cleanInstances)((0, lib_1.capInstances)(obj.resolved.instances, parent.resolved.instances), false, false);
}

@@ -407,3 +407,3 @@ }

// Cap the keyframe instances within its parents instances:
keyframe.resolved.instances = lib_1.capInstances(keyframe.resolved.instances, parent.resolved.instances);
keyframe.resolved.instances = (0, lib_1.capInstances)(keyframe.resolved.instances, parent.resolved.instances);
// Ensure sure the instances are in the state

@@ -428,3 +428,3 @@ for (let i = 0; i < keyframe.resolved.instances.length; i++) {

if (obj.seamless && obj.resolved.instances.length > 1) {
obj.resolved.instances = lib_1.cleanInstances(obj.resolved.instances, true, false);
obj.resolved.instances = (0, lib_1.cleanInstances)(obj.resolved.instances, true, false);
}

@@ -431,0 +431,0 @@ }

{
"name": "superfly-timeline",
"version": "8.2.2-nightly-20211022-093328-5753576.0",
"version": "8.2.2-nightly-20211022-100922-2e7a125.0",
"description": "A collection of rules as well as a resolver for placing objects on a virtual timeline.",

@@ -42,3 +42,3 @@ "license": "MIT",

"docs:test": "yarn docs:html",
"docs:html": "typedoc src/index.ts --excludePrivate --theme minimal --out docs --tsconfig tsconfig.build.json",
"docs:html": "typedoc src/index.ts --excludePrivate --theme default --out docs --tsconfig tsconfig.build.json",
"docs:json": "typedoc --json docs/typedoc.json src/index.ts --tsconfig tsconfig.build.json",

@@ -51,28 +51,6 @@ "docs:publish": "yarn docs:html && gh-pages -d docs",

"validate:dev-dependencies": "yarn audit --groups devDependencies",
"license-validate": "yarn sofie-licensecheck --allowPackages=caniuse-lite@1.0.30001216"
"license-validate": "yarn sofie-licensecheck --allowPackages=caniuse-lite@1.0.30001271"
},
"scripts-info": {
"info": "Display information about the scripts",
"build": "(Clean and re)build the library",
"build:main": "Builds main build command without full clean.",
"lint": "Lint all typescript source files",
"unit": "Build the library and run unit tests",
"test": "Lint, build, and test the library",
"watch": "Watch source files, rebuild library on changes, rerun relevant tests",
"cov": "Run tests, generate the HTML coverage report, and open it in a browser",
"cov-open": "Open current test coverage",
"send-coverage": "send coverage to codecov",
"docs": "Generate HTML API documentation and open it in a browser",
"docs:test": "Running the docs generation for testing.",
"docs:html": "Generate HTML documentation",
"docs:json": "Generate API documentation in typedoc JSON format",
"docs:publish": "Generate HTML API documentation and push it to GitHub Pages",
"changelog": "Bump package.json version, update CHANGELOG.md, tag a release",
"release": "Clean, build, test, publish docs, and prepare release (a one-step publish process). Updates versions and creates git commits.",
"reset": "Delete all untracked files and reset the repo to the last commit",
"validate:dependencies": "Scan dependencies for vulnerabilities and check licenses",
"license-validate": "Validate licenses for dependencies."
},
"engines": {
"node": ">=10.10"
"node": ">=12"
},

@@ -100,17 +78,16 @@ "prettier": "@sofie-automation/code-standard-preset/.prettierrc.json",

"devDependencies": {
"@sofie-automation/code-standard-preset": "^0.2.4",
"@types/jest": "^26.0.22",
"@sofie-automation/code-standard-preset": "^0.4.2",
"@types/jest": "^27.0.2",
"@types/node": "^12.20.10",
"@types/underscore": "^1.11.2",
"codecov": "^3.8.1",
"@types/underscore": "^1.11.3",
"codecov": "^3.8.3",
"fast-clone": "^1.5.13",
"gh-pages": "^3.1.0",
"jest": "^26.6.3",
"npm-scripts-info": "^0.3.9",
"gh-pages": "^3.2.3",
"jest": "^27.3.1",
"open-cli": "^6.0.1",
"rimraf": "^3.0.2",
"standard-version": "^9.2.0",
"ts-jest": "^26.5.5",
"typedoc": "^0.20.36",
"typescript": "~4.0"
"standard-version": "^9.3.2",
"ts-jest": "^27.0.7",
"typedoc": "^0.22.6",
"typescript": "^4.2.0"
},

@@ -117,0 +94,0 @@ "keywords": [

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc