Comparing version 1.1.3 to 2.0.0
18
index.js
@@ -1,11 +0,13 @@ | ||
'use strict' | ||
module.exports = hidden | ||
function hidden(filename) { | ||
if (typeof filename !== 'string') { | ||
throw new Error('Expected string') | ||
/** | ||
* Check if `basename` is hidden (starts with a dot). | ||
* | ||
* @param {string} basename Filename | ||
* @returns {boolean} Whether `basename` is hidden. | ||
*/ | ||
export function isHidden(basename) { | ||
if (typeof basename !== 'string') { | ||
throw new TypeError('Expected string') | ||
} | ||
return filename.charAt(0) === '.' | ||
return basename.charAt(0) === '.' | ||
} |
{ | ||
"name": "is-hidden", | ||
"version": "1.1.3", | ||
"description": "Check if `filename` is hidden (starts with a dot)", | ||
"version": "2.0.0", | ||
"description": "Check if `basename` is hidden (starts with a dot)", | ||
"license": "MIT", | ||
@@ -24,24 +24,29 @@ "keywords": [ | ||
], | ||
"sideEffects": false, | ||
"type": "module", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"files": [ | ||
"index.d.ts", | ||
"index.js" | ||
], | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"browserify": "^16.0.0", | ||
"nyc": "^15.0.0", | ||
"prettier": "^1.0.0", | ||
"remark-cli": "^7.0.0", | ||
"remark-preset-wooorm": "^6.0.0", | ||
"tape": "^4.0.0", | ||
"tinyify": "^2.0.0", | ||
"xo": "^0.25.0" | ||
"@types/tape": "^4.0.0", | ||
"c8": "^7.6.0", | ||
"prettier": "^2.0.0", | ||
"remark-cli": "^9.0.0", | ||
"remark-preset-wooorm": "^8.0.0", | ||
"rimraf": "^3.0.0", | ||
"tape": "^5.0.0", | ||
"typescript": "^4.0.0", | ||
"xo": "^0.38.0" | ||
}, | ||
"scripts": { | ||
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", | ||
"build-bundle": "browserify . -s isHidden -o is-hidden.js", | ||
"build-mangle": "browserify . -s isHidden -p tinyify -o is-hidden.js", | ||
"build": "npm run build-bundle && npm run build-mangle", | ||
"test-api": "node test", | ||
"test-coverage": "nyc --reporter lcov tape test.js", | ||
"test": "npm run format && npm run build && npm run test-coverage" | ||
"prepublishOnly": "npm run build && npm run format", | ||
"prebuild": "rimraf \"*.d.ts\"", | ||
"build": "tsc", | ||
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", | ||
"test-api": "node test.js", | ||
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js", | ||
"test": "npm run build && npm run format && npm run test-coverage" | ||
}, | ||
@@ -58,16 +63,7 @@ "prettier": { | ||
"prettier": true, | ||
"esnext": false, | ||
"rules": { | ||
"unicorn/prefer-type-error": "off" | ||
}, | ||
"ignores": [ | ||
"is-hidden.js" | ||
] | ||
"no-var": "off", | ||
"prefer-arrow-callback": "off" | ||
} | ||
}, | ||
"nyc": { | ||
"check-coverage": true, | ||
"lines": 100, | ||
"functions": 100, | ||
"branches": 100 | ||
}, | ||
"remarkConfig": { | ||
@@ -74,0 +70,0 @@ "plugins": [ |
@@ -8,6 +8,9 @@ # is-hidden | ||
Check if `filename` is hidden (starts with a dot). | ||
Check if `basename` is hidden (starts with a dot). | ||
## Install | ||
This package is ESM only: Node 12+ is needed to use it and it must be `import`ed | ||
instead of `require`d. | ||
[npm][]: | ||
@@ -22,6 +25,6 @@ | ||
```js | ||
var hidden = require('is-hidden') | ||
import {isHidden} from 'is-hidden' | ||
hidden('.git') // => true | ||
hidden('readme.md') // => false | ||
isHidden('.git') // => true | ||
isHidden('readme.md') // => false | ||
``` | ||
@@ -31,6 +34,9 @@ | ||
### `hidden(filename)` | ||
This package exports the following identifiers: `isHidden`. | ||
There is no default export. | ||
Check if `filename` is hidden (starts with a dot). | ||
### `isHidden(basename)` | ||
Check if `basename` is hidden (starts with a dot). | ||
## License | ||
@@ -42,5 +48,5 @@ | ||
[build-badge]: https://img.shields.io/travis/wooorm/is-hidden.svg | ||
[build-badge]: https://github.com/wooorm/is-hidden/workflows/main/badge.svg | ||
[build]: https://travis-ci.org/wooorm/is-hidden | ||
[build]: https://github.com/wooorm/is-hidden/actions | ||
@@ -47,0 +53,0 @@ [coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/is-hidden.svg |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
4740
5
19
66
0
Yes
9