Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add basic typescript typings #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ vendor
temp
tmp
TODO.md
package-lock.json
package-lock.json
types
2 changes: 1 addition & 1 deletion lib/picomatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
* console.log(isMatch('a.b')); //=> true
* ```
* @name picomatch
* @param {String|Array} `globs` One or more glob patterns.
* @param {String|Array} `glob` One or more glob patterns.
* @param {Object=} `options`
* @return {Function=} Returns a matcher function.
* @api public
Expand Down
2 changes: 1 addition & 1 deletion lib/scan.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const depth = token => {
* console.log(pm.scan('foo/bar/*.js'));
* { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
* ```
* @param {String} `str`
* @param {String} `input`
* @param {Object} `options`
* @return {Object} Returns an object with tokens and regex source string.
* @api public
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,31 @@
"license": "MIT",
"files": [
"index.js",
"types/index.d.ts",
"lib"
],
"main": "index.js",
"typings": "types/index.d.ts",
"engines": {
"node": ">=8.6"
},
"scripts": {
"lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .",
"mocha": "mocha --reporter dot",
"test": "npm run lint && npm run mocha",
"test": "npm run lint && npm run mocha && npm run types",
"test:ci": "npm run test:cover",
"types": "tsc",
"test:cover": "nyc npm run mocha"
},
"devDependencies": {
"@types/node": "^13.1.0",
"eslint": "^6.8.0",
"fill-range": "^7.0.1",
"gulp-format-md": "^2.0.0",
"mocha": "^6.2.2",
"nyc": "^15.0.0",
"time-require": "github:jonschlinkert/time-require"
"time-require": "github:jonschlinkert/time-require",
"typescript": "^3.7.4"
},
"keywords": [
"glob",
Expand Down
11 changes: 11 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"declaration": true,
"noEmit": false,
"allowJs": true,
"checkJs": false,
"outDir": "types",
"emitDeclarationOnly": true
},
"include": ["index.js"]
}