Comparing version 1.0.4 to 2.0.0
15
index.js
@@ -1,8 +0,9 @@ | ||
'use strict' | ||
module.exports = decimal | ||
// Check if the given character code, or the character code at the first | ||
// character, is decimal. | ||
function decimal(character) { | ||
/** | ||
* Check if the given character code, or the character code at the first | ||
* character, is decimal. | ||
* | ||
* @param {string|number} character | ||
* @returns {boolean} Whether `character` is a decimal | ||
*/ | ||
export function isDecimal(character) { | ||
var code = typeof character === 'string' ? character.charCodeAt(0) : character | ||
@@ -9,0 +10,0 @@ |
{ | ||
"name": "is-decimal", | ||
"version": "1.0.4", | ||
"version": "2.0.0", | ||
"description": "Check if a character is decimal", | ||
@@ -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 isDecimal -o is-decimal.js", | ||
"build-mangle": "browserify . -s isDecimal -p tinyify -o is-decimal.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-decimal.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-decimal | ||
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 decimal = require('is-decimal') | ||
import {isDecimal} from 'is-decimal' | ||
decimal('0') // => true | ||
decimal('9') // => true | ||
decimal('a') // => false | ||
decimal('💩') // => false | ||
isDecimal('0') // => true | ||
isDecimal('9') // => true | ||
isDecimal('a') // => false | ||
isDecimal('💩') // => false | ||
``` | ||
@@ -33,4 +36,7 @@ | ||
### `decimal(character|code)` | ||
This package exports the following identifiers: `isDecimal`. | ||
There is no default export. | ||
### `isDecimal(character|code)` | ||
Check whether the given character code (`number`), or the character code at the | ||
@@ -52,5 +58,5 @@ first position (`string`), is decimal. | ||
[build-badge]: https://img.shields.io/travis/wooorm/is-decimal.svg | ||
[build-badge]: https://github.com/wooorm/is-decimal/workflows/main/badge.svg | ||
[build]: https://travis-ci.org/wooorm/is-decimal | ||
[build]: https://github.com/wooorm/is-decimal/actions | ||
@@ -57,0 +63,0 @@ [coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/is-decimal.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
5244
5
19
76
0
Yes
9