@tdb/util
Version:
Shared helpers and utilities.
14 lines (11 loc) • 362 B
text/typescript
import { expect } from 'chai';
import * as str from '.';
describe('str.wildcard', () => {
it('isWildcardMatch', () => {
expect(str.isWildcardMatch('bath', 'ba*')).to.eql(true);
});
it('matches multiple values', () => {
const result = str.matchesWildcard(['bath', 'batty', 'zoo'], ['ba*']);
expect(result).to.eql(['bath', 'batty']);
});
});