@llamaindex/env
Advanced tools
Comparing version 0.0.5 to 0.0.6
# @llamaindex/env | ||
## 0.0.6 | ||
### Patch Changes | ||
- 7a23cc6: feat: improve CallbackManager | ||
## 0.0.5 | ||
@@ -4,0 +10,0 @@ |
@@ -12,2 +12,8 @@ "use strict"; | ||
_export(exports, { | ||
AsyncLocalStorage: function() { | ||
return _utils.AsyncLocalStorage; | ||
}, | ||
CustomEvent: function() { | ||
return _utils.CustomEvent; | ||
}, | ||
EOL: function() { | ||
@@ -14,0 +20,0 @@ return _nodeos.EOL; |
@@ -12,2 +12,8 @@ "use strict"; | ||
_export(exports, { | ||
AsyncLocalStorage: function() { | ||
return _utils.AsyncLocalStorage; | ||
}, | ||
CustomEvent: function() { | ||
return _utils.CustomEvent; | ||
}, | ||
EOL: function() { | ||
@@ -14,0 +20,0 @@ return EOL; |
@@ -5,8 +5,20 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "getEnv", { | ||
enumerable: true, | ||
get: function() { | ||
function _export(target, all) { | ||
for(var name in all)Object.defineProperty(target, name, { | ||
enumerable: true, | ||
get: all[name] | ||
}); | ||
} | ||
_export(exports, { | ||
AsyncLocalStorage: function() { | ||
return _nodeasync_hooks.AsyncLocalStorage; | ||
}, | ||
CustomEvent: function() { | ||
return defaultCustomEvent; | ||
}, | ||
getEnv: function() { | ||
return getEnv; | ||
} | ||
}); | ||
const _nodeasync_hooks = require("node:async_hooks"); | ||
function getEnv(name) { | ||
@@ -24,1 +36,14 @@ if (typeof process === "undefined" || typeof process.env === "undefined") { | ||
} | ||
class CustomEvent extends Event { | ||
#detail; | ||
get detail() { | ||
return this.#detail; | ||
} | ||
constructor(event, options){ | ||
super(event, options); | ||
this.#detail = options?.detail; | ||
} | ||
} | ||
// Node.js doesn't have CustomEvent by default | ||
// Refs: https://github.com/nodejs/node/issues/40678 | ||
const defaultCustomEvent = globalThis.CustomEvent || CustomEvent; |
@@ -32,3 +32,3 @@ import { ok } from "node:assert"; | ||
}; | ||
export { getEnv } from "./utils.js"; | ||
export { AsyncLocalStorage, CustomEvent, getEnv } from "./utils.js"; | ||
export { EOL, ok, path, randomUUID }; |
@@ -30,2 +30,2 @@ import { Sha256 } from "@aws-crypto/sha256-js"; | ||
export * from "./type.js"; | ||
export { getEnv } from "./utils.js"; | ||
export { AsyncLocalStorage, CustomEvent, getEnv } from "./utils.js"; |
@@ -14,3 +14,3 @@ /// <reference types="node" resolution-mode="require"/> | ||
export type * from "./type.js"; | ||
export { getEnv } from "./utils.js"; | ||
export { AsyncLocalStorage, CustomEvent, getEnv } from "./utils.js"; | ||
export { EOL, ok, path, randomUUID }; |
@@ -14,2 +14,2 @@ import pathe from "pathe"; | ||
export * from "./type.js"; | ||
export { getEnv } from "./utils.js"; | ||
export { AsyncLocalStorage, CustomEvent, getEnv } from "./utils.js"; |
@@ -0,1 +1,8 @@ | ||
/// <reference types="node" resolution-mode="require"/> | ||
export declare function getEnv(name: string): string | undefined; | ||
export { AsyncLocalStorage } from "node:async_hooks"; | ||
declare const defaultCustomEvent: { | ||
new <T>(type: string, eventInitDict?: CustomEventInit<T> | undefined): globalThis.CustomEvent<T>; | ||
prototype: globalThis.CustomEvent<any>; | ||
}; | ||
export { defaultCustomEvent as CustomEvent }; |
@@ -13,1 +13,17 @@ export function getEnv(name) { | ||
} | ||
// Browser doesn't support AsyncLocalStorage | ||
export { AsyncLocalStorage } from "node:async_hooks"; | ||
class CustomEvent extends Event { | ||
#detail; | ||
get detail() { | ||
return this.#detail; | ||
} | ||
constructor(event, options){ | ||
super(event, options); | ||
this.#detail = options?.detail; | ||
} | ||
} | ||
// Node.js doesn't have CustomEvent by default | ||
// Refs: https://github.com/nodejs/node/issues/40678 | ||
const defaultCustomEvent = globalThis.CustomEvent || CustomEvent; | ||
export { defaultCustomEvent as CustomEvent }; |
{ | ||
"name": "@llamaindex/env", | ||
"description": "environment wrapper", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"type": "module", | ||
@@ -65,4 +65,4 @@ "types": "dist/type/index.d.ts", | ||
"build": "rm -rf ./dist && pnpm run build:esm && pnpm run build:cjs && pnpm run build:type", | ||
"build:esm": "swc src -d dist --strip-leading-paths --config-file .swcrc", | ||
"build:cjs": "swc src -d dist/cjs --strip-leading-paths --config-file .cjs.swcrc", | ||
"build:esm": "swc src -d dist --strip-leading-paths --config-file ../../.swcrc", | ||
"build:cjs": "swc src -d dist/cjs --strip-leading-paths --config-file ../../.cjs.swcrc", | ||
"build:type": "tsc -p tsconfig.json", | ||
@@ -69,0 +69,0 @@ "postbuild": "node -e \"require('fs').writeFileSync('./dist/cjs/package.json', JSON.stringify({ type: 'commonjs' }))\"", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
76512
454
0
4