remotion 4.0.0-oops.3 → 4.0.0-prefetch.7
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.
- package/.turbo/turbo-build.log +5 -5
- package/README.md +30 -19
- package/dist/AbsoluteFill.d.ts +6 -2
- package/dist/AbsoluteFill.js +7 -3
- package/dist/CanUseRemotionHooks.d.ts +5 -0
- package/dist/CanUseRemotionHooks.js +10 -0
- package/dist/Composition.d.ts +3 -6
- package/dist/Composition.js +40 -28
- package/dist/CompositionManager.d.ts +7 -12
- package/dist/CompositionManager.js +15 -5
- package/dist/Folder.d.ts +15 -0
- package/dist/Folder.js +33 -0
- package/dist/IFrame.js +1 -1
- package/dist/Img.js +33 -16
- package/dist/RemotionRoot.js +1 -1
- package/dist/{sequencing/index.d.ts → Sequence.d.ts} +13 -3
- package/dist/{sequencing/index.js → Sequence.js} +40 -34
- package/dist/Still.d.ts +1 -1
- package/dist/Still.js +1 -1
- package/dist/asset-types.d.ts +1 -4
- package/dist/audio/Audio.d.ts +2 -2
- package/dist/audio/Audio.js +5 -5
- package/dist/audio/AudioForDevelopment.d.ts +3 -2
- package/dist/audio/AudioForDevelopment.js +19 -6
- package/dist/audio/AudioForRendering.d.ts +5 -2
- package/dist/audio/AudioForRendering.js +15 -8
- package/dist/audio/index.js +5 -1
- package/dist/audio/props.d.ts +1 -1
- package/dist/audio/shared-audio-tags.d.ts +4 -3
- package/dist/audio/shared-audio-tags.js +115 -42
- package/dist/audio/use-audio-frame.js +4 -4
- package/dist/config/bundle-out-dir.d.ts +2 -0
- package/dist/config/bundle-out-dir.js +12 -0
- package/dist/config/input-props.js +12 -14
- package/dist/config/public-path.d.ts +2 -0
- package/dist/config/public-path.js +12 -0
- package/dist/{config/index.d.ts → config.d.ts} +70 -22
- package/dist/config.js +21 -0
- package/dist/default-css.d.ts +1 -0
- package/dist/default-css.js +9 -2
- package/dist/delay-render.d.ts +1 -1
- package/dist/delay-render.js +4 -4
- package/dist/freeze.d.ts +2 -2
- package/dist/freeze.js +2 -2
- package/dist/get-timeline-clip-name.js +2 -1
- package/dist/index.d.ts +23 -8
- package/dist/index.js +18 -8
- package/dist/internals.d.ts +35 -101
- package/dist/internals.js +18 -94
- package/dist/{interpolateColors.d.ts → interpolate-colors.d.ts} +0 -0
- package/dist/{interpolateColors.js → interpolate-colors.js} +0 -0
- package/dist/loading-indicator.d.ts +2 -0
- package/dist/loading-indicator.js +35 -0
- package/dist/loop/index.js +5 -4
- package/dist/multiple-versions-warning.js +18 -4
- package/dist/play-and-handle-not-allowed-error.d.ts +1 -1
- package/dist/portal-node.d.ts +1 -0
- package/dist/portal-node.js +23 -0
- package/dist/preload.d.ts +7 -0
- package/dist/preload.js +83 -0
- package/dist/register-root.d.ts +2 -1
- package/dist/register-root.js +20 -5
- package/dist/series/index.d.ts +2 -2
- package/dist/series/index.js +4 -4
- package/dist/spring/index.d.ts +8 -4
- package/dist/spring/index.js +21 -6
- package/dist/spring/measure-spring.d.ts +1 -1
- package/dist/spring/measure-spring.js +1 -1
- package/dist/static-file.js +6 -0
- package/dist/timeline-position-state.d.ts +1 -1
- package/dist/{use-frame.d.ts → use-current-frame.d.ts} +0 -1
- package/dist/use-current-frame.js +28 -0
- package/dist/use-lazy-component.d.ts +3 -3
- package/dist/use-lazy-component.js +5 -1
- package/dist/use-media-in-timeline.d.ts +2 -2
- package/dist/use-media-in-timeline.js +10 -7
- package/dist/use-media-playback.d.ts +3 -2
- package/dist/use-media-playback.js +9 -6
- package/dist/use-media-tag-volume.d.ts +1 -1
- package/dist/use-sync-volume-with-media-tag.d.ts +2 -2
- package/dist/use-unsafe-video-config.d.ts +1 -1
- package/dist/use-unsafe-video-config.js +2 -2
- package/dist/use-video-config.d.ts +1 -1
- package/dist/use-video-config.js +6 -0
- package/dist/use-video.d.ts +13 -1
- package/dist/use-video.js +16 -3
- package/dist/validate-media-props.d.ts +4 -3
- package/dist/validation/validate-fps.d.ts +1 -1
- package/dist/validation/validate-fps.js +4 -1
- package/dist/validation/validate-offthreadvideo-image-format.d.ts +1 -0
- package/dist/validation/validate-offthreadvideo-image-format.js +15 -0
- package/dist/validation/validation-spring-duration.d.ts +1 -0
- package/dist/validation/validation-spring-duration.js +21 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +5 -0
- package/dist/video/OffthreadVideo.d.ts +3 -0
- package/dist/video/OffthreadVideo.js +27 -0
- package/dist/video/OffthreadVideoForRendering.d.ts +3 -0
- package/dist/video/OffthreadVideoForRendering.js +101 -0
- package/dist/video/Video.d.ts +3 -3
- package/dist/video/Video.js +4 -4
- package/dist/video/VideoForDevelopment.d.ts +7 -2
- package/dist/video/VideoForDevelopment.js +28 -4
- package/dist/video/VideoForRendering.d.ts +5 -2
- package/dist/video/VideoForRendering.js +62 -40
- package/dist/video/get-current-time.d.ts +7 -1
- package/dist/video/get-current-time.js +17 -9
- package/dist/video/index.d.ts +3 -2
- package/dist/video/index.js +5 -12
- package/dist/video/props.d.ts +13 -2
- package/dist/volume-prop.js +1 -1
- package/dist/warn-about-non-seekable-media.d.ts +1 -1
- package/dist/warn-about-non-seekable-media.js +14 -2
- package/dist/wrap-remotion-context.d.ts +2 -1
- package/dist/wrap-remotion-context.js +12 -4
- package/ensure-correct-version.js +24 -0
- package/package.json +10 -11
- package/version.d.ts +1 -0
- package/version.js +1 -0
- package/dist/compress-assets.d.ts +0 -7
- package/dist/compress-assets.js +0 -25
- package/dist/config/browser-executable.d.ts +0 -3
- package/dist/config/browser-executable.js +0 -12
- package/dist/config/browser.d.ts +0 -4
- package/dist/config/browser.js +0 -19
- package/dist/config/chromium-flags.d.ts +0 -10
- package/dist/config/chromium-flags.js +0 -34
- package/dist/config/codec.d.ts +0 -17
- package/dist/config/codec.js +0 -103
- package/dist/config/concurrency.d.ts +0 -3
- package/dist/config/concurrency.js +0 -15
- package/dist/config/crf.d.ts +0 -9
- package/dist/config/crf.js +0 -83
- package/dist/config/env-file.d.ts +0 -2
- package/dist/config/env-file.js +0 -10
- package/dist/config/ffmpeg-executable.d.ts +0 -3
- package/dist/config/ffmpeg-executable.js +0 -12
- package/dist/config/frame-range.d.ts +0 -5
- package/dist/config/frame-range.js +0 -80
- package/dist/config/image-format.d.ts +0 -8
- package/dist/config/image-format.js +0 -37
- package/dist/config/image-sequence.d.ts +0 -3
- package/dist/config/image-sequence.js +0 -15
- package/dist/config/index.js +0 -175
- package/dist/config/log.d.ts +0 -7
- package/dist/config/log.js +0 -25
- package/dist/config/max-timeline-tracks.d.ts +0 -2
- package/dist/config/max-timeline-tracks.js +0 -24
- package/dist/config/override-webpack.d.ts +0 -12
- package/dist/config/override-webpack.js +0 -14
- package/dist/config/overwrite.d.ts +0 -3
- package/dist/config/overwrite.js +0 -14
- package/dist/config/pixel-format.d.ts +0 -8
- package/dist/config/pixel-format.js +0 -38
- package/dist/config/preview-server.d.ts +0 -2
- package/dist/config/preview-server.js +0 -20
- package/dist/config/prores-profile.d.ts +0 -7
- package/dist/config/prores-profile.js +0 -32
- package/dist/config/quality.d.ts +0 -2
- package/dist/config/quality.js +0 -17
- package/dist/config/scale.d.ts +0 -3
- package/dist/config/scale.js +0 -15
- package/dist/config/still-frame.d.ts +0 -2
- package/dist/config/still-frame.js +0 -12
- package/dist/config/timeout.d.ts +0 -2
- package/dist/config/timeout.js +0 -17
- package/dist/config/webpack-caching.d.ts +0 -3
- package/dist/config/webpack-caching.js +0 -16
- package/dist/feature-flags.d.ts +0 -1
- package/dist/feature-flags.js +0 -7
- package/dist/initial-frame.d.ts +0 -2
- package/dist/initial-frame.js +0 -12
- package/dist/is-audio-codec.d.ts +0 -2
- package/dist/is-audio-codec.js +0 -7
- package/dist/perf/index.d.ts +0 -5
- package/dist/perf/index.js +0 -33
- package/dist/timeline-inout-position-state.d.ts +0 -12
- package/dist/timeline-inout-position-state.js +0 -23
- package/dist/timeout.d.ts +0 -2
- package/dist/timeout.js +0 -12
- package/dist/use-frame.js +0 -25
- package/dist/validation/validate-frame.d.ts +0 -1
- package/dist/validation/validate-frame.js +0 -24
- package/dist/validation/validate-image-format.d.ts +0 -2
- package/dist/validation/validate-image-format.js +0 -9
- package/dist/validation/validate-opengl-renderer.d.ts +0 -4
- package/dist/validation/validate-opengl-renderer.js +0 -14
- package/dist/validation/validate-quality.d.ts +0 -1
- package/dist/validation/validate-quality.js +0 -21
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getWebpackCaching = exports.setWebpackCaching = exports.DEFAULT_WEBPACK_CACHE_ENABLED = void 0;
|
|
4
|
-
exports.DEFAULT_WEBPACK_CACHE_ENABLED = true;
|
|
5
|
-
let webpackCaching = exports.DEFAULT_WEBPACK_CACHE_ENABLED;
|
|
6
|
-
const setWebpackCaching = (flag) => {
|
|
7
|
-
if (typeof flag !== 'boolean') {
|
|
8
|
-
throw new TypeError('Caching flag must be a boolean.');
|
|
9
|
-
}
|
|
10
|
-
webpackCaching = flag;
|
|
11
|
-
};
|
|
12
|
-
exports.setWebpackCaching = setWebpackCaching;
|
|
13
|
-
const getWebpackCaching = () => {
|
|
14
|
-
return webpackCaching;
|
|
15
|
-
};
|
|
16
|
-
exports.getWebpackCaching = getWebpackCaching;
|
package/dist/feature-flags.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const FEATURE_FLAG_FIREFOX_SUPPORT = false;
|
package/dist/feature-flags.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FEATURE_FLAG_FIREFOX_SUPPORT = void 0;
|
|
4
|
-
// There is no Firefox support yet, the waitForFunction method
|
|
5
|
-
// does not yet work and downloading has a bug.
|
|
6
|
-
// Disabling this for now!
|
|
7
|
-
exports.FEATURE_FLAG_FIREFOX_SUPPORT = false;
|
package/dist/initial-frame.d.ts
DELETED
package/dist/initial-frame.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupInitialFrame = exports.INITIAL_FRAME_LOCAL_STORAGE_KEY = void 0;
|
|
4
|
-
exports.INITIAL_FRAME_LOCAL_STORAGE_KEY = 'remotion.initialFrame';
|
|
5
|
-
const getInitialFrame = () => {
|
|
6
|
-
const param = localStorage.getItem(exports.INITIAL_FRAME_LOCAL_STORAGE_KEY);
|
|
7
|
-
return param ? Number(param) : 0;
|
|
8
|
-
};
|
|
9
|
-
const setupInitialFrame = () => {
|
|
10
|
-
window.remotion_initialFrame = getInitialFrame();
|
|
11
|
-
};
|
|
12
|
-
exports.setupInitialFrame = setupInitialFrame;
|
package/dist/is-audio-codec.d.ts
DELETED
package/dist/is-audio-codec.js
DELETED
package/dist/perf/index.d.ts
DELETED
package/dist/perf/index.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logPerf = exports.stopPerfMeasure = exports.startPerfMeasure = void 0;
|
|
4
|
-
const perf = {
|
|
5
|
-
'activate-target': [],
|
|
6
|
-
capture: [],
|
|
7
|
-
save: [],
|
|
8
|
-
};
|
|
9
|
-
const map = {};
|
|
10
|
-
const startPerfMeasure = (marker) => {
|
|
11
|
-
const id = Math.random();
|
|
12
|
-
map[id] = {
|
|
13
|
-
id,
|
|
14
|
-
marker,
|
|
15
|
-
start: Date.now(),
|
|
16
|
-
};
|
|
17
|
-
return id;
|
|
18
|
-
};
|
|
19
|
-
exports.startPerfMeasure = startPerfMeasure;
|
|
20
|
-
const stopPerfMeasure = (id) => {
|
|
21
|
-
const now = Date.now();
|
|
22
|
-
const diff = now - map[id].start;
|
|
23
|
-
perf[map[id].marker].push(diff);
|
|
24
|
-
delete map[id];
|
|
25
|
-
};
|
|
26
|
-
exports.stopPerfMeasure = stopPerfMeasure;
|
|
27
|
-
const logPerf = () => {
|
|
28
|
-
console.log('Render performance:');
|
|
29
|
-
Object.keys(perf).forEach((p) => {
|
|
30
|
-
console.log(` ${p} => ${perf[p].reduce((a, b) => a + b, 0) / perf[p].length} (n = ${perf[p].length})`);
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
exports.logPerf = logPerf;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare type TimelineInOutContextValue = {
|
|
3
|
-
inFrame: number | null;
|
|
4
|
-
outFrame: number | null;
|
|
5
|
-
};
|
|
6
|
-
export declare type SetTimelineInOutContextValue = {
|
|
7
|
-
setInAndOutFrames: (u: React.SetStateAction<TimelineInOutContextValue>) => void;
|
|
8
|
-
};
|
|
9
|
-
export declare const TimelineInOutContext: React.Context<TimelineInOutContextValue>;
|
|
10
|
-
export declare const SetTimelineInOutContext: React.Context<SetTimelineInOutContextValue>;
|
|
11
|
-
export declare const useTimelineInOutFramePosition: () => TimelineInOutContextValue;
|
|
12
|
-
export declare const useTimelineSetInOutFramePosition: () => SetTimelineInOutContextValue;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useTimelineSetInOutFramePosition = exports.useTimelineInOutFramePosition = exports.SetTimelineInOutContext = exports.TimelineInOutContext = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
exports.TimelineInOutContext = (0, react_1.createContext)({
|
|
6
|
-
inFrame: null,
|
|
7
|
-
outFrame: null,
|
|
8
|
-
});
|
|
9
|
-
exports.SetTimelineInOutContext = (0, react_1.createContext)({
|
|
10
|
-
setInAndOutFrames: () => {
|
|
11
|
-
throw new Error('default');
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
const useTimelineInOutFramePosition = () => {
|
|
15
|
-
const state = (0, react_1.useContext)(exports.TimelineInOutContext);
|
|
16
|
-
return state;
|
|
17
|
-
};
|
|
18
|
-
exports.useTimelineInOutFramePosition = useTimelineInOutFramePosition;
|
|
19
|
-
const useTimelineSetInOutFramePosition = () => {
|
|
20
|
-
const { setInAndOutFrames } = (0, react_1.useContext)(exports.SetTimelineInOutContext);
|
|
21
|
-
return { setInAndOutFrames };
|
|
22
|
-
};
|
|
23
|
-
exports.useTimelineSetInOutFramePosition = useTimelineSetInOutFramePosition;
|
package/dist/timeout.d.ts
DELETED
package/dist/timeout.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupPuppeteerTimeout = exports.DEFAULT_PUPPETEER_TIMEOUT = void 0;
|
|
4
|
-
exports.DEFAULT_PUPPETEER_TIMEOUT = 30000;
|
|
5
|
-
const getPuppeteerTimeout = () => {
|
|
6
|
-
const param = window.remotion_puppeteerTimeout;
|
|
7
|
-
return param ? Number(param) : exports.DEFAULT_PUPPETEER_TIMEOUT;
|
|
8
|
-
};
|
|
9
|
-
const setupPuppeteerTimeout = () => {
|
|
10
|
-
window.remotion_puppeteerTimeout = getPuppeteerTimeout();
|
|
11
|
-
};
|
|
12
|
-
exports.setupPuppeteerTimeout = setupPuppeteerTimeout;
|
package/dist/use-frame.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useCurrentFrame = exports.useAbsoluteCurrentFrame = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const sequencing_1 = require("./sequencing");
|
|
6
|
-
const timeline_position_state_1 = require("./timeline-position-state");
|
|
7
|
-
const useAbsoluteCurrentFrame = () => {
|
|
8
|
-
const timelinePosition = (0, timeline_position_state_1.useTimelinePosition)();
|
|
9
|
-
return timelinePosition;
|
|
10
|
-
};
|
|
11
|
-
exports.useAbsoluteCurrentFrame = useAbsoluteCurrentFrame;
|
|
12
|
-
/**
|
|
13
|
-
* Get the current frame of the video.
|
|
14
|
-
* Frames are 0-indexed, meaning the first frame is 0, the last frame is the duration of the composition in frames minus one.
|
|
15
|
-
* @link https://www.remotion.dev/docs/use-current-frame
|
|
16
|
-
*/
|
|
17
|
-
const useCurrentFrame = () => {
|
|
18
|
-
const frame = (0, exports.useAbsoluteCurrentFrame)();
|
|
19
|
-
const context = (0, react_1.useContext)(sequencing_1.SequenceContext);
|
|
20
|
-
const contextOffset = context
|
|
21
|
-
? context.cumulatedFrom + context.relativeFrom
|
|
22
|
-
: 0;
|
|
23
|
-
return frame - contextOffset;
|
|
24
|
-
};
|
|
25
|
-
exports.useCurrentFrame = useCurrentFrame;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const validateFrame: (frame: number, durationInFrames: number) => void;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateFrame = void 0;
|
|
4
|
-
const validateFrame = (frame, durationInFrames) => {
|
|
5
|
-
if (typeof frame === 'undefined') {
|
|
6
|
-
throw new TypeError(`Argument missing for parameter "frame"`);
|
|
7
|
-
}
|
|
8
|
-
if (typeof frame !== 'number') {
|
|
9
|
-
throw new TypeError(`Argument passed for "frame" is not a number: ${frame}`);
|
|
10
|
-
}
|
|
11
|
-
if (frame < 0) {
|
|
12
|
-
throw new RangeError(`Frame ${frame} cannot be negative`);
|
|
13
|
-
}
|
|
14
|
-
if (!Number.isFinite(frame)) {
|
|
15
|
-
throw new RangeError(`Frame ${frame} is not finite`);
|
|
16
|
-
}
|
|
17
|
-
if (frame % 1 !== 0) {
|
|
18
|
-
throw new RangeError(`Argument for frame must be an integer, but got ${frame}`);
|
|
19
|
-
}
|
|
20
|
-
if (frame > durationInFrames - 1) {
|
|
21
|
-
throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the highest frame that can be rendered is ${durationInFrames - 1}`);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
exports.validateFrame = validateFrame;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateNonNullImageFormat = void 0;
|
|
4
|
-
const validateNonNullImageFormat = (imageFormat) => {
|
|
5
|
-
if (imageFormat !== 'jpeg' && imageFormat !== 'png') {
|
|
6
|
-
throw new TypeError('Image format should be either "png" or "jpeg"');
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
exports.validateNonNullImageFormat = validateNonNullImageFormat;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateOpenGlRenderer = void 0;
|
|
4
|
-
const validRenderers = ['angle', 'egl', 'swiftshader'];
|
|
5
|
-
const validateOpenGlRenderer = (option) => {
|
|
6
|
-
if (option === null) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
if (!validRenderers.includes(option)) {
|
|
10
|
-
throw new TypeError(`${option} is not a valid GL backend. Accepted values: ${validRenderers.join(', ')}`);
|
|
11
|
-
}
|
|
12
|
-
return option;
|
|
13
|
-
};
|
|
14
|
-
exports.validateOpenGlRenderer = validateOpenGlRenderer;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const validateQuality: (q: number | undefined) => void;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateQuality = void 0;
|
|
4
|
-
const validateQuality = (q) => {
|
|
5
|
-
if (typeof q !== 'undefined' && typeof q !== 'number') {
|
|
6
|
-
throw new Error(`Quality option must be a number or undefined. Got ${typeof q} (${JSON.stringify(q)})`);
|
|
7
|
-
}
|
|
8
|
-
if (typeof q === 'undefined') {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
if (!Number.isFinite(q)) {
|
|
12
|
-
throw new RangeError(`Quality must be a finite number, but is ${q}`);
|
|
13
|
-
}
|
|
14
|
-
if (Number.isNaN(q)) {
|
|
15
|
-
throw new RangeError(`Quality is NaN, but must be a real number`);
|
|
16
|
-
}
|
|
17
|
-
if (q > 100 || q < 0) {
|
|
18
|
-
throw new RangeError('Quality option must be between 0 and 100.');
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
exports.validateQuality = validateQuality;
|