Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2a6fc4110e | |||
| c82bb44007 | |||
| afd8db1acf | |||
| 74a08d6e39 | |||
| a92cb2e612 | |||
| 716ed45149 | |||
| 7d240b3461 |
17
package-lock.json
generated
17
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartmatch",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.6",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -1012,6 +1012,21 @@
|
||||
"p-defer": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"matcher": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://verdaccio.lossless.one/matcher/-/matcher-2.1.0.tgz",
|
||||
"integrity": "sha512-o+nZr+vtJtgPNklyeUKkkH42OsK8WAfdgaJE2FNxcjLPg+5QbeEoT6vRj8Xq/iv18JlQ9cmKsEu0b94ixWf1YQ==",
|
||||
"requires": {
|
||||
"escape-string-regexp": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"escape-string-regexp": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://verdaccio.lossless.one/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
|
||||
"integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"mem": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://verdaccio.lossless.one/mem/-/mem-4.3.0.tgz",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartmatch",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.6",
|
||||
"private": false,
|
||||
"description": "a minimal matching library using picomatch",
|
||||
"main": "dist/index.js",
|
||||
@@ -20,7 +20,9 @@
|
||||
"tslint": "^5.11.0",
|
||||
"tslint-config-prettier": "^1.15.0"
|
||||
},
|
||||
"dependencies": {},
|
||||
"dependencies": {
|
||||
"matcher": "^2.1.0"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
"ts_web/**/*",
|
||||
|
||||
@@ -2,7 +2,12 @@ import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as smartmatch from '../ts/index';
|
||||
|
||||
tap.test('first test', async () => {
|
||||
console.log(smartmatch.standardExport);
|
||||
const smartMatchInstance = new smartmatch.SmartMatch('*.any');
|
||||
const isAMatch = smartMatchInstance.match('wow.any');
|
||||
const isNotAMatch = smartMatchInstance.match('wow.not');
|
||||
|
||||
expect(isAMatch).to.be.true;
|
||||
expect(isNotAMatch).to.be.false;
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
||||
11
ts/index.ts
11
ts/index.ts
@@ -1,3 +1,12 @@
|
||||
import * as plugins from './smartmatch.plugins';
|
||||
|
||||
export let standardExport = 'Hi there! :) This is an exported string';
|
||||
export class SmartMatch {
|
||||
public wildcard: string;
|
||||
constructor(wildcardArg: string) {
|
||||
this.wildcard = wildcardArg;
|
||||
}
|
||||
|
||||
public match(matchStringArg: string): boolean {
|
||||
return plugins.matcher.isMatch(matchStringArg, this.wildcard);
|
||||
}
|
||||
}
|
||||
@@ -1,2 +1,6 @@
|
||||
const removeme = {};
|
||||
export { removeme };
|
||||
// third party scope
|
||||
import matcher from 'matcher';
|
||||
|
||||
export {
|
||||
matcher
|
||||
}
|
||||
Reference in New Issue
Block a user