File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -234,27 +234,28 @@ console.log(result);
234
234
negated: true }
235
235
` ` `
236
236
237
- ### [.compileRe](lib/picomatch.js#L249 )
237
+ ### [.compileRe](lib/picomatch.js#L250 )
238
238
239
- Create a regular expression from a glob pattern.
239
+ Create a regular expression from a parsed glob pattern.
240
240
241
241
**Params**
242
242
243
- * ` input ` **{String}**: A glob pattern to convert to regex .
243
+ * ` state ` **{String}**: The object returned from the ` . parse ` method .
244
244
* ` options` **{Object}**
245
245
* ` returns` **{RegExp}**: Returns a regex created from the given pattern.
246
246
247
247
**Example**
248
248
249
249
` ` ` js
250
250
const picomatch = require (' picomatch' );
251
- // picomatch.makeRe(input[, options]);
251
+ const state = picomatch .parse (' *.js' );
252
+ // picomatch.compileRe(state[, options]);
252
253
253
- console .log (picomatch .makeRe ( ' *.js ' ));
254
+ console .log (picomatch .compileRe (state ));
254
255
// => /^(?:(?!\.)(?=.)[^/]*?\.js)$/
255
256
` ` `
256
257
257
- ### [.toRegex](lib/picomatch.js#L317 )
258
+ ### [.toRegex](lib/picomatch.js#L318 )
258
259
259
260
Create a regular expression from the given regex source string.
260
261
Original file line number Diff line number Diff line change @@ -231,16 +231,17 @@ picomatch.parse = (pattern, options) => {
231
231
picomatch . scan = ( input , options ) => scan ( input , options ) ;
232
232
233
233
/**
234
- * Create a regular expression from a glob pattern.
234
+ * Create a regular expression from a parsed glob pattern.
235
235
*
236
236
* ```js
237
237
* const picomatch = require('picomatch');
238
- * // picomatch.makeRe(input[, options]);
238
+ * const state = picomatch.parse('*.js');
239
+ * // picomatch.compileRe(state[, options]);
239
240
*
240
- * console.log(picomatch.makeRe('*.js' ));
241
+ * console.log(picomatch.compileRe(state ));
241
242
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
242
243
* ```
243
- * @param {String } `input` A glob pattern to convert to regex .
244
+ * @param {String } `state` The object returned from the `.parse` method .
244
245
* @param {Object } `options`
245
246
* @return {RegExp } Returns a regex created from the given pattern.
246
247
* @api public
You can’t perform that action at this time.
0 commit comments