MCPcopy Index your code
hub / github.com/nodejs/node / defaults

Function defaults

deps/minimatch/index.js:1143–1178  ·  view source on GitHub ↗
(def)

Source from the content-addressed store, hash-verified

1141exports.minimatch.filter = exports.filter;
1142var ext = (a, b = {}) => Object.assign({}, a, b);
1143var defaults = (def) => {
1144 if (!def || typeof def !== "object" || !Object.keys(def).length) {
1145 return exports.minimatch;
1146 }
1147 const orig = exports.minimatch;
1148 const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
1149 return Object.assign(m, {
1150 Minimatch: class Minimatch extends orig.Minimatch {
1151 constructor(pattern, options = {}) {
1152 super(pattern, ext(def, options));
1153 }
1154 static defaults(options) {
1155 return orig.defaults(ext(def, options)).Minimatch;
1156 }
1157 },
1158 AST: class AST extends orig.AST {
1159 /* c8 ignore start */
1160 constructor(type, parent, options = {}) {
1161 super(type, parent, ext(def, options));
1162 }
1163 /* c8 ignore stop */
1164 static fromGlob(pattern, options = {}) {
1165 return orig.AST.fromGlob(pattern, ext(def, options));
1166 }
1167 },
1168 unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
1169 escape: (s, options = {}) => orig.escape(s, ext(def, options)),
1170 filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
1171 defaults: (options) => orig.defaults(ext(def, options)),
1172 makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
1173 braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
1174 match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
1175 sep: orig.sep,
1176 GLOBSTAR: exports.GLOBSTAR
1177 });
1178};
1179exports.defaults = defaults;
1180exports.minimatch.defaults = exports.defaults;
1181var braceExpand = (pattern, options = {}) => {

Callers

nothing calls this directly

Calls 10

assignMethod · 0.80
makeReMethod · 0.80
braceExpandMethod · 0.80
extFunction · 0.70
keysMethod · 0.65
filterMethod · 0.65
matchMethod · 0.65
unescapeMethod · 0.45
escapeMethod · 0.45
defaultsMethod · 0.45

Tested by

no test coverage detected