Skip to content

Commit a43a810

Browse files
chore: wip
1 parent e4fbb0b commit a43a810

File tree

3 files changed

+22
-17
lines changed

3 files changed

+22
-17
lines changed

src/config.ts

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1-
import { loadConfig } from 'c12'
21
import type { Config } from './types'
2+
import { loadConfig } from 'c12'
3+
4+
// Define an async function to load the config
5+
async function loadDynamoDBConfig() {
6+
const { config } = await loadConfig({
7+
name: 'dynamodb',
8+
defaultConfig: {
9+
port: 8000,
10+
dbPath: '',
11+
detached: false,
12+
additionalArgs: ['-sharedDb'],
13+
javaOpts: '',
14+
installPath: 'dynamodb-local',
15+
downloadUrl: 'https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz',
16+
},
17+
}) as { config: Config }
318

4-
// Get loaded config
5-
const { config } = await loadConfig({
6-
name: 'dynamodb',
7-
defaultConfig: {
8-
port: 8000,
9-
dbPath: '',
10-
detached: false,
11-
additionalArgs: ['-sharedDb'],
12-
javaOpts: '',
13-
installPath: 'dynamodb-local',
14-
downloadUrl: 'https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz',
15-
},
16-
}) as { config: Config }
19+
return config
20+
}
1721

18-
export { config }
22+
// Export the config (wrapped in a promise)
23+
export const config = loadDynamoDBConfig()

src/toolbox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { Table, Entity } from 'dynamodb-toolbox'
1+
export { Entity, Table } from 'dynamodb-toolbox'

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { promisify } from 'node:util'
21
import * as fs from 'node:fs'
2+
import { promisify } from 'node:util'
33

44
export async function exists(path: string): Promise<boolean> {
55
const access = promisify(fs.access)

0 commit comments

Comments
 (0)