Skip to content

Commit

Permalink
Add support for exported module
Browse files Browse the repository at this point in the history
  • Loading branch information
SafeerH committed Jun 29, 2021
1 parent 714e256 commit 5b1af7b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $ npm install --save csharp-models-to-typescript

1. Add a config file to your project that contains for example...

```
```json
{
"include": [
"./models/**/*.cs",
Expand All @@ -44,7 +44,8 @@ $ npm install --save csharp-models-to-typescript
"customTypeTranslations": {
"ProductName": "string",
"ProductNumber": "string"
}
},
"exportedModule": false
}
```

Expand Down
2 changes: 1 addition & 1 deletion converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const createConverter = config => {

if (config.namespace) {
return [
`declare module ${config.namespace} {`,
`${config.exportedModule ? 'export' : 'declare'} module ${config.namespace} {`,
...filteredContent,
'}',
].join('\n');
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const converter = createConverter({
camelCaseOptions: config.camelCaseOptions || {},
camelCaseEnums: config.camelCaseEnums || false,
numericEnums: config.numericEnums || false,
stringLiteralTypesInsteadOfEnums: config.stringLiteralTypesInsteadOfEnums || false
stringLiteralTypesInsteadOfEnums: config.stringLiteralTypesInsteadOfEnums || false,
exportedModule: config.exportedModule || false
});

let timer = process.hrtime();
Expand Down

0 comments on commit 5b1af7b

Please sign in to comment.