Skip to content

Commit

Permalink
Added arg to docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
therewillbeode committed Oct 2, 2016
1 parent 1247939 commit 362f093
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const _ = require("lodash");
*
* @private
* @param {Object} Contains regex name and a regexp object i.e { 'name': /alexa/, 'age': /\d{2}/ } to iterate over.
* @param {String} The string for which to match the regexps in each property of object.
* @param {String | Array} The string or array of strings for which to match the regexps in each property of object.
* @returns {Object} Returns the original object where property values are the result of the match.
*/
function mapRegexps(regexpDict, sourceTxt) {
Expand Down Expand Up @@ -44,3 +44,14 @@ module.exports = function (regexpDict, sourceTxt) {
return mapRegexps(regexpDict, sourceTxt);
};

let regexObject = {
"name": /alexa/,
"age": /\d{2}/
};

let stringToMatch = "My name is alexa and I am 18.";

let f =mapRegexps(regexObject, stringToMatch);
console.log(f)


0 comments on commit 362f093

Please sign in to comment.