1.6.0 • Published 9 months ago

@dtsgenerator/replace-namespace v1.6.0

Weekly downloads
1,500
License
MIT
Repository
github
Last release
9 months ago

@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.fromArray<string | boolean>the definition of from name. if this value is true, it treated as wildcard .
map.n.toArray<string | boolean>the definition of to name.

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

9 months ago

1.6.0

9 months ago

1.5.4

1 year ago

1.5.2

2 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago