@dtsgenerator/replace-namespace

1.6.0 • Public • Published

@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[];
    }[];
};
key type description
map Array of object the mapping of replacing.
map.n.from `Array<string boolean>`
map.n.to `Array<string boolean>`

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": []
    }
  ]
}

Package Sidebar

Install

npm i @dtsgenerator/replace-namespace

Weekly Downloads

4,721

Version

1.6.0

License

MIT

Unpacked Size

34.4 kB

Total Files

10

Last publish

Collaborators

  • horiuchi