Skip to content

Commit

Permalink
[fix, docs] add missing image data URI test file, add implemnted func…
Browse files Browse the repository at this point in the history
…tions and modules in readme
  • Loading branch information
aberba committed Jan 18, 2021
1 parent 6035fd8 commit af3ccd8
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 13 deletions.
65 changes: 53 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# Nyinaa

A collection of reusable functions & utilities (timers, validators, sanitizers, ranges, logging, ...)
A collection of reusable functions & utilities (timers, validators, sanitizers,
ranges, logging, ...)

### Installation
To install this package from the [Dub package repository](https://code.dlang.org), you may add `nyinaa` as dependency in your `dub.json` file and the package will be downloaded automatically during project build if it's not downloaded already.

To install this package from the
[Dub package repository](https://code.dlang.org), you may add `nyinaa` as
dependency in your `dub.json` file and the package will be downloaded
automatically during project build if it's not downloaded already.

```json
{
Expand All @@ -30,7 +35,7 @@ import core.thread.osthread : Thread;
void main()
{
// "tid" of type Tid can be referenced
// "tid" of type Tid can be referenced
// to stop setInterval()
auto tid = setInterval(1000.seconds, { writeln("tick"); });
auto tid2 = setInterval(3000.seconds, { writeln("tock"); });
Expand All @@ -45,21 +50,57 @@ void main()
// thread_joinAll();
}
```
## Collections
These are the categories of utilities currently being implemented

* Sanitizers - for sanitizing data, `stripTags()`, ...
* Validators - for user data (e.g. form data) validation, `isEmail`, `isIp`, `isIpv4`, `isIpv6`, ...
* Timers - time utility function, `setInterval()`, ...
---

## Implemented functions - Validators

* [x] `isEmail()`
* [x] `isUUID()`
Validators - for user data (e.g. form data)

- [x] `isEmail()`
- [x] `isIP()`
- [x] `isIPv4()`
- [x] `isIPv6()`
- [x] `isUUID()`
- [x] `isUUIDv3()`
- [x] `isUUIDv4()`
- [x] `isUUIDv5()`

## Implemented functions - Timers

Time-based utility functions

- [x] `setInterval()`
- [x] `stopInterval()`

## Implemented functions - Sanitizers

Sanitizing data

- [x] `stripTags()`

## Implemented functions - Image

Image related operation

- [x] `isImageDataURI()`
- [x] `bufferFromDataURI()`

## Implemented functions - Range

Handy functions for use in range related tasks

- [x] `concreteRange()`
- [x] `orElse()`
- [x] `then()`

---

### Documentation
See the [documentation](https://nyinaa.dpldocs.info/nyinaa.html) for the various functions and examples on how to use them.

See the [documentation](https://nyinaa.dpldocs.info/nyinaa.html) for the various
functions and examples on how to use them.

### To-do
Any generic validator form validation, etc. is welcomed

Any generic validator form validation, etc. is welcomed
1 change: 1 addition & 0 deletions data/data-url.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion source/nyinaa/image.d
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ unittest
{
import std : readText, writeln;

const text = readText("./snippets/data-uri.txt");
const text = readText("./data/data-uri.txt");

const result = bufferFromDataURI(text);

Expand Down

0 comments on commit af3ccd8

Please sign in to comment.