Skip to content

Commit

Permalink
chore(internal): remove deno build (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored and rattrayalex committed Aug 9, 2023
1 parent cdf808c commit 9af1527
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 211 deletions.
18 changes: 2 additions & 16 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,7 @@ npm exec prettier -- --loglevel=warn --write .
(cd dist && node -e 'require("@anthropic-ai/sdk")')
(cd dist && node -e 'import("@anthropic-ai/sdk")' --input-type=module)

if command -v deno &> /dev/null
if command -v deno &> /dev/null && [ -e ./build-deno ]
then
rm -rf deno; mkdir deno
cp -rp src/* README.md deno
rm deno/_shims/*.{d.ts,js,mjs,node.ts}
for file in deno/_shims/*.deno.ts; do
mv -- "$file" "${file%.deno.ts}.ts"
done
for file in LICENSE CHANGELOG.md; do
if [ -e "${file}" ]; then cp "${file}" deno; fi
done
npm exec ts-node -- scripts/denoify.ts
deno fmt deno


# make sure that nothing crashes when we load the Deno module
(cd deno && deno run index.ts)
./build-deno
fi
193 changes: 0 additions & 193 deletions scripts/denoify.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -823,10 +823,10 @@ export const ensurePresent = <T>(value: T | null | undefined): T => {
*/
export const readEnv = (env: string): string | undefined => {
if (typeof process !== 'undefined') {
return process.env[env] ?? undefined;
return process.env?.[env] ?? undefined;
}
if (typeof Deno !== 'undefined') {
return Deno.env.get(env);
return Deno.env?.get?.(env);
}
return undefined;
};
Expand Down

0 comments on commit 9af1527

Please sign in to comment.