Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <script src="https://wzrd.in/standalone/minimatch@latest"></script>
  <script src="https://npmcdn.com/expect@1.20.1/umd/expect.js"></script>
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
console.clear()
//           'src/js/*!(test|stub).js' // non-working version
const glob = 'src/js/!(*test|*stub).js'
const shouldMatch = [
  'src/js/foo.js',
  'src/js/bar.js',
  'src/js/baz.js',
]
const shouldNotMatch = [
  'src/js/foo.test.js',
  'src/js/bar.stub.js',
  'src/baz/blob.js',
]
const all = shouldMatch.concat(shouldNotMatch)
const matched = minimatch.match(all, glob)
expect(matched).toEqual(shouldMatch)
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
kentcdoddspro
0viewers