Skip to content

Commit

Permalink
fix(address: index out of range in some cases (#8)
Browse files Browse the repository at this point in the history
* feat: supports Romaji

* fix(address): index out of range in some cases

* chore(release): 0.4.1
  • Loading branch information
longgt authored Dec 26, 2024
1 parent f0eb604 commit 03e5210
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

#### 0.4.1 (2024-12-26)

##### Bug Fixes

* **address:** index out of range in some cases ([2cf74bf](https://github.com/longgt/node-gimei/commit/2cf74bf73f76eaefcac1abd9e8463b33159d2fb6))

#### 0.4.0 (2024-11-20)

##### Changes
Expand Down Expand Up @@ -40,4 +50,3 @@
##### Bug Fixes

* **name:** index out of range in some case ([f4b231c9](https://github.com/longgt/node-gimei/commit/f4b231c92f4f6c99ae50a78834dc8956914bc58e))

6 changes: 3 additions & 3 deletions lib/address.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ module.exports = {
this.prefectures = this.addresses['prefecture'];
this.cities = this.addresses['city'];
this.towns = this.addresses['town'];
this.prefectureIndex = Math.ceil(Math.random() * this.prefectures.length);
this.cityIndex = Math.ceil(Math.random() * this.cities.length);
this.townIndex = Math.ceil(Math.random() * this.towns.length);
this.prefectureIndex = Math.floor(Math.random() * this.prefectures.length);
this.cityIndex = Math.floor(Math.random() * this.cities.length);
this.townIndex = Math.floor(Math.random() * this.towns.length);
return this;
},

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@longgt-public/node-gimei",
"version": "0.4.0",
"version": "0.4.1",
"description": "random Japanese name and address generator. nodejs port of gimei",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 03e5210

Please sign in to comment.