Skip to content

Commit

Permalink
Improved TSD transformation
Browse files Browse the repository at this point in the history
Signed-off-by: Jaid <[email protected]>
  • Loading branch information
Jaid committed Feb 15, 2019
1 parent 4de1546 commit 2147cef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transformTsd.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const moduleBlockRegex = /(declare module [^\n]+)(.+?)(\n})/gs
const moduleFieldRegex = /^([\t ]*)(type|function|interface|var|const|class) +(\w+)/gm
const moduleFieldRegex = /^([\t ]*)(type|function|interface|var|const|class) +(a-zA-Z0-9_\$+)/gm

const debug = require("debug")("jsdoc-tsd-webpack-plugin")

const transformField = (type, name) => {
if (name === "default") {
if (name === "default" || name === "_default") {
return `export default ${type}`
} else {
return `export ${type} ${name}`
Expand Down

0 comments on commit 2147cef

Please sign in to comment.