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

singapore-nric

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

singapore-nric - npm Package Compare versions

Comparing version 1.2.1 to 2.0.0

dist/nric.d.ts

2

.vscode/settings.json

@@ -9,5 +9,5 @@ {

"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.eslint": "explicit"
},
"jest.jestCommandLine": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
}
{
"name": "singapore-nric",
"version": "1.2.1",
"version": "2.0.0",
"description": "Generate & Validate Singapore NRIC (National Registration Identity Card) Numbers",

@@ -9,6 +9,14 @@ "author": {

},
"contributors": [
{
"name": "Goh Sheen An",
"url": "https://github.com/sheen4n"
}
],
"license": "MIT",
"type": "module",
"main": "src/nric.js",
"main": "dist/nric.js",
"types": "dist/nric.d.ts",
"scripts": {
"build": "tsc",
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"

@@ -49,8 +57,12 @@ },

],
"transform": {}
"transform": {},
"preset": "ts-jest"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"eslint": "^8.9.0",
"jest": "^27.5.1"
"jest": "^29.1.2",
"ts-jest": "^29.1.2",
"typescript": "^5.4.2"
}
}

@@ -8,3 +8,3 @@ # singapore-nric

Looking to do it manually instead? Use these tools on my website: [generate](https://samliew.com/nric-generator) or [validate](https://samliew.com/singapore-nric-validator).
You can also use these pages on my website to [generate](https://samliew.com/nric-generator) or [validate](https://samliew.com/singapore-nric-validator) manually.

@@ -16,3 +16,3 @@ <br>

```
npm -i singapore-nric
npm install singapore-nric
```

@@ -30,10 +30,10 @@

| Property | Type | Description |
| ----------------- | --------- | --------------------------------- |
| `value` | string | entire value of NRIC |
| `firstchar` | string | first character |
| `identifier` | string | last four alphanumeric characters |
| `checksum` | string | checksum (last character) |
| `isCorrectFormat` | boolean | format is valid |
| `isValid` | boolean | checksum is valid |
| Property | Type | Description |
| ----------------- | ------- | --------------------------------- |
| `value` | string | entire value of NRIC |
| `firstchar` | string | first character |
| `identifier` | string | last four alphanumeric characters |
| `checksum` | string | checksum (last character) |
| `isCorrectFormat` | boolean | format is valid |
| `isValid` | boolean | checksum is valid |

@@ -54,2 +54,3 @@ ### Examples

### `Validate( nric )`
Validate a single NRIC, or an array of NRIC strings

@@ -66,2 +67,3 @@

### `Generate( firstchar? )`
Returns a random NRIC with valid checksum

@@ -77,4 +79,4 @@

### `GenerateMany( amount )`
### `GenerateMany( amount )`
Generate an array of NRICs with valid checksum

@@ -81,0 +83,0 @@

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