Skip to content

Repository files navigation

@dtsgenerator/replace-namespace

This is the dtsgenerator plugin. Replace matched namespace identifiers by configuration.

Install

npm install @dtsgenerator/replace-namespace

Usage

dtsgen.json

{
"plugins": {
"@dtsgenerator/replace-namespace": {
"map": [
{
"from": ["path1", "path2"],
"to": ["replaced"]
}
]
}
}
}

Configuration

  • the type of configuration
type Config = {
map: {
from: (string | boolean)[];
to: string[];
}[];
};
keytypedescription
mapArray of objectthe mapping of replacing.
map.n.from`Array<stringboolean>`
map.n.to`Array<stringboolean>`

Example

  • Example1
{
"map": [
{
"from": ["Components", "Schemas"],
"to": ["Test", "PetStore"]
},
{
"from": ["Paths"],
"to": ["Test", "PetStore"]
}
]
}
  • Example2
{
"map": [
{
"from": [true, "Schemas"],
"to": ["Test"]
}
]
}
  • Example3 Remove nested namespaces.
{
"map": [
{
"from": [true, true, true],
"to": []
}
]
}

About

dtsgenerator plugin: replace the output namespace

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages