aboutsummaryrefslogtreecommitdiff
path: root/node_modules/nanomatch/index.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
committerFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
commitbbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch)
treec58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/nanomatch/index.js
parent003fb34971cf63466184351b4db5f7c67df4f444 (diff)
update packages
Diffstat (limited to 'node_modules/nanomatch/index.js')
-rw-r--r--node_modules/nanomatch/index.js23
1 files changed, 9 insertions, 14 deletions
diff --git a/node_modules/nanomatch/index.js b/node_modules/nanomatch/index.js
index f402d59c9..dddc6128e 100644
--- a/node_modules/nanomatch/index.js
+++ b/node_modules/nanomatch/index.js
@@ -529,13 +529,12 @@ nanomatch.matcher = function matcher(pattern, options) {
};
}
- var fn = test(re);
- Object.defineProperty(fn, 'result', {
- configurable: true,
- enumerable: false,
- value: re.result
- });
- return fn;
+ // create matcher function
+ var matcherFn = test(re);
+ // set result object from compiler on matcher function,
+ // as a non-enumerable property. useful for debugging
+ utils.define(matcherFn, 'result', re.result);
+ return matcherFn;
};
/**
@@ -608,13 +607,9 @@ nanomatch.makeRe = function(pattern, options) {
function makeRe() {
var opts = utils.extend({wrap: false}, options);
- var res = nanomatch.create(pattern, opts);
- var regex = toRegex(res.output, opts);
- Object.defineProperty(regex, 'result', {
- configurable: true,
- enumerable: false,
- value: res
- });
+ var result = nanomatch.create(pattern, opts);
+ var regex = toRegex(result.output, opts);
+ utils.define(regex, 'result', result);
return regex;
}