solorice/vscode/extensions/njpwerner.autodocstring-0.6.1/out/parse/get_function_name.js
2022-04-28 20:54:44 +03:00

13 lines
451 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFunctionName = void 0;
function getFunctionName(functionDefinition) {
const pattern = /(?:def|class)\s+(\w+)\s*\(/;
const match = pattern.exec(functionDefinition);
if (match == undefined || match[1] == undefined) {
return "";
}
return match[1];
}
exports.getFunctionName = getFunctionName;
//# sourceMappingURL=get_function_name.js.map