Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-hidden

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-hidden - npm Package Compare versions

Comparing version 1.1.3 to 2.0.0

index.d.ts

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc