Skip to content

Commit

Permalink
*: use example.mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
montyanderson committed Jan 4, 2025
1 parent c7c848c commit 829061e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ jobs:
node-version: ${{ matrix.node-version }}

- run: npm run prepublish

- run: node example.mjs
9 changes: 5 additions & 4 deletions example.ts → example.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { createProdia } from "./v2";
import { createProdia } from "./dist/v2/index.js";
import { strictEqual } from "assert";

const token = Deno.env.get("PRODIA_TOKEN");
const token = process.env.PRODIA_TOKEN;

if (typeof token !== "string") {
throw new Error("PRODIA_TOKEN is not set");
}

const isJpeg = (image: ArrayBuffer): boolean => {
const isJpeg = (image) => {
const view = new Uint8Array(image);

return view[0] === 0xff && view[1] === 0xd8;
Expand All @@ -28,4 +29,4 @@ const job = await client.job({

const image = await job.arrayBuffer();

assertEquals(isJpeg(image), true, "Image should be a JPEG");
strictEqual(isJpeg(image), true, "Image should be a JPEG");

0 comments on commit 829061e

Please sign in to comment.