Skip to content

Commit

Permalink
changed parameter name to noComponentChange
Browse files Browse the repository at this point in the history
  • Loading branch information
TanyaGashtold committed Oct 30, 2024
1 parent 8b0d981 commit b490f6e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions src/utils/formUtil/eachComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { componentInfo, componentPath, componentFormPath } from './index';
* The current data path of the element. Example: data.user.firstName
* @param {Object} parent
* The parent object.
* @param {Boolean} runClean
* @param {Boolean} noComponentChange
* Whether or not to add properties (e.g. path/parent) to the component object
*/
export function eachComponent(
Expand All @@ -23,7 +23,7 @@ export function eachComponent(
includeAll?: boolean,
path: string = '',
parent?: Component,
runClean?: boolean,
noComponentChange?: boolean,
) {
if (!components) return;
components.forEach((component: any) => {
Expand All @@ -33,7 +33,7 @@ export function eachComponent(
const info = componentInfo(component);
let noRecurse = false;
// Keep track of parent references.
if (parent && !runClean) {
if (parent && !noComponentChange) {
// Ensure we don't create infinite JSON structures.
Object.defineProperty(component, 'parent', {
enumerable: false,
Expand All @@ -58,7 +58,7 @@ export function eachComponent(

const compPath = componentPath(component, path);

if (!runClean) {
if (!noComponentChange) {
Object.defineProperty(component, 'path', {
enumerable: false,
writable: true,
Expand All @@ -79,7 +79,7 @@ export function eachComponent(
includeAll,
path,
parent ? component : null,
runClean,
noComponentChange,
),
);
} else if (info.hasRows) {
Expand All @@ -92,7 +92,7 @@ export function eachComponent(
includeAll,
path,
parent ? component : null,
runClean,
noComponentChange,
),
);
}
Expand All @@ -104,7 +104,7 @@ export function eachComponent(
includeAll,
componentFormPath(component, path, compPath),
parent ? component : null,
runClean,
noComponentChange,
);
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/utils/formUtil/eachComponentAsync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export async function eachComponentAsync(
includeAll = false,
path = '',
parent?: any,
runClean?: boolean,
noComponentChange?: boolean,
) {
if (!components) return;
for (let i = 0; i < components.length; i++) {
Expand All @@ -17,7 +17,7 @@ export async function eachComponentAsync(
const component = components[i];
const info = componentInfo(component);
// Keep track of parent references.
if (parent && !runClean) {
if (parent && !noComponentChange) {
// Ensure we don't create infinite JSON structures.
Object.defineProperty(component, 'parent', {
enumerable: false,
Expand All @@ -41,7 +41,7 @@ export async function eachComponentAsync(
}
const compPath = componentPath(component, path);

if (!runClean) {
if (!noComponentChange) {
Object.defineProperty(component, 'path', {
enumerable: false,
writable: true,
Expand All @@ -61,7 +61,7 @@ export async function eachComponentAsync(
includeAll,
path,
parent ? component : null,
runClean,
noComponentChange,
);
}
} else if (info.hasRows) {
Expand All @@ -75,7 +75,7 @@ export async function eachComponentAsync(
includeAll,
path,
parent ? component : null,
runClean,
noComponentChange,
);
}
}
Expand All @@ -87,7 +87,7 @@ export async function eachComponentAsync(
includeAll,
componentFormPath(component, path, compPath),
parent ? component : null,
runClean,
noComponentChange,
);
}
}
Expand Down

0 comments on commit b490f6e

Please sign in to comment.