Skip to content

Commit e4f8633

Browse files
committed
Named export only, no default export
1 parent 3093d33 commit e4f8633

17 files changed

+21
-27
lines changed

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ import { minimatch } from 'minimatch'
1515
// or:
1616
const { minimatch } = require('minimatch')
1717

18-
// default export also works
19-
import minimatch from 'minimatch'
20-
// or:
21-
const minimatch = require('minimatch')
22-
2318
minimatch('bar.foo', '*.foo') // true!
2419
minimatch('bar.foo', '*.bar') // false!
2520
minimatch('bar.foo', '*.+(bar|foo)', { debug: true }) // true, and noisy!

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# change log
22

3+
## 9.0
4+
5+
- No default export, only named exports.
6+
37
## 8.0
48

59
- Recursive descent parser for extglob, allowing correct support

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"type": "git",
88
"url": "git://github.com/isaacs/minimatch.git"
99
},
10-
"main": "./dist/cjs/index-cjs.js",
10+
"main": "./dist/cjs/index.js",
1111
"module": "./dist/mjs/index.js",
1212
"types": "./dist/cjs/index.d.ts",
1313
"exports": {
@@ -18,7 +18,7 @@
1818
},
1919
"require": {
2020
"types": "./dist/cjs/index.d.ts",
21-
"default": "./dist/cjs/index-cjs.js"
21+
"default": "./dist/cjs/index.js"
2222
}
2323
}
2424
},

src/index-cjs.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ export const minimatch = (
5555
return new Minimatch(pattern, options).match(p)
5656
}
5757

58-
export default minimatch
59-
6058
// Optimized checking for the most common glob patterns.
6159
const starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/
6260
const starDotExtTest = (ext: string) => (f: string) =>

test/brace-expand.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
var tap = require('tap'),
2-
minimatch = require('../').default
1+
var tap = require('tap')
2+
const { minimatch } = require('../')
33

44
tap.test('brace expansion', function (t) {
55
// [ pattern, [expanded] ]

test/class-edge-cases.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const t = require('tap')
2-
const minimatch = require('../').default
2+
const { minimatch } = require('../')
33

44
const files = ['a[]b', '[b-a]x', 'a]b', 'a[]]b', 'a[[]b']
55

test/defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
const t = require('tap')
77
const globalBefore = Object.keys(global)
8-
const mm = require('../').default
8+
const { minimatch: mm } = require('../')
99

1010
const patterns = require('./patterns.js')
1111

test/escaping.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var tap = require('tap')
2-
var minimatch = require('../').default
2+
const { minimatch } = require('../')
33

44
// test all characters with codes in range [mincc,maxcc]
55
var mincc = 0x20

test/extglob-ending-with-state-char.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var test = require('tap').test
2-
var minimatch = require('../').default
2+
const { minimatch } = require('../')
33

44
test('extglob ending with statechar', function (t) {
55
t.notOk(minimatch('ax', 'a?(b*)'))

test/extglob-unfinished.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var t = require('tap')
2-
var mm = require('../').default
2+
const mm = require('../').minimatch
33

44
var types = '!?+*@'.split('')
55

test/negative-extglob-anchoring.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const t = require('tap')
2-
const mm = require('../').default
2+
const mm = require('../').minimatch
33
const pattern = 'a/b/*/!(bar)/*'
44
const nope = 'a/b/c/bar/x'
55
const yup = 'a/b/c/baz/x'

test/nocase-magic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const t = require('tap')
2-
const { Minimatch } = require('../').default
2+
const { Minimatch } = require('../')
33

44
const nomagic = '../1/2/3'
55
const yesmagic = '../x'

test/partial.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const t = require('tap')
2-
const mm = require('../').default
2+
const mm = require('../').minimatch
33
t.equal(mm('/a/b', '/*/b/x/y/z', { partial: true }), true)
44
t.equal(mm('/a/b/c', '/*/b/x/y/z', { partial: true }), false)
55
t.equal(mm('/', 'x', { partial: true }), true)

test/redos.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var t = require('tap')
22

3-
var minimatch = require('../').default
3+
var minimatch = require('../').minimatch
44

55
// utility function for generating long strings
66
var genstr = function (len, chr) {

test/tricky-negations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var t = require('tap')
2-
var minimatch = require('../').default
2+
var minimatch = require('../').minimatch
33
var cases = {
44
'bar.min.js': {
55
'*.!(js|css)': true,

test/win-path-sep.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
const t = require('tap')
22
t.test('path separator /', t => {
33
process.env.__MINIMATCH_TESTING_PLATFORM__ = 'posix'
4-
const mm = t.mock('../', {}).default
4+
const mm = t.mock('../', {}).minimatch
55
t.equal(mm('x/y/z', 'x/y/*/z'), false)
66
t.equal(mm('x/y/w/z', 'x/y/*/z'), true)
77
t.end()
88
})
99

1010
t.test('path separator \\', t => {
1111
process.env.__MINIMATCH_TESTING_PLATFORM__ = 'win32'
12-
const mm = t.mock('../', {}).default
12+
const mm = t.mock('../', {}).minimatch
1313
t.equal(mm('x\\y\\z', 'x/y/*/z'), false)
1414
t.equal(mm('x\\y\\w\\z', 'x/y/*/z'), true)
1515
t.end()
1616
})
1717

1818
t.test('override with options', t => {
1919
process.env.__MINIMATCH_TESTING_PLATFORM__ = 'win32'
20-
const mm = t.mock('../', {}).default
20+
const mm = t.mock('../', {}).minimatch
2121

2222
t.equal(
2323
mm('c:\\foo\\bar', 'c:\\foo\\*', {

0 commit comments

Comments
 (0)