Skip to content

Commit

Permalink
feat: release more functions and improved documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tsevdos committed Oct 12, 2024
1 parent c0454b2 commit 3c7f8a1
Show file tree
Hide file tree
Showing 13 changed files with 533 additions and 410 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ elUtils is a **zero-dependency** modern package, written in TypeScript, strongly

Check all the [available functions here](#api) (by module category).

<!--
todo: runs on many JavaScript runtimes (such as node, deno and bun)
https://paka.dev/npm/@tsevdos/[email protected]/api
-->

## Installation

```shell
Expand All @@ -37,6 +32,10 @@ const { getAdministrativeRegions, getDays, ... } = require("@tsevdos/el-utils");
console.log(getAdministrativeRegions());
```

## Demo

Check **all the available functions** on this [**code sandbox**](https://codesandbox.io/p/sandbox/elutils-demo-r8sphg).

## API<a id='api'></a>

The library is currently split into the following modules:
Expand All @@ -49,12 +48,23 @@ The library is currently split into the following modules:
- [getAdministrativeUnits()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#getAdministrativeUnits)
- [getAdministrativeUnitById()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#getAdministrativeUnitById)
- [getMunicipalities()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#getMunicipalities)
- [getCities()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#getCities)
- [searchCityByName()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#searchCityByName)
- [getCityById()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#getCityById)
- [getCityAdministrativeDivision()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#getCityAdministrativeDivision)
- [getGeographicRegions()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#getGeographicRegions)
- [getGeographicRegionById()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#getGeographicRegionById)
- [getPrefectures()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#getPrefectures)
- [getPrefectureById()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#getPrefectureById)
- [getAllPostalCodes()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#getAllPostalCodes)
- [findByPostalCode()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#findByPostalCode)
- [getAllTaxOffices()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#getAllTaxOffices)
- [getTaxOfficeById()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#getTaxOfficeById)
- [getTaxOfficesByRegionId()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#getTaxOfficesByRegionId)
- [getTaxOfficesByUnitId()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#getTaxOfficesByUnitId)
- [getTaxOfficesByMunicipalityId()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#getTaxOfficesByMunicipalityId)
- [getTaxOfficesByPostalCode()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#getTaxOfficesByPostalCode)
- [searchTaxOffice()](https://github.com/tsevdos/elUtils/blob/main/docs/geoUtils.md#searchTaxOffice)

- [**`validationUtils`**](https://github.com/tsevdos/elUtils/blob/main/docs/validationUtils.md)

Expand Down Expand Up @@ -86,4 +96,4 @@ If you like the project but just don't have time to contribute, that's fine. The

## License

MIT© [John Tsevdos](http://tsevdos.me)
MIT© [John Tsevdos](https://tsevdos.me)
2 changes: 2 additions & 0 deletions docs/geoUtils.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ Each city has the below `schema`.
The functions dealing with the cities are listed below:

- [**getCities()**](#getCities)
- [**searchCityByName()**](#searchCityByName)
- [**getCityById()**](#getCityById)
- [**getCityAdministrativeDivision()**](#getCityAdministrativeDivision)

## [Geographic regions of Greece](https://en.wikipedia.org/wiki/Geographic_regions_of_Greece)<a id='geographic-regions'></a>

Expand Down
33 changes: 33 additions & 0 deletions docs/languageUtils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# LanguageUtils

The `LanguageUtils` module provides utility functions for handling Greek text. These functions help in normalizing Greek text by removing accents, spaces, and special characters, and converting the text to uppercase for comparison purposes.

## Table of Contents

- [convertsGreekTextToComparableUpperCase](#convertsgreektexttocomparableuppercase)
- [compareGreekStrings](#comparegreekstrings)

---

### convertsGreekTextToComparableUpperCase()<a id='convertsGreekTextToComparableUpperCase'></a>

**Description**: Removes accents, spaces, and special characters from the input string and converts it to uppercase (for easier comparison).

**Parameters:**

- **`input`** (`string`): The Greek text to be converted.

## **Return Type**: The normalized and uppercased string.

---

### compareGreekStrings()<a id='compareGreekStrings'></a>

**Description**: Compares two Greek strings by normalizing them (removing accents, spaces, and special characters) and converting them to uppercase.

**Parameters:**

- **`stringA`** (`string`): The first Greek string to compare.
- **`stringB`** (`string`): The second Greek string to compare.

## **Return Type**: `true` if the normalized strings are equal, `false` otherwise.
Loading

0 comments on commit 3c7f8a1

Please sign in to comment.