Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

develop #24

Merged
merged 19 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
0218bb0
chore(deps): update dependency @types/jest to v29.5.11 (#10)
renovate[bot] Dec 6, 2023
8b3144b
chore(deps): update dependency typescript to v5.3.3 (#11)
renovate[bot] Dec 6, 2023
f0a516e
chore(deps): update dependency @types/node to v20.10.4 (#12)
renovate[bot] Dec 7, 2023
a6dba1a
chore(deps): update dependency rollup to v4.7.0 (#13)
renovate[bot] Dec 8, 2023
47898a6
chore(deps): update dependency prettier to v3.1.1 (#14)
renovate[bot] Dec 10, 2023
30a9251
chore(deps): update dependency rollup to v4.8.0 (#15)
renovate[bot] Dec 11, 2023
be18351
chore(deps): update dependency rollup to v4.9.0 (#16)
renovate[bot] Dec 13, 2023
b89701f
chore(deps): update dependency rollup to v4.9.1 (#17)
renovate[bot] Dec 17, 2023
c483cb6
fix(deps): update dependency libphonenumber-js to v1.10.52 (#18)
renovate[bot] Dec 17, 2023
c82c584
chore(deps): update dependency @types/node to v20.10.5 (#19)
renovate[bot] Dec 18, 2023
3bae18e
fix(deps): update dependency libphonenumber-js to v1.10.53 (#20)
renovate[bot] Dec 27, 2023
5b79525
chore(deps): update dependency @types/node to v20.10.6 (#21)
renovate[bot] Dec 30, 2023
86e94ec
chore(deps): update dependency rollup to v4.9.2 (#22)
renovate[bot] Dec 30, 2023
c643bc9
chore: update pkgs
meabed Jan 3, 2024
366ea6b
Merge branch 'master' of github.com:devmehq/libphonenumber-js into de…
meabed Jan 3, 2024
84e2678
chore: update pkgs
meabed Jan 3, 2024
cc2ea37
chore: update pkgs
meabed Jan 3, 2024
79e8ba0
chore: update pkgs
meabed Jan 3, 2024
27620c1
chore: update pkgs
meabed Jan 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 6 additions & 24 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
The MIT License (MIT)
Business Source License 1.1
=====================

Copyright © `2021` `DEV.ME`

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Business Source License 1.1 https://mariadb.com/bsl11/
Licensor: DEV.ME, Ltd.
Licensed Work: Phone Number Validator
Additional Use Grant: None
Copyright 2015-present DEV.ME, Ltd.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

✅ Check phone number carrier name

✅ Check phone number geo location (city)
✅ Check phone number geolocation (city)

✅ Check phone number timezone

Expand All @@ -43,6 +43,22 @@
## API / Cloud Hosted Service
We offer this `phone verification and validation and more advanced features` in our Scalable Cloud API Service Offering - You could try it here [Phone Number Verification](https://dev.me/products/phone)


## License

phone-number-validator-js licensed under [Business Source License 1.1](LICENSE).
The BSL allows use only for non-production purposes.

| Use Case | Is a commercial license required?|
|----------|-----------|
| Exploring phone-number-validator-js for your own research, hobbies, and testing purposes | **No** |
| Using phone-number-validator-js to build a proof-of-concept application | **No** |
| Using phone-number-validator-js to build revenue-generating applications | **Yes** |
| Using phone-number-validator-js to build software that is provided as a service (SaaS) | **Yes** |
| Forking phone-number-validator-js for any production purposes | **Yes** |

To purchase a license for uses not authorized by BSL, please contact us at [[email protected]](mailto:[email protected]?subject=Interested%20in%20phone-number-validator-js%20commercial%20license).

## Self-hosting - installation and usage instructions

## Installation
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ const codeData: Record<string, Document> = {}
*/
function getCode(dataPath: string, nationalNumber: string) {
try {
//
if (!codeData[dataPath]) {
const bData = readFileSync(dataPath)
codeData[dataPath] = deserialize(bData)
}
//
const data = codeData[dataPath]
let prefix = nationalNumber
// Find the longest match
Expand Down