Skip to content

Commit

Permalink
step on type
Browse files Browse the repository at this point in the history
  • Loading branch information
Miniast committed May 13, 2024
1 parent df96adf commit 0d8f6cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/logger.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const logOptions = {
type: "pretty" as any,
type: "pretty" as "json" | "pretty" | "hidden",
name: "Crawler",
hideLogPositionForProduction: true,
prettyLogTemplate: "{{name}} {{logLevelName}} ",
Expand Down
4 changes: 2 additions & 2 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import http2Wrapper from "http2-wrapper";
import { cleanObject, getType, isValidUrl } from "./lib/utils.js";
import { RequestConfig, RequestOptions } from "./types/crawler.js";

export const getCharset = (headers: Record<string, string>): null | string => {
export const getCharset = (headers: Record<string, unknown>): null | string => {
let charset = null;
const contentType = headers["content-type"];
const contentType = headers["content-type"] as string;
if (contentType) {
const match = contentType.match(/charset=['"]?([\w.-]+)/i);
if (match) {
Expand Down

0 comments on commit 0d8f6cd

Please sign in to comment.