Package Exports
- @jswork/wildcard-match
- @jswork/wildcard-match/dist/index.cjs.js
- @jswork/wildcard-match/dist/index.esm.js
- @jswork/wildcard-match/dist/index.umd.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jswork/wildcard-match) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
wildcard-match
A function for matching strings using * wildcard patterns.
installation
npm install @jswork/wildcard-match
usage
import wildcardMatch from '@jswork/wildcard-match';
// 测试案例
console.log(wildcardMatch("filename.txt", "*name")); // false
console.log(wildcardMatch("filename.txt", "name*")); // false
console.log(wildcardMatch("filename.txt", "*name*")); // true
console.log(wildcardMatch("abcfilenameabc", "*xx*name*xx*")); // false
console.log(wildcardMatch("xxabcnamexx", "*xx*name*xx*")); // true
license
Code released under the MIT license.