mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-29 00:51:29 +08:00
From README.md: the exported function returns a boolean not a void.
var minimatch = require("minimatch")
minimatch("bar.foo", "*.foo") // true!
20 lines
379 B
TypeScript
20 lines
379 B
TypeScript
/// <reference path="./minimatch.d.ts" />
|
|
|
|
import mm = require("minimatch");
|
|
|
|
var pattern = "**/*.ts";
|
|
var options = {
|
|
debug: true
|
|
};
|
|
var m = new mm.Minimatch(pattern, options);
|
|
var r = m.makeRe();
|
|
|
|
var f = ["test.ts"];
|
|
mm.match(f, pattern, options);
|
|
|
|
mm.filter('foo')('bar');
|
|
|
|
var s: string = "hello";
|
|
var b: boolean = mm(s, pattern, options);
|
|
var b: boolean = mm(s, pattern);
|