mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 23:24:03 +00:00
allow some config options to be optional
This commit is contained in:
parent
79c6df7da0
commit
821832048a
@ -61,9 +61,9 @@ export default async (opts: CmdOptions) => {
|
||||
const engine = createTransferEngine(source, destination, {
|
||||
versionStrategy: 'ignore', // for an export to file, versionStrategy will always be skipped
|
||||
schemaStrategy: 'ignore', // for an export to file, schemaStrategy will always be skipped
|
||||
exclude: opts.exclude ?? [],
|
||||
only: opts.only ?? [],
|
||||
throttle: opts.throttle ?? 0,
|
||||
exclude: opts.exclude,
|
||||
only: opts.only,
|
||||
throttle: opts.throttle,
|
||||
transforms: {
|
||||
links: [
|
||||
{
|
||||
|
||||
@ -72,9 +72,9 @@ export default async (opts: CmdOptions) => {
|
||||
const engineOptions: EngineOptions = {
|
||||
versionStrategy: DEFAULT_VERSION_STRATEGY,
|
||||
schemaStrategy: DEFAULT_SCHEMA_STRATEGY,
|
||||
exclude: opts.exclude ?? [],
|
||||
only: opts.only ?? [],
|
||||
throttle: opts.throttle ?? 0,
|
||||
exclude: opts.exclude,
|
||||
only: opts.only,
|
||||
throttle: opts.throttle,
|
||||
transforms: {
|
||||
links: [
|
||||
{
|
||||
|
||||
@ -111,9 +111,9 @@ export default async (opts: CmdOptions) => {
|
||||
const engine = createTransferEngine(source, destination, {
|
||||
versionStrategy: 'exact',
|
||||
schemaStrategy: 'strict',
|
||||
exclude: opts.exclude ?? [],
|
||||
only: opts.only ?? [],
|
||||
throttle: opts.throttle ?? 0,
|
||||
exclude: opts.exclude,
|
||||
only: opts.only,
|
||||
throttle: opts.throttle,
|
||||
transforms: {
|
||||
links: [
|
||||
{
|
||||
|
||||
@ -483,13 +483,13 @@ class TransferEngine<
|
||||
|
||||
// everything is included by default unless 'only' has been set
|
||||
let included = isEmpty(only);
|
||||
if (only?.length > 0) {
|
||||
if (only && only.length > 0) {
|
||||
included = only.some((transferGroup) => {
|
||||
return TransferGroupPresets[transferGroup][stage];
|
||||
});
|
||||
}
|
||||
|
||||
if (exclude?.length > 0) {
|
||||
if (exclude && exclude.length > 0) {
|
||||
if (included) {
|
||||
included = !exclude.some((transferGroup) => {
|
||||
return TransferGroupPresets[transferGroup][stage];
|
||||
|
||||
@ -170,9 +170,9 @@ export interface ITransferEngineOptions {
|
||||
transforms?: TransferTransforms;
|
||||
|
||||
// List of TransferTransformList preset options to exclude/include
|
||||
exclude: TransferFilterPreset[];
|
||||
only: TransferFilterPreset[];
|
||||
exclude?: TransferFilterPreset[];
|
||||
only?: TransferFilterPreset[];
|
||||
|
||||
// delay after each record
|
||||
throttle: number;
|
||||
throttle?: number;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user