-
-
Notifications
You must be signed in to change notification settings - Fork 354
Expand file tree
/
Copy pathconfig.ts
More file actions
33 lines (30 loc) · 851 Bytes
/
config.ts
File metadata and controls
33 lines (30 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { definePluginConfig, mappers } from '@hey-api/shared';
import { Api } from './api';
// import { handler } from './plugin';
import type { FakerJsFakerPlugin } from './types';
export const defaultConfig: FakerJsFakerPlugin['Config'] = {
api: new Api(),
config: {
case: 'camelCase',
includeInEntry: false,
},
// handler,
handler: () => {},
name: '@faker-js/faker',
resolveConfig: (plugin, context) => {
plugin.config.definitions = context.valueToObject({
defaultValue: {
case: plugin.config.case ?? 'camelCase',
enabled: true,
name: 'v{{name}}',
},
mappers,
value: plugin.config.definitions,
});
},
tags: ['source'],
};
/**
* Type helper for Faker plugin, returns {@link Plugin.Config} object
*/
export const defineConfig = definePluginConfig(defaultConfig);