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 522bea6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

strategy:
matrix:
node-version: [16, 18, 20, 22]
node-version: [18, 20, 22]

steps:
- uses: actions/checkout@v3
Expand All @@ -37,3 +37,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- run: npm run prepublish

- run: node example.mjs
env:
PRODIA_TOKEN: ${{ secrets.PRODIA_TOKEN }}
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 522bea6

Please sign in to comment.