Skip to content

Commit

Permalink
doc: use import {minimatch} rather than default
Browse files Browse the repository at this point in the history
Fix: #189

Dodges a weirdly sporadic TS bug.  The default export definitely should
work fine, but it sometimes complains that it has no call signatures,
despite clearly having a call signature.
  • Loading branch information
isaacs committed Jan 15, 2023
1 parent c8deabe commit 21b846e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ objects.

```js
// hybrid module, load with require() or import
import minimatch from 'minimatch'
import { minimatch } from 'minimatch'
// or:
const minimatch = require("minimatch").default
const { minimatch } = require("minimatch")

minimatch("bar.foo", "*.foo") // true!
minimatch("bar.foo", "*.bar") // false!
Expand Down
2 changes: 1 addition & 1 deletion test/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

const t = require('tap')
const globalBefore = Object.keys(global)
const mm = require('../').default
const { minimatch: mm } = require('../')
const patterns = require('./patterns.js')

t.test('basic tests', function (t) {
Expand Down

0 comments on commit 21b846e

Please sign in to comment.