Skip to content

Commit

Permalink
slight structure change
Browse files Browse the repository at this point in the history
  • Loading branch information
Pinta365 committed Mar 4, 2024
1 parent a679f91 commit 82e0b28
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
2 changes: 1 addition & 1 deletion jsr.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@cross/env",
"version": "0.1.1",
"version": "0.1.2",
"exports": "./mod.ts"
}
11 changes: 0 additions & 11 deletions lib/filehandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@ declare const Bun: {
env: Record<string, string>;
};

//Simulates/shims Node.js function to load modules for development purposes.
// deno-lint-ignore no-explicit-any
declare const require: (module: string) => any;

//Simulates/shims Node.js process object for development purposes.
declare const process: { env: Record<string, string> };

//Simulates/shims the Node.js fs namespace for development purposes.
// deno-lint-ignore no-explicit-any
declare const fs: any;

/**
* Loads environment variables from a .env file, handling file existence,
* runtime differences, and errors.
Expand Down
6 changes: 1 addition & 5 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import {
ValidatorFunction,
} from "./lib/helpers.ts";
import { loadEnvFile } from "./lib/filehandler.ts";
export { FileReadError, UnsupportedEnvironmentError, ValidationError } from "./lib/helpers.ts";
export type { ValidatorFunction } from "./lib/helpers.ts";
export type { EnvOptions, ValidatorFunction } from "./lib/helpers.ts";

/**
* Various shims/type-stubs, declared for development/IDE purposes
Expand All @@ -28,9 +27,6 @@ declare const Deno: {
};
//shims the Bun runtime
declare const Bun: { env: Record<string, string> };
//shims Node.js function to load modules
// deno-lint-ignore no-explicit-any
declare const require: (module: string) => any;
//shims Node.js process object
declare const process: {
// deno-lint-ignore no-explicit-any
Expand Down
3 changes: 1 addition & 2 deletions tests/deno.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, assertEquals, assertThrows } from "https://deno.land/[email protected]/assert/mod.ts";

import { ValidationError } from "../lib/helpers.ts";
import {
getAllEnv,
getEnv,
Expand All @@ -8,7 +8,6 @@ import {
setupEnv,
validateAndGetEnv,
validateEnv,
ValidationError,
ValidatorFunction,
} from "../mod.ts";

Expand Down

0 comments on commit 82e0b28

Please sign in to comment.