@dtsgenerator/replace-namespace

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

    Install

    npm i @dtsgenerator/replace-namespace

    DownloadsWeekly Downloads

    3,211

    Version

    1.5.1

    License

    MIT

    Unpacked Size

    33.9 kB

    Total Files

    9

    Last publish

    Collaborators

    • horiuchi