Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@inquirer/prompts": "^8.7.1",
"@tsconfig/node24": "^24.0.5",
"@types/node": "^26.4.1",
"@vitest/coverage-v8": "^4.1.10",
"@vitest/coverage-v8": "^5.0.0",
"github-actionlint": "^1.7.12",
"husky": "^9.1.7",
"lint-staged": "^17.4.1",
Expand All @@ -43,7 +43,8 @@
"query-string": "^9.5.1",
"ts-node": "^10.9.2",
"typescript": "^6.0.3",
"vitest": "^4.1.10",
"vite": "^7.3.5",
"vitest": "^5.0.0",
"yaml-lint": "^1.7.0",
"yargs": "^18.1.0"
},
Expand Down
5 changes: 3 additions & 2 deletions packages/data-sanitization-log-providers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,16 @@
},
"devDependencies": {
"@types/node": "^26.4.1",
"@vitest/coverage-v8": "^4.1.10",
"@vitest/coverage-v8": "^5.0.0",
"data-sanitization": "workspace:*",
"markdownlint-cli2": "^0.23.2",
"oxfmt": "^0.66.0",
"oxlint": "^1.81.0",
"pino": "^10.3.1",
"pino-abstract-transport": "^3.0.0",
"typescript": "^6.0.3",
"vitest": "^4.1.10",
"vite": "^7.3.5",
"vitest": "^5.0.0",
"winston": "^3.19.0",
"winston-transport": "^4.9.0"
},
Expand Down
5 changes: 3 additions & 2 deletions packages/data-sanitization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@
},
"devDependencies": {
"@types/node": "^26.4.1",
"@vitest/coverage-v8": "^4.1.10",
"@vitest/coverage-v8": "^5.0.0",
"markdownlint-cli2": "^0.23.2",
"oxfmt": "^0.66.0",
"oxlint": "^1.81.0",
"query-string": "^9.5.1",
"typescript": "^6.0.3",
"vitest": "^4.1.10",
"vite": "^7.3.5",
"vitest": "^5.0.0",
"yargs": "^18.1.0"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/data-sanitization/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const diffSanitizedFields = (original: object, sanitized: object): string[] => {
const bIsObj = typeof b === 'object' && b !== null;

if (!aIsObj || !bIsObj) {
/* istanbul ignore next -- path is always non-empty at a nested call site;
/* v8 ignore next -- path is always non-empty at a nested call site;
reaching here with path='' requires a null/primitive root, which violates
the public API contract */
if (path) {
Expand Down
12 changes: 12 additions & 0 deletions packages/data-sanitization/test/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,18 @@ describe('DataSanitizationUtils', () => {
expect(result).toEqual([]);
});

it('should return an empty array when both root values are primitive', () => {
// Arrange
const original = 'before' as unknown as object;
const sanitized = 'after' as unknown as object;

// Act
const result = diffSanitizedFields(original, sanitized);

// Assert
expect(result).toEqual([]);
});

it('should not include keys only present in sanitized', () => {
// Arrange
const original = { msg: 'hi' };
Expand Down
Loading