Skip to content

Commit

Permalink
properly define the env
Browse files Browse the repository at this point in the history
Signed-off-by: Ayase Minori <[email protected]>
  • Loading branch information
sr229 committed Aug 26, 2024
1 parent b3dd0c4 commit 2838b1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import FormData from "form-data";

import { createReadStream } from "node:fs";
import { Readable } from "node:stream";
import process from "node:process";
import { env } from "node:process";

import { SagiriClientError, SagiriServerError } from "./errors";
import { IResponse, IResult } from "./response";
Expand All @@ -23,7 +23,7 @@ const sagiri = (token: string, defaultOptions: IOptions = { results: 5 }): (file

// do some token validation, tokens must be 40 chars long and alphanumeric
// make sure we're lenient during testing though to allow jest to pass.
if (process.env.NODE_ENV !== "test")
if (env.NODE_ENV !== "test")
if (token.length < 40 || !/^[a-zA-Z0-9]+$/.test(token))
throw new Error("Malformed SauceNAO Token. Fetch your own at https://saucenao.com/user.php");

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"license": "MIT",
"type": "module",
"exports" : {
"require" : "dist/cjs/index.js",
"import" : "dist/esm/index.js"
"require" : "./dist/cjs/index.js",
"import" : "./dist/esm/index.js"
},
"main": "dist/cjs/index.js",
"contributors": [
Expand Down

0 comments on commit 2838b1f

Please sign in to comment.