diff --git a/packages/marked-renderer-text/index.d.ts b/packages/marked-renderer-text/index.d.ts new file mode 100644 index 0000000..3ef4752 --- /dev/null +++ b/packages/marked-renderer-text/index.d.ts @@ -0,0 +1,8 @@ +import marked from "marked"; + +export = RenderToText; + +declare class RenderToText extends marked.Renderer { + fancyMode: boolean; + constructor(fancyMode?: boolean, options?: marked.marked.MarkedOptions); +} diff --git a/packages/marked-renderer-text/index.js b/packages/marked-renderer-text/index.js index 1982c69..012575b 100644 --- a/packages/marked-renderer-text/index.js +++ b/packages/marked-renderer-text/index.js @@ -3,7 +3,9 @@ const { Renderer } = require("marked"); module.exports = class RenderToText extends Renderer { constructor(fancyMode, options) { if (typeof fancyMode != "boolean") { - fancyMode = false; + this.fancyMode = false; + } else { + this.fancyMode = fancyMode; } super(options); } diff --git a/packages/marked-renderer-text/package-lock.json b/packages/marked-renderer-text/package-lock.json index 465bf97..0553fde 100644 --- a/packages/marked-renderer-text/package-lock.json +++ b/packages/marked-renderer-text/package-lock.json @@ -1,35 +1,14 @@ { "name": "marked-renderer-text", - "version": "0.1.0", - "lockfileVersion": 2, + "version": "2.0.0", + "lockfileVersion": 1, "requires": true, - "packages": { - "": { - "name": "marked-renderer-text", - "version": "0.1.0", - "peerDependencies": { - "marked": "^4.0.7" - } - }, - "node_modules/marked": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.7.tgz", - "integrity": "sha512-mQrRvV2vRk7DHZsWsYJfAjmBo+lSYPhTJPThaaGpkEfmC+4oefeug2txZniQTieDS0CFpokfVhd7JuS5GtnHhA==", - "peer": true, - "bin": { - "marked": "bin/marked.js" - }, - "engines": { - "node": ">= 12" - } - } - }, "dependencies": { - "marked": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.7.tgz", - "integrity": "sha512-mQrRvV2vRk7DHZsWsYJfAjmBo+lSYPhTJPThaaGpkEfmC+4oefeug2txZniQTieDS0CFpokfVhd7JuS5GtnHhA==", - "peer": true + "@types/marked": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/marked/-/marked-4.0.1.tgz", + "integrity": "sha512-ZigEmCWdNUU7IjZEuQ/iaimYdDHWHfTe3kg8ORfKjyGYd9RWumPoOJRQXB0bO+XLkNwzCthW3wUIQtANaEZ1ag==", + "dev": true } } } diff --git a/packages/marked-renderer-text/package.json b/packages/marked-renderer-text/package.json index 3ee364a..7f3a7bb 100644 --- a/packages/marked-renderer-text/package.json +++ b/packages/marked-renderer-text/package.json @@ -4,10 +4,8 @@ "version": "2.0.0", "author": "Edazpotato (https://edaz.codes/)", "main": "index.js", + "types": "index.d.ts", "repository": "edazpotato/marked-render-to-text", - "peerDependencies": { - "marked": "^4.0.7" - }, "keywords": [ "marked", "markdown", @@ -15,5 +13,11 @@ "plain-text", "renderer" ], - "license": "MIT" + "license": "MIT", + "peerDependencies": { + "marked": "^4.0.7" + }, + "devDependencies": { + "@types/marked": "^4.0.1" + } }