Skip to content

Commit

Permalink
fix: use unknown instead of any for additional properties (#1466)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmorel authored Jun 19, 2024
1 parent 82024a4 commit 950b547
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/core/src/getters/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const getObject = ({
if (arr.length - 1 === index) {
if (item.additionalProperties) {
if (isBoolean(item.additionalProperties)) {
acc.value += `\n [key: string]: any;\n }`;
acc.value += `\n [key: string]: unknown;\n }`;
} else {
const resolvedValue = resolveValue({
schema: item.additionalProperties,
Expand Down Expand Up @@ -166,7 +166,7 @@ export const getObject = ({
if (item.additionalProperties) {
if (isBoolean(item.additionalProperties)) {
return {
value: `{ [key: string]: any }` + nullable,
value: `{ [key: string]: unknown }` + nullable,
imports: [],
schemas: [],
isEnum: false,
Expand Down Expand Up @@ -206,7 +206,7 @@ export const getObject = ({

return {
value:
(item.type === 'object' ? '{ [key: string]: any }' : 'unknown') +
(item.type === 'object' ? '{ [key: string]: unknown }' : 'unknown') +
nullable,
imports: [],
schemas: [],
Expand Down

0 comments on commit 950b547

Please sign in to comment.