@remotion/gif 3.3.35 → 3.3.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CondFunction, ParseFun, Result, Stream } from './types';
|
|
2
|
+
export declare const parse: (stream: Stream, schema: any, result?: Result, parent?: Result) => Result;
|
|
3
|
+
export declare const conditional: (schema: any, conditionFunc: CondFunction) => (stream: any, result: Result, parent: Result, _parse: ParseFun) => void;
|
|
4
|
+
export declare const loop: (schema: any, continueFunc: any) => (stream: any, result: any, parent: any, parse: any) => {}[];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loop = exports.conditional = exports.parse = void 0;
|
|
4
|
+
const parse = (stream, schema, result = {}, parent = result) => {
|
|
5
|
+
if (Array.isArray(schema)) {
|
|
6
|
+
schema.forEach((partSchema) => (0, exports.parse)(stream, partSchema, result, parent));
|
|
7
|
+
}
|
|
8
|
+
else if (typeof schema === 'function') {
|
|
9
|
+
schema(stream, result, parent, exports.parse);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
const key = Object.keys(schema)[0];
|
|
13
|
+
if (Array.isArray(schema[key])) {
|
|
14
|
+
parent[key] = {};
|
|
15
|
+
(0, exports.parse)(stream, schema[key], result, parent[key]);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
parent[key] = schema[key](stream, result, parent, exports.parse);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return result;
|
|
22
|
+
};
|
|
23
|
+
exports.parse = parse;
|
|
24
|
+
const conditional = (schema, conditionFunc) => (stream, result, parent, _parse) => {
|
|
25
|
+
if (conditionFunc(stream, result, parent)) {
|
|
26
|
+
_parse(stream, schema, result, parent);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.conditional = conditional;
|
|
30
|
+
const loop = (schema, continueFunc) => (stream, result, parent, parse) => {
|
|
31
|
+
const arr = [];
|
|
32
|
+
let lastStreamPos = stream.pos;
|
|
33
|
+
while (continueFunc(stream, result, parent)) {
|
|
34
|
+
const newParent = {};
|
|
35
|
+
parse(stream, schema, result, newParent);
|
|
36
|
+
// cases when whole file is parsed but no termination is there and stream position is not getting updated as well
|
|
37
|
+
// it falls into infinite recursion, null check to avoid the same
|
|
38
|
+
if (stream.pos === lastStreamPos) {
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
lastStreamPos = stream.pos;
|
|
42
|
+
arr.push(newParent);
|
|
43
|
+
}
|
|
44
|
+
return arr;
|
|
45
|
+
};
|
|
46
|
+
exports.loop = loop;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare type Schema = SchemaFun | Schema[] | SchemaFun[] | Record<string, Schema>;
|
|
2
|
+
export declare type Stream = unknown;
|
|
3
|
+
export declare type Result = Record<string, unknown>;
|
|
4
|
+
export declare type CondFunction = (a: Stream, b: Result, c: unknown) => boolean;
|
|
5
|
+
export declare type ParseFun = (a: Stream, b: Schema, c: Result | undefined, d: Result | undefined) => Result;
|
|
6
|
+
declare type SchemaFun = (stream: Stream, res: Result, parent: Result | undefined, parseFn: ParseFun) => void;
|
|
7
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/gif",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.37",
|
|
4
4
|
"description": "Gif component for remotion",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"repository": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"js-binary-schema-parser": "^2.0.3",
|
|
25
25
|
"lru_map": "0.4.1",
|
|
26
|
-
"remotion": "3.3.
|
|
26
|
+
"remotion": "3.3.37"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@jonny/eslint-config": "3.0.266",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "ead6bdacc14a9953cae738159c49bf3daf09e9b0"
|
|
57
57
|
}
|