Skip to content

Commit

Permalink
Merge pull request #3 from 0xlarmideh/addSamples
Browse files Browse the repository at this point in the history
Added samples for remaining functions in readme
  • Loading branch information
florianchrometz committed Oct 23, 2023
2 parents 4f3e2fa + e5fc476 commit 1add75c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,31 @@ const cityForNumber = germanMetadata.getCityByPhoneNumber('069472111');
// output will be a city object for Munich
const cityForPrefix = germanMetadata.getCityByPhonePrefix(89);

//get phone prefix by city name, city name must be a string
// output will be a number
const phonePrefixByCity = germanMetadata.getPhonePrefixByCityName('Frankfurt am Main');

// get the specific number only prefix for a non cleaned phone number
// output will be 69 as number
const prefixForPhoneNumber = germanMetadata.getPrefixOfPhoneNumber('069472111');

// validate if a city name is valid
// output will be true
const isValidCityName = germanMetadata.doesCityExistWithName('Frankfurt am Main');

// normalize city names,
// output will be a normalized city name string
const validCityName = germanMetadata.normalizeCityName('Frankfurt am Main');


// normalize phone number,
// output will be a normalized phone number as string
const validPhoneNumber = germanMetadata.normalizePhoneNumber('069472111')


//This gives access to the original cities data being used
const cities = germanMetadata.cities

```

# Functions
Expand Down

0 comments on commit 1add75c

Please sign in to comment.