UNPKG

@solvprotocol/upgrade-safe-transpiler

Version:

Solidity preprocessor used to generate OpenZeppelin Contracts Upgrade Safe.

19 lines 939 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.extractNatspec = void 0; const execall_1 = require("./execall"); function* extractNatspec(node) { var _a, _b, _c, _d, _e; const doc = typeof node.documentation === 'string' ? node.documentation : (_b = (_a = node.documentation) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : ''; for (const { groups } of (0, execall_1.execall)(/^\s*(?:@(?<title>\w+)(?::(?<tag>[a-z][a-z-]*))? )?(?<args>(?:(?!^\s@\w+)[^])*)/m, doc)) { if (groups) { yield { title: (_c = groups.title) !== null && _c !== void 0 ? _c : '', tag: (_d = groups.tag) !== null && _d !== void 0 ? _d : '', args: (_e = groups.args) !== null && _e !== void 0 ? _e : '', }; } } } exports.extractNatspec = extractNatspec; //# sourceMappingURL=extractNatspec.js.map