From 09afb763eb3403ccb21b96b9e4326779cdc82e8c Mon Sep 17 00:00:00 2001 From: aoife cassidy Date: Mon, 18 Nov 2024 14:45:11 +0200 Subject: [PATCH] camelcase-keys --- packages/livekit-server-sdk/src/TwirpRPC.ts | 2 +- tsconfig.json | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/livekit-server-sdk/src/TwirpRPC.ts b/packages/livekit-server-sdk/src/TwirpRPC.ts index a3f604f7..d7db2bc5 100644 --- a/packages/livekit-server-sdk/src/TwirpRPC.ts +++ b/packages/livekit-server-sdk/src/TwirpRPC.ts @@ -2,7 +2,6 @@ // // SPDX-License-Identifier: Apache-2.0 import type { JsonValue } from '@bufbuild/protobuf'; -import camelcaseKeys from 'camelcase-keys'; // twirp RPC adapter for client implementation @@ -51,6 +50,7 @@ export class TwirpRpc { throw new Error(`Request failed with status ${response.status}: ${response.statusText}`); } const parsedResp = await response.json(); + const camelcaseKeys = await import('camelcase-keys').then((mod) => mod.default); return camelcaseKeys(parsedResp, { deep: true }); } } diff --git a/tsconfig.json b/tsconfig.json index 2fa1dd79..64e5e421 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "es2015" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, - "module": "es2015" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, + "module": "node16" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, "declaration": true, "declarationMap": true, "sourceMap": true, @@ -9,6 +9,5 @@ "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, "skipLibCheck": true /* Skip type checking of declaration files. */, "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */, - "moduleResolution": "node" } }