Fixed exports and compiled function to ESM

This commit is contained in:
Alexander Cerutti
2023-07-29 23:58:49 +02:00
parent f2442fc4ce
commit fb6e6739b5
3 changed files with 7 additions and 4 deletions

View File

@@ -16,6 +16,7 @@
"engines": {
"node": "16"
},
"type": "module",
"main": "lib/index.js",
"dependencies": {
"axios": "^1.2.6",

View File

@@ -1,11 +1,13 @@
import functions from "firebase-functions";
import * as functions from "firebase-functions";
import admin from "firebase-admin";
import { PKPass } from "passkit-generator";
import passkit from "passkit-generator";
import type { Barcode, TransitType } from "passkit-generator";
import fs from "node:fs";
import path from "node:path";
import os from "node:os";
const PKPass = passkit.PKPass;
// Firebase init
admin
.initializeApp
@@ -57,7 +59,7 @@ declare global {
}
}
exports.pass = functions.https.onRequest(async (request, response) => {
export const pass = functions.https.onRequest(async (request, response) => {
const newPass = await PKPass.from(
{
// Get relevant pass model from model folder (see passkit-generator/examples/models/)

View File

@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es2016",
"target": "ESNext",
"module": "NodeNext",
"rootDir": "src",
"moduleResolution": "NodeNext",