validate-polish
Advanced tools
Comparing version 1.0.9 to 1.1.0
{ | ||
"name": "validate-polish", | ||
"version": "1.0.9", | ||
"description": "Validation of PESEL, NIP, REGON, identity card etc.", | ||
"main": "index.js", | ||
"typings": "index.d.ts", | ||
"version": "1.1.0", | ||
"description": "Utility library for validation of PESEL, NIP, REGON, identity card etc. Aimed at mostly at Polish enviroment. [Polish] Walidacja numerów pesel, nip, regon, dowodu osobistego.", | ||
"main": "build/main/index.js", | ||
"typings": "build/main/index.d.ts", | ||
"module": "build/module/index.js", | ||
"repository": "https://github.com/radarsu/validate-polish", | ||
"license": "MIT", | ||
"keywords": [], | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"build:main": "tsc -p tsconfig.json", | ||
"build:module": "tsc -p tsconfig.module.json", | ||
"build": "run-s clean && run-p build:*", | ||
"clean": "trash build test", | ||
"cov:check": "nyc report && nyc check-coverage --lines 100 --functions 100 --branches 100", | ||
"cov:html": "nyc report --reporter=html", | ||
"cov:send": "nyc report --reporter=lcov > coverage.lcov && codecov", | ||
"cov": "run-s build test:unit cov:html && opn coverage/index.html", | ||
"doc:html": "typedoc src/ --target ES6 --mode file --out build/docs", | ||
"doc:json": "typedoc src/ --target ES6 --mode file --json build/docs/typedoc.json", | ||
"doc:publish": "gh-pages -m \"[ci skip] Updates\" -d build/docs", | ||
"doc": "run-s doc:html && opn build/docs/index.html", | ||
"fix:prettier": "prettier \"src/**/*.ts\" --write", | ||
"fix:tslint": "tslint --fix --project .", | ||
"fix": "run-s fix:*", | ||
"info": "npm-scripts-info", | ||
"reset": "git clean -dfx && git reset --hard && npm i", | ||
"test:lint": "tslint --project . && prettier \"src/**/*.ts\" --list-different", | ||
"test:unit": "nyc --silent ava", | ||
"test": "run-s build test:*", | ||
"version": "standard-version", | ||
"watch": "run-s clean build:main && run-p \"build:main -- -w\" \"test:unit -- --watch\"", | ||
"all": "run-s reset test cov:check doc:html", | ||
"prepare-release": "run-s all version doc:publish" | ||
}, | ||
"author": "Rkroh Morath <rkrohmorath@gmail.com> (http://r0ten.com/)", | ||
"license": "ISC", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/radarsu/validate-polish" | ||
"scripts-info": { | ||
"info": "Display information about the package scripts", | ||
"build": "Clean and rebuild the project", | ||
"fix": "Try to automatically fix any linting problems", | ||
"test": "Lint and unit test the project", | ||
"watch": "Watch and rebuild the project on save, then rerun relevant tests", | ||
"cov": "Rebuild, run tests, then create and open the coverage report", | ||
"doc": "Generate HTML API documentation and open it in a browser", | ||
"doc:json": "Generate API documentation in typedoc JSON format", | ||
"version": "Bump package.json version, update CHANGELOG.md, tag release", | ||
"reset": "Delete all untracked files and reset the repo to the last commit", | ||
"prepare-release": "One-step: clean, build, test, publish docs, and prep a release" | ||
}, | ||
"engines": { | ||
"node": ">=8.9" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@types/inquirer": "0.0.43", | ||
"@types/uuid": "^3.4.4", | ||
"ava": "1.0.0-beta.7", | ||
"codecov": "^3.1.0", | ||
"cz-conventional-changelog": "^2.1.0", | ||
"gh-pages": "^2.0.0", | ||
"npm-run-all": "^4.1.3", | ||
"nyc": "^13.0.1", | ||
"opn-cli": "^3.1.0", | ||
"prettier": "^1.14.3", | ||
"standard-version": "^4.4.0", | ||
"trash-cli": "^1.4.0", | ||
"tslint": "^5.11.0", | ||
"tslint-config-prettier": "^1.15.0", | ||
"tslint-immutable": "^4.7.0", | ||
"typedoc": "^0.13.0", | ||
"typescript": "^3.0.3" | ||
}, | ||
"ava": { | ||
"failFast": true, | ||
"files": [ | ||
"build/main/**/*.spec.js" | ||
], | ||
"sources": [ | ||
"build/main/**/*.js" | ||
] | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "cz-conventional-changelog" | ||
} | ||
}, | ||
"prettier": { | ||
"singleQuote": true | ||
}, | ||
"nyc": { | ||
"exclude": [ | ||
"**/*.spec.js" | ||
] | ||
} | ||
} |
@@ -1,28 +0,54 @@ | ||
# validate-polish | ||
Validation of pesel, nip, regon, identity card etc. | ||
<p align="center"> | ||
<a href="https://github.com/radarsu/validate-polish/" target="blank"><img src="https://raw.githubusercontent.com/radarsu/validate-polish/master/assets/logo.png" alt="validate-polish" /></a><br/> | ||
<strong>Simple validation of PESEL, NIP, REGON, identity card.</strong> | ||
</p> | ||
npm install -g validate-polish | ||
<p align="center"> | ||
<a href="https://github.com/Microsoft/TypeScript" target="blank">TypeScript</a> utility for Polish developers.<br/> | ||
</p> | ||
````` | ||
import validatePolish = require('validate-polish'); | ||
<p align="center"> | ||
<a href="https://www.npmjs.com/package/validate-polish" target="_blank" alt="npm validate-polish"><img src="https://img.shields.io/npm/v/validate-polish.svg" alt="npm" /></a> | ||
<img src="https://img.shields.io/github/license/radarsu/validate-polish.svg" /> | ||
<img src="https://img.shields.io/github/stars/radarsu/validate-polish.svg" /> | ||
<a href="https://twitter.com/radarsujs"><img src="https://img.shields.io/twitter/url/https/github.com/radarsu/validate-polish.svg?style=social" /></a> | ||
</p> | ||
let pesel = "92060512181"; | ||
if (!validatePolish.pesel(pesel)) { | ||
throw new Error("Invalid pesel."); | ||
## Description | ||
Utility library for validation of PESEL, NIP, REGON, identity card etc. Aimed at mostly at Polish enviroment. [Polish] Walidacja numerów pesel, nip, regon, dowodu osobistego. | ||
## Installation | ||
```sh | ||
npm i validate-polish | ||
``` | ||
## Features | ||
- <strong>Fast, lightweight, no dependencies</strong> required. | ||
- <strong>PESEL</strong> validation. | ||
- <strong>NIP</strong> validation. | ||
- <strong>REGON</strong> validation. | ||
- <strong>Identity card</strong> ([Polish] <strong>dowód osobisty</strong>) validation. | ||
## Usage | ||
```ts | ||
import validatePolish from 'validate-polish'; | ||
if (!validatePolish.pesel(`92060512181`)) { | ||
throw new Error(`Invalid pesel.`); | ||
} | ||
let nip = "115667734"; | ||
if (!validatePolish.nip(nip)) { | ||
throw new Error("Invalid nip."); | ||
if (!validatePolish.nip('115667734')) { | ||
throw new Error(`Invalid nip.`); | ||
} | ||
let regon = "1251677"; | ||
if (!validatePolish.regon(regon)) { | ||
throw new Error("Invalid regon."); | ||
if (!validatePolish.regon(`1251677`)) { | ||
throw new Error('Invalid regon.'); | ||
} | ||
let identityCard = "ATG3123151"; | ||
if (!validatePolish.identityCard(identityCard)) { | ||
throw new Error("Invalid nip."); | ||
throw new Error(`Invalid nip.`); | ||
} | ||
````` | ||
``` |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
35607
12
365
1
55
17
2
1
1