From 21b846e17659bdd8fa639124e29544e85ff3af83 Mon Sep 17 00:00:00 2001 From: isaacs Date: Sun, 15 Jan 2023 09:35:46 -0800 Subject: [PATCH] doc: use `import {minimatch}` rather than default 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. --- README.md | 4 ++-- test/basic.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c552f54a..3aa96972 100644 --- a/README.md +++ b/README.md @@ -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! diff --git a/test/basic.js b/test/basic.js index a90a4e0f..e06f2ff5 100644 --- a/test/basic.js +++ b/test/basic.js @@ -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) {