@remotion/bundler 4.0.11 → 4.1.0-alpha10
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,6 @@
|
|
|
1
|
+
import type { SerializedJSONWithCustomFields } from 'remotion';
|
|
2
|
+
export declare const serializeJSONWithDate: ({ data, indent, staticBase, }: {
|
|
3
|
+
data: Record<string, unknown>;
|
|
4
|
+
indent: number | undefined;
|
|
5
|
+
staticBase: string | null;
|
|
6
|
+
}) => SerializedJSONWithCustomFields;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeJSONWithDate = void 0;
|
|
4
|
+
// Keep in sync with /packages/core/src/input-props-serialization.ts
|
|
5
|
+
const DATE_TOKEN = 'remotion-date:';
|
|
6
|
+
const FILE_TOKEN = 'remotion-file:';
|
|
7
|
+
const serializeJSONWithDate = ({ data, indent, staticBase, }) => {
|
|
8
|
+
let customDateUsed = false;
|
|
9
|
+
let customFileUsed = false;
|
|
10
|
+
let mapUsed = false;
|
|
11
|
+
let setUsed = false;
|
|
12
|
+
const serializedString = JSON.stringify(data, function (key, value) {
|
|
13
|
+
const item = this[key];
|
|
14
|
+
if (item instanceof Date) {
|
|
15
|
+
customDateUsed = true;
|
|
16
|
+
return `${DATE_TOKEN}${item.toISOString()}`;
|
|
17
|
+
}
|
|
18
|
+
if (item instanceof Map) {
|
|
19
|
+
mapUsed = true;
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
if (item instanceof Set) {
|
|
23
|
+
setUsed = true;
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
if (typeof item === 'string' &&
|
|
27
|
+
staticBase !== null &&
|
|
28
|
+
item.startsWith(staticBase)) {
|
|
29
|
+
customFileUsed = true;
|
|
30
|
+
return `${FILE_TOKEN}${item.replace(staticBase + '/', '')}`;
|
|
31
|
+
}
|
|
32
|
+
return value;
|
|
33
|
+
}, indent);
|
|
34
|
+
return { serializedString, customDateUsed, customFileUsed, mapUsed, setUsed };
|
|
35
|
+
};
|
|
36
|
+
exports.serializeJSONWithDate = serializeJSONWithDate;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/bundler",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0-alpha10",
|
|
4
4
|
"description": "Bundler for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"react-refresh": "0.9.0",
|
|
23
23
|
"style-loader": "2.0.0",
|
|
24
24
|
"webpack": "5.83.1",
|
|
25
|
-
"remotion": "4.0
|
|
25
|
+
"remotion": "4.1.0-alpha10"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": ">=16.8.0",
|