( cwd: string | DefineSupportCodeFunction = __dirname, fn: DefineSupportCodeFunction = null )
| 23 | type DefineSupportCodeFunction = (methods: IDefineSupportCodeMethods) => void |
| 24 | |
| 25 | export function buildSupportCodeLibrary( |
| 26 | cwd: string | DefineSupportCodeFunction = __dirname, |
| 27 | fn: DefineSupportCodeFunction = null |
| 28 | ): SupportCodeLibrary { |
| 29 | if (typeof cwd === 'function') { |
| 30 | fn = cwd |
| 31 | cwd = __dirname |
| 32 | } |
| 33 | const supportCodeLibraryBuilder = new SupportCodeLibraryBuilder() |
| 34 | supportCodeLibraryBuilder.reset(cwd, IdGenerator.incrementing()) |
| 35 | if (doesHaveValue(fn)) { |
| 36 | fn(supportCodeLibraryBuilder.methods) |
| 37 | } |
| 38 | return supportCodeLibraryBuilder.finalize() |
| 39 | } |
no test coverage detected