New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

graphdoc-plugin-erase

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphdoc-plugin-erase - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0-alpha

5

CHANGELOG.md
# graphdoc-plugin-erase Change Log
## 1.1.0 - June 2021
* Adds `eraseByDescriptionRegex` to allow removing specific types from documentation, based on `description`.
* Updates Documentation.
## 1.0.1 - May 2021
* Only fixes Documentation for npmjs.

5

lib/index.js

@@ -8,4 +8,7 @@ // Copyright (c) 2021 Gonzalo Müller Bravo.

const eraseByNameRegex = config.eraseByNameRegex ? new RegExp(config.eraseByNameRegex) : /^__/
const eraseByDescriptionRegex = config.eraseByDescriptionRegex ? new RegExp(config.eraseByDescriptionRegex) : /^$/
const eraseByKindRegex = config.eraseByKindRegex ? new RegExp(config.eraseByKindRegex) : /^$/
schema.types = schema.types.filter(type => !eraseByNameRegex.test(type.name) && !eraseByKindRegex.test(type.kind))
schema.types = schema.types.filter(type =>
!eraseByNameRegex.test(type.name) && !eraseByDescriptionRegex.test(type.description) && !eraseByKindRegex.test(type.kind)
)
}

@@ -12,0 +15,0 @@ }

4

package.json
{
"name": "graphdoc-plugin-erase",
"description": "GraphQL documentation erasing unwanted types using graphdoc",
"version": "1.0.1",
"description": "GraphQL schema HTML documentation generation, erasing unwanted types using graphdoc",
"version": "1.1.0-alpha",
"license": "MIT",

@@ -6,0 +6,0 @@ "author": "Gonzalo Müller Bravo",

@@ -6,3 +6,3 @@ <p align="center">

<h1 align="center">GraphQL documentation erasing unwanted types using graphdoc</h1>
<h1 align="center">GraphQL schema HTML documentation generation, erasing unwanted types using graphdoc</h1>

@@ -29,3 +29,3 @@ [![graphdoc-plugin-erase](https://badgen.net/badge/homepage/graphdoc-plugin-erase/blue)](https://graphdoc-plugins.github.io)

"@2fd/graphdoc": "2.4.0",
"graphdoc-plugin-erase": "1.0.1",
"graphdoc-plugin-erase": "1.1.0",
```

@@ -41,2 +41,3 @@

"eraseByNameRegex": "\\w*No",
"eraseByDescriptionRegex": "@RemoveFromDocumentation",
"eraseByKindRegex": "(?:UNION|SCALAR)"

@@ -83,2 +84,3 @@ }

"eraseByNameRegex": "^__",
"eraseByDescriptionRegex": "^$",
"eraseByKindRegex": "^$"

@@ -89,7 +91,13 @@ }

* `eraseByNameRegex`: Regular Expression to be used to remove type based on `name`.
* `eraseByKindRegex`: Regular Expression to be used to remove type based on `kind`.
* `eraseByNameRegex`: Regular Expression to be used to remove types, based on `name`.
* `eraseByDescriptionRegex`: Regular Expression to be used to remove types, based on `description`.
* `eraseByKindRegex`: Regular Expression to be used to remove types, based on `kind`.
> `graphdoc-plugin-erase` plugin should be add before the plugins we want to have filtered types.
## Online Examples
* Pokemon GraphQL schema: [Project](https://github.com/gmullerb/base-graphdoc-yarn) and [Online generated documentation](https://gmullerb.gitlab.io/base-graphdoc-yarn).
* Github GraphQL schema: [Project](https://github.com/gmullerb/base-graphdoc-npm) and [Online generated documentation](https://gmullerb.gitlab.io/base-graphdoc-npm).
__________________

@@ -96,0 +104,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc