UNPKG

sassdoc

Version:
40 lines (29 loc) 668 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = property; var reqRegEx = /\s*(?:{(.*)})?\s*(?:(\$?\S+))?\s*(?:\[([^\]]*)])?\s*-?\s*([\S\s]*)\s*$/; function property() { return { name: 'property', parse: function parse(text) { var match = reqRegEx.exec(text.trim()); var obj = { type: match[1] || 'Map' }; if (match[2]) { obj.name = match[2]; } if (match[3]) { obj.default = match[3]; } if (match[4]) { obj.description = match[4]; } return obj; }, alias: ['prop'], allowedOn: ['variable'] }; }