Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: fix any type #74

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions src/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ export function createJsonValidator<T extends object = object>(schema: string, t
return validator;

function validate(jsonText: string) {
let jsonObject;
let jsonObject: { [key: string]: unknown };
try {
jsonObject = JSON.parse(jsonText) as object;
jsonObject = JSON.parse(jsonText);
}
catch (e) {
return error(e instanceof SyntaxError ? e.message : "JSON parse error");
Expand Down Expand Up @@ -131,7 +131,7 @@ export function createJsonValidator<T extends object = object>(schema: string, t
* circular references in the object.
* @param obj The object in which to strip null valued properties.
*/
function stripNulls(obj: any) {
function stripNulls(obj: { [key: string]: any }): void {
let keysToDelete: string[] | undefined;
for (const k in obj) {
const value = obj[k];
Expand Down