Comparing version 3.1.2 to 3.1.3
@@ -10,3 +10,7 @@ "use strict"; | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -13,0 +17,0 @@ if (k2 === undefined) k2 = k; |
{ | ||
"name": "cdigit", | ||
"version": "3.1.2", | ||
"version": "3.1.3", | ||
"description": "Collection of check digit algorithms implemented in JavaScript", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"exports": "./lib/index.js", | ||
"sideEffects": false, | ||
@@ -73,15 +74,12 @@ "bin": { | ||
"dependencies": { | ||
"commander": "^9.0.0" | ||
"commander": "^9.1.0" | ||
}, | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^5.10.2", | ||
"@typescript-eslint/parser": "^5.10.2", | ||
"eslint": "^8.8.0", | ||
"mocha": "^9.2.0", | ||
"prettier": "^2.5.1", | ||
"typescript": "^4.5.5" | ||
}, | ||
"prettier": { | ||
"embeddedLanguageFormatting": "off" | ||
"@typescript-eslint/eslint-plugin": "^5.17.0", | ||
"@typescript-eslint/parser": "^5.17.0", | ||
"eslint": "^8.12.0", | ||
"mocha": "^9.2.2", | ||
"prettier": "^2.6.2", | ||
"typescript": "^4.6.3" | ||
} | ||
} |
@@ -13,8 +13,8 @@ # cdigit: Check Digit Algorithms in JS | ||
```javascript | ||
const cdigit = require("cdigit"); | ||
const { luhn } = require("cdigit"); | ||
// Luhn (a.k.a. Mod 10) algorithm | ||
console.log(cdigit.luhn.compute("1234")); // "4" | ||
console.log(cdigit.luhn.generate("1234")); // "12344" | ||
console.log(cdigit.luhn.validate("12344")); // true | ||
console.log(luhn.compute("1234")); // "4" | ||
console.log(luhn.generate("1234")); // "12344" | ||
console.log(luhn.validate("12344")); // true | ||
``` | ||
@@ -91,8 +91,7 @@ | ||
Load `cdigit` and access to algorithm objects by cdigit._name_ listed in | ||
Load algorithm objects using the cdigit names listed in | ||
[Supported Algorithms section](#supported-algorithms). | ||
```javascript | ||
const cdigit = require("cdigit"); | ||
const algo = cdigit.mod97_10; | ||
const { mod97_10 } = require("cdigit"); | ||
``` | ||
@@ -108,3 +107,3 @@ | ||
```javascript | ||
console.log(cdigit.mod97_10.validate("123482")); // true | ||
console.log(mod97_10.validate("123482")); // true | ||
``` | ||
@@ -119,3 +118,3 @@ | ||
```javascript | ||
console.log(cdigit.mod97_10.generate("1234")); // "123482" | ||
console.log(mod97_10.generate("1234")); // "123482" | ||
``` | ||
@@ -129,3 +128,3 @@ | ||
```javascript | ||
console.log(cdigit.mod97_10.compute("1234")); // "82" | ||
console.log(mod97_10.compute("1234")); // "82" | ||
``` | ||
@@ -132,0 +131,0 @@ |
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
49572
994
164
Updatedcommander@^9.1.0