RunKit + npm: comment-parser

node v17.9.1
version: master
endpointsharetweet
const {parse, tokenizers} = require("comment-parser") const DEFAULT = 'default'; const DEFAULT_Value = 'defaultvalue'; const { name: nameTokenizer, tag: tagTokenizer, type: typeTokenizer, description: descriptionTokenizer } = tokenizers; const commentString = `/** * The value * * @default [] */` const parsed = parse(commentString, { spacing: "preserve", tokenizers: [ tagTokenizer(), typeTokenizer(), (spec) => { if ([DEFAULT, DEFAULT_Value].includes(spec.tag)) { console.log(commentString) console.log(spec) return spec; } return nameTokenizer()(spec); }, descriptionTokenizer('preserve') ], })[0];
Created from: https://npm.runkit.com/comment-parser
Loading…

no comments

    sign in to comment