Skip to content

Commit e1f9e76

Browse files
author
DavidQ
committed
centralize cloneJson
1 parent 889e5a5 commit e1f9e76

19 files changed

Lines changed: 54 additions & 57 deletions

docs/dev/CODEX_COMMANDS.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
MODEL: GPT-5.3-codex
2-
REASONING: high
3-
COMMAND:
4-
Execute docs/pr/BUILD_PR_SHARED_EXTRACTION_30_DEBUG_CONFIG_HELPERS_BATCH.md exactly.
5-
Edit only listed files.
6-
Create shared helper file.
7-
Do not expand scope.
8-
Package to <project folder>/tmp/BUILD_PR_SHARED_EXTRACTION_30_DEBUG_CONFIG_HELPERS_BATCH_delta.zip
1+
Execute BUILD_PR_SHARED_EXTRACTION_32_IS_OBJECT_BATCH.md exactly.

docs/dev/COMMIT_COMMENT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
BUILD PR: centralize debug config helpers across main entry points.
1+
centralize isObject

docs/dev/NEXT_COMMAND.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Next: continue duplicate-family extraction.
1+
Next: network helpers batch
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
debug config helpers centralized
1+
isObject centralized
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
helpers moved to shared
1+
validate per PR
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# BUILD_PR_SHARED_EXTRACTION_31_CLONE_JSON_BATCH
2+
3+
Centralize cloneJson(value) across tools/dev and tools/shared.
4+
5+
Create:
6+
src/shared/utils/jsonUtils.js
7+
8+
Export:
9+
cloneJson
10+
11+
Update all occurrences from tools/dev + tools/shared listed in dupes report.
12+
Remove local implementations, import shared.
13+
14+
Constraints:
15+
- no behavior change
16+
- no engine edits
17+
- exact batch only
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# BUILD_PR_SHARED_EXTRACTION_32_IS_OBJECT_BATCH
2+
3+
Centralize isObject(value).
4+
5+
Create or use:
6+
src/shared/utils/objectUtils.js
7+
8+
Export:
9+
isObject
10+
11+
Update tools/dev + tools/shared consumers.
12+
Remove local duplicates.
13+
14+
Constraints:
15+
- no behavior change
16+
- exact batch only

src/shared/utils/objectUtils.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ David Quesenberry
55
objectUtils.js
66
*/
77

8+
function isObject(value) {
9+
return value !== null && typeof value === 'object' && !Array.isArray(value);
10+
}
11+
812
function isPlainObject(value) {
913
return !!value && typeof value === 'object' && !Array.isArray(value);
1014
}
1115

12-
export { isPlainObject };
16+
export { isObject, isPlainObject };

tools/dev/commandPacks/packUtils.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ packUtils.js
66
*/
77

88
import { sanitizeText } from "../../../src/engine/debug/inspectors/shared/inspectorUtils.js";
9-
10-
function isObject(value) {
11-
return value !== null && typeof value === "object" && !Array.isArray(value);
12-
}
9+
import { isObject } from "../../../src/shared/utils/objectUtils.js";
1310

1411
export function requireNoArgs({ args = [], commandName = "" } = {}) {
1512
if (Array.isArray(args) && args.length > 0) {

tools/dev/devConsoleCommandRegistry.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ devConsoleCommandRegistry.js
66
*/
77

88
import { sanitizeText } from "../../src/engine/debug/inspectors/shared/inspectorUtils.js";
9-
10-
function isObject(value) {
11-
return value !== null && typeof value === "object" && !Array.isArray(value);
12-
}
9+
import { isObject } from "../../src/shared/utils/objectUtils.js";
1310

1411
function toLines(lines) {
1512
if (!Array.isArray(lines)) {

0 commit comments

Comments
 (0)