UNPKG

craydent-date

Version:

Node module to extend fs/file system functionality and simplify code for maintainability and readability

24 lines (23 loc) 1.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = _getFuncArgs; /*/---------------------------------------------------------/*/ /*/ Craydent LLC node-v0.9.0 /*/ /*/ Copyright 2011 (http://craydent.com/about) /*/ /*/ Dual licensed under the MIT or GPL Version 2 licenses. /*/ /*/ (http://craydent.com/license) /*/ /*/---------------------------------------------------------/*/ /*/---------------------------------------------------------/*/ const craydent_error_1 = require("craydent.error"); const _generalTrim_1 = require("../protected/_generalTrim"); const craydent_strip_1 = require("craydent.strip"); const craydent_condense_1 = require("craydent.condense"); function _getFuncArgs(func) { try { return (0, craydent_condense_1.default)((0, _generalTrim_1.default)((0, craydent_strip_1.default)(func.toString(), '(')).replace(/\s*/gi, '').replace(/\/\*.*?\*\//g, '').replace(/.*?\((.*?)\).*/, '$1').split(',')); } catch (e) /* istanbul ignore next */ { craydent_error_1.default && (0, craydent_error_1.default)('_getFuncArgs', e); return null; } }