Skip to content

Commit 950b547

Browse files
authoredJun 19, 2024
fix: use unknown instead of any for additional properties (#1466)
1 parent 82024a4 commit 950b547

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎packages/core/src/getters/object.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export const getObject = ({
130130
if (arr.length - 1 === index) {
131131
if (item.additionalProperties) {
132132
if (isBoolean(item.additionalProperties)) {
133-
acc.value += `\n [key: string]: any;\n }`;
133+
acc.value += `\n [key: string]: unknown;\n }`;
134134
} else {
135135
const resolvedValue = resolveValue({
136136
schema: item.additionalProperties,
@@ -166,7 +166,7 @@ export const getObject = ({
166166
if (item.additionalProperties) {
167167
if (isBoolean(item.additionalProperties)) {
168168
return {
169-
value: `{ [key: string]: any }` + nullable,
169+
value: `{ [key: string]: unknown }` + nullable,
170170
imports: [],
171171
schemas: [],
172172
isEnum: false,
@@ -206,7 +206,7 @@ export const getObject = ({
206206

207207
return {
208208
value:
209-
(item.type === 'object' ? '{ [key: string]: any }' : 'unknown') +
209+
(item.type === 'object' ? '{ [key: string]: unknown }' : 'unknown') +
210210
nullable,
211211
imports: [],
212212
schemas: [],

0 commit comments

Comments
 (0)
Please sign in to comment.