Socket
Socket
Sign inDemoInstall

is-hexadecimal

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-hexadecimal - npm Package Compare versions

Comparing version 1.0.4 to 2.0.0

index.d.ts

15

index.js

@@ -1,8 +0,9 @@

'use strict'
module.exports = hexadecimal
// Check if the given character code, or the character code at the first
// character, is hexadecimal.
function hexadecimal(character) {
/**
* Check if the given character code, or the character code at the first
* character, is hexadecimal.
*
* @param {string|number} character
* @returns {boolean} Whether `character` is hexadecimal
*/
export function isHexadecimal(character) {
var code = typeof character === 'string' ? character.charCodeAt(0) : character

@@ -9,0 +10,0 @@

{
"name": "is-hexadecimal",
"version": "1.0.4",
"version": "2.0.0",
"description": "Check if a character is hexadecimal",

@@ -23,24 +23,29 @@ "license": "MIT",

],
"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.0.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 isHexadecimal -o is-hexadecimal.js",
"build-mangle": "browserify . -s isHexadecimal -p tinyify -o is-hexadecimal.min.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"
},

@@ -57,13 +62,7 @@ "prettier": {

"prettier": true,
"esnext": false,
"ignores": [
"is-hexadecimal.js"
]
"rules": {
"no-var": "off",
"prefer-arrow-callback": "off"
}
},
"nyc": {
"check-coverage": true,
"lines": 100,
"functions": 100,
"branches": 100
},
"remarkConfig": {

@@ -70,0 +69,0 @@ "plugins": [

@@ -12,2 +12,5 @@ # is-hexadecimal

This package is ESM only: Node 12+ is needed to use it and it must be `import`ed
instead of `require`d.
[npm][]:

@@ -22,8 +25,8 @@

```js
var hexadecimal = require('is-hexadecimal')
import {isHexadecimal} from 'is-hexadecimal'
hexadecimal('a') // => true
hexadecimal('0') // => true
hexadecimal('G') // => false
hexadecimal('💩') // => false
isHexadecimal('a') // => true
isHexadecimal('0') // => true
isHexadecimal('G') // => false
isHexadecimal('💩') // => false
```

@@ -33,6 +36,9 @@

### `hexadecimal(character|code)`
This package exports the following identifiers: `isHexadecimal`.
There is no default export.
### `isHexadecimal(character|code)`
Check whether the given character code (`number`), or the character code at the
first position (`string`), is hexadecimal.
first position (`string`), is isHexadecimal.

@@ -53,5 +59,5 @@ ## Related

[build-badge]: https://img.shields.io/travis/wooorm/is-hexadecimal.svg
[build-badge]: https://github.com/wooorm/is-hexadecimal/workflows/main/badge.svg
[build]: https://travis-ci.org/wooorm/is-hexadecimal
[build]: https://github.com/wooorm/is-hexadecimal/actions

@@ -58,0 +64,0 @@ [coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/is-hexadecimal.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