Files
lsp/node_modules/mongoose/lib/helpers/getFunctionName.js
Arnaud Nelissen 3af7ddab06 Initial commit
2021-11-17 11:25:08 +01:00

9 lines
164 B
JavaScript

'use strict';
module.exports = function(fn) {
if (fn.name) {
return fn.name;
}
return (fn.toString().trim().match(/^function\s*([^\s(]+)/) || [])[1];
};