fuzzmatch 1.0.1 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -5
  2. package/index.js +34 -33
  3. package/package.json +26 -17
package/README.md CHANGED
@@ -23,10 +23,6 @@ Again, if you want anymatch, just do this:
23
23
  ```js
24
24
  var anymatch = fuzzmatch('anymatch')
25
25
  ```
26
- Last, but not least, if you want is-match, just do this:
27
- ```js
28
- var matcher = fuzzmatch('is-match')
29
- ```
30
26
  Here is an example:
31
27
  ```js
32
28
  var assert = require('assert')
@@ -41,4 +37,4 @@ assert(fuzzmatch('nanomatch') === require('nanomatch'))
41
37
  If you use a lot of matchers in JavaScript, instead of doing `npm i picomatch micromatch nanomatch anymatch`, you can just type `npm i fuzzmatch` and then call it with your matcher name to get the matcher.
42
38
 
43
39
  ## contributing
44
- there is no contributing which is why there is no github repositroy.
40
+ ~~there is no contributing which is why there is no github repositroy~~. edit: actually there is a github repository now, so i guess there is contributing. whatever. contribute if you want, i guess
package/index.js CHANGED
@@ -1,42 +1,43 @@
1
- var picomatch = require('picomatch')
2
- var micromatch = require('micromatch')
3
- var nanomatch = require('nanomatch')
4
- var anymatch = require('anymatch')
5
- var isMatch = require('is-match')
6
- var matchers = ["picomatch", "micromatch", "nanomatch", "anymatch", "is-match"]
7
- var listOfMatchersAsAString = matchers.join("\", \"") + "\""
8
- var isString = require('is-string')
9
- var throwErr = require('throw-error')
10
- var $TypeError = require('es-errors/type')
11
- var f = require('false')
1
+ var picomatch = require("picomatch")
2
+ var micromatch = require("micromatch")
3
+ var nanomatch = require("nanomatch")
4
+ var anymatch = require("anymatch")
5
+ var matchers = ["picomatch", "micromatch", "nanomatch", "anymatch"]
6
+ var listOfMatchersAsAString = matchers.join('", "') + '"'
7
+ var isString = require("is-string")
8
+ var throwErr = require("basic-functions").throw
9
+ var $TypeError = require("es-error-intrinsics/TypeError")
10
+ var f = require("false-value")
12
11
 
13
12
  module.exports = function fuzzmatch(type) {
14
- if (!isString(type) || !matchers.includes(type)) {
15
- throwErr(new $TypeError(`Type must be a matcher string, which can be one of the following: ${listOfMatchersAsAString}`))
16
- return f()
17
- }
18
- var matcher = getMatcher(type)
19
- var resultMatcher = fuzz(matcher)
20
- return resultMatcher
13
+ if (!isString(type) || !matchers.includes(type)) {
14
+ throwErr(
15
+ new $TypeError(
16
+ `Type must be a matcher string, which can be one of the following: ${listOfMatchersAsAString}`,
17
+ ),
18
+ )
19
+ return f()
20
+ }
21
+ var matcher = getMatcher(type)
22
+ var resultMatcher = fuzz(matcher)
23
+ return resultMatcher
21
24
  }
22
25
 
23
26
  function getMatcher(matcherName) {
24
- switch (matcherName) {
25
- case "picomatch":
26
- return picomatch
27
- case "micromatch":
28
- return micromatch
29
- case "nanomatch":
30
- return nanomatch
31
- case "anymatch":
32
- return anymatch
33
- case "is-match":
34
- return isMatch
35
- default:
36
- throw new Error("nota m atcher")
37
- }
27
+ switch (matcherName) {
28
+ case "picomatch":
29
+ return picomatch
30
+ case "micromatch":
31
+ return micromatch
32
+ case "nanomatch":
33
+ return nanomatch
34
+ case "anymatch":
35
+ return anymatch
36
+ default:
37
+ return
38
+ }
38
39
  }
39
40
 
40
41
  function fuzz(matcher) {
41
- return matcher
42
+ return matcher
42
43
  }
package/package.json CHANGED
@@ -1,28 +1,37 @@
1
1
  {
2
- "dependencies": {
3
- "anymatch": "^3.1.3",
4
- "es-errors": "^1.3.0",
5
- "false": "^0.0.4",
6
- "is-match": "^1.0.0",
7
- "is-string": "^1.0.7",
8
- "micromatch": "^4.0.8",
9
- "nanomatch": "^1.2.13",
10
- "picomatch": "^4.0.2",
11
- "throw-error": "^1.0.0"
12
- },
13
2
  "name": "fuzzmatch",
3
+ "version": "1.0.12",
14
4
  "description": "A wrapper for your matchers!",
15
- "version": "1.0.1",
16
- "main": "index.js",
17
- "scripts": {
18
- "test": "echo \"Error: no test specified\" && exit 1"
19
- },
20
5
  "keywords": [
21
6
  "match",
22
7
  "glob",
23
8
  "match",
24
9
  "picomatch"
25
10
  ],
11
+ "homepage": "https://github.com/10xly/fuzzmatch#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/10xly/fuzzmatch/issues"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/10xly/fuzzmatch.git"
18
+ },
19
+ "license": "MIT",
26
20
  "author": "tj-commits",
27
- "license": "MIT"
21
+ "type": "commonjs",
22
+ "main": "index.js",
23
+ "scripts": {
24
+ "test": "echo \"Error: no test specified\" && exit 1"
25
+ },
26
+ "dependencies": {
27
+ "anymatch": "^3.1.3",
28
+ "basic-functions": "^1.0.6",
29
+ "es-error-intrinsics": "^1.0.1",
30
+ "false-value": "^2.0.6",
31
+ "is-string": "^1.0.7",
32
+ "micromatch": "^4.0.8",
33
+ "nanomatch": "^1.2.13",
34
+ "picomatch": "^4.0.2"
35
+ },
36
+ "devDependencies": {}
28
37
  }