Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
41 changes: 22 additions & 19 deletions @coven/compare/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<img alt="Coven Engineering Compare logo" src="https://raw.githubusercontent.com/covenengineering/libraries/main/@coven/compare/logo.svg" height="108" />
![Coven Engineering Compare](./logo.svg)

[![JSR](https://jsr.io/badges/@coven/compare)](https://coven.to/compare)
[![JSR Score](https://jsr.io/badges/@coven/compare/score)](https://coven.to/compare/score)
[![Coverage Status](https://img.shields.io/codecov/c/github/covenengineering/libraries?color=%23083344&component=coven__compare&label=Codecov&labelColor=%23F01F7A&logo=Codecov&logoColor=%23fff)](https://app.codecov.io/github/covenengineering/libraries?components[0]=Coven%20Engineering%20Compare)

⚖️ Minimalist diffing.

Expand All @@ -10,11 +11,23 @@ first and then a `right` or "new" value, finally returning an iterator with all
the differences between said values. The yielded differences are represented by
3 kinds:

- **Create:** Missing `left` and existing `right`.
- **Update:** Different `left` and `right` values.
- **Delete:** Existing `left` and missing `right`.
- **Create:** When `left` value is missing but we have a new `right` value.
- **Update:** When `left` and `right` values are different.
- **Delete:** When `left` value exists and `right` value is missing.

## Plain update
Like all [Coven Engineering](https://coven.engineering) libraries, it has 100%
test coverage and it's built in top of modern tech compatible with all
JavaScript runtimes.

## Examples

> [!NOTE]
>
> In all examples the `path` property is represented as an array, but `path` is
> an `IterableIterator` like the output of `compare` is. The included `flat`
> function can be used to flatten all `IterableIterator`s to arrays.

### Plain update

If we compare the string 2 different strings, we do it like this:

Expand All @@ -35,7 +48,7 @@ And we only get a single yielded "update", that looks like this:
});
```

## Object update
### Object update

If we compare two objects like this:

Expand All @@ -56,7 +69,7 @@ The yielded update will have values yielded from its `path`:
});
```

## Object delete
### Object delete

Let's say we update that same object to an empty one:

Expand All @@ -76,7 +89,7 @@ Yields this:
});
```

## Object create
### Object create

Let's say we update that same object from an empty one:

Expand All @@ -96,7 +109,7 @@ Yields this:
});
```

## Multiple differences
### Multiple differences

Now let's see what's yielded if we compare two objects with the 3 type of
differences:
Expand All @@ -121,16 +134,6 @@ That yields all 3 kind of differences:
({ kind: "CREATE", right: "new", path: ["created"] });
```

> [!NOTE]
>
> In all examples the `path` property is represented as an array, but `path` is
> an `IterableIterator` like the output of `compare` is. The included `flat`
> function can be used to flatten all `IterableIterator`s to arrays.

Like all [Coven Engineering](https://coven.engineering) libraries, it has 100%
test coverage and it's built in top of modern tech compatible with all
JavaScript runtimes.

## Other links

- [Coverage](https://app.codecov.io/github/covenengineering/libraries).
2 changes: 1 addition & 1 deletion @coven/compare/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json",
"exports": "./mod.ts",
"name": "@coven/compare",
"version": "0.9.1"
"version": "0.9.2"
}
2 changes: 1 addition & 1 deletion @coven/compare/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions @coven/constants/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<img alt="Coven Engineering Constants logo" src="https://raw.githubusercontent.com/covenengineering/libraries/main/@coven/constants/logo.svg" height="108" />
![Coven Engineering Constants](./logo.svg)

[![JSR](https://jsr.io/badges/@coven/constants)](https://coven.to/constants)
[![JSR Score](https://jsr.io/badges/@coven/constants/score)](https://coven.to/constants/score)
[![Coverage Status](https://img.shields.io/codecov/c/github/covenengineering/libraries?color=%23083344&component=coven__constants&label=Codecov&labelColor=%23F01F7A&logo=Codecov&logoColor=%23fff)](https://app.codecov.io/github/covenengineering/libraries?components[0]=Coven%20Engineering%20Constants)

🧱 Common constants.

Is pretty common to start folding/reducing with an empty object or array. This
library simply contains those common values as immutable structures to avoid
accidental mutations.
This library provides constants commonly used for initial and default values as
immutable structures to avoid accidental mutations.

Like all [Coven Engineering](https://coven.engineering) libraries, it has 100%
test coverage and it's built in top of modern tech compatible with all
JavaScript runtimes. The tests for this library only make sure trying to do
mutations throws.

## Constants
## Exported constants

- `EMPTY_ARRAY`: Empty read-only array.
- `EMPTY_OBJECT`: Empty read-only `null` prototype object.
- `SIGIL`: Internal value to be used as bottom value (like `null` and
`undefined`) when native bottom values have to be used.
`undefined`) when native bottom values have to be used for something else.

## Example

Expand Down
2 changes: 1 addition & 1 deletion @coven/constants/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json",
"exports": "./mod.ts",
"name": "@coven/constants",
"version": "0.9.1"
"version": "0.9.2"
}
2 changes: 1 addition & 1 deletion @coven/constants/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions @coven/cron/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<img alt="Coven Engineering Cron logo" src="https://raw.githubusercontent.com/covenengineering/libraries/main/@coven/cron/logo.svg" height="108" />
![Coven Engineering Cron](./logo.svg)

[![JSR](https://jsr.io/badges/@coven/cron)](https://coven.to/cron)
[![JSR Score](https://jsr.io/badges/@coven/cron/score)](https://coven.to/cron/score)
[![Coverage Status](https://img.shields.io/codecov/c/github/covenengineering/libraries?color=%23083344&component=coven__cron&label=Codecov&labelColor=%23F01F7A&logo=Codecov&logoColor=%23fff)](https://app.codecov.io/github/covenengineering/libraries?components[0]=Coven%20Engineering%20Cron)

⏳ Fantastic cron parser and constructor.

Expand All @@ -22,7 +23,9 @@ JavaScript runtimes.
Only known limitation is it only accepts valid standard unix cron expressions,
so cron quartz is not supported.

## Parsing
## Examples

### Parsing

To parse we use the `parse` util:

Expand All @@ -44,7 +47,7 @@ Which returns:
});
```

## Stringifying
### Stringifying

To stringify we use the `stringify` util:

Expand Down Expand Up @@ -88,7 +91,7 @@ import { parse } from "@coven/cron";
parse("* * 31 2 *"); // undefined because 31 of February is invalid
```

## Getting the next matching date
### Getting the next matching date

We can get the next matching date for a cron expression like this:

Expand Down
2 changes: 1 addition & 1 deletion @coven/cron/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json",
"exports": "./mod.ts",
"name": "@coven/cron",
"version": "0.9.1"
"version": "0.9.2"
}
2 changes: 1 addition & 1 deletion @coven/cron/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion @coven/expression/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<img alt="Coven Engineering Expression logo" src="https://raw.githubusercontent.com/covenengineering/libraries/main/@coven/expression/logo.svg" height="108" />
![Coven Engineering Expression](./logo.svg)

[![JSR](https://jsr.io/badges/@coven/expression)](https://coven.to/expression)
[![JSR Score](https://jsr.io/badges/@coven/expression/score)](https://coven.to/expression/score)
[![Coverage Status](https://img.shields.io/codecov/c/github/covenengineering/libraries?color=%23083344&component=coven__expression&label=Codecov&labelColor=%23F01F7A&logo=Codecov&logoColor=%23fff)](https://app.codecov.io/github/covenengineering/libraries?components[0]=Coven%20Engineering%20Expression)

🧙‍♀️ Magical regular expressions composer.

Expand Down
2 changes: 1 addition & 1 deletion @coven/expression/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json",
"exports": "./mod.ts",
"name": "@coven/expression",
"version": "0.9.1"
"version": "0.9.2"
}
2 changes: 1 addition & 1 deletion @coven/expression/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 11 additions & 26 deletions @coven/iterables/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
../<img alt="Coven Engineering Iterables logo" src="https://raw.githubusercontent.com/covenengineering/libraries/main/@coven/iterables/logo.svg" height="108" />
![Coven Engineering Iterables](./logo.svg)

[![JSR](https://jsr.io/badges/@coven/iterables)](https://coven.to/iterables)
[![JSR Score](https://jsr.io/badges/@coven/iterables/score)](https://coven.to/iterables/score)
[![Coverage Status](https://img.shields.io/codecov/c/github/covenengineering/libraries?color=%23083344&component=coven__iterables&label=Codecov&labelColor=%23F01F7A&logo=Codecov&logoColor=%23fff)](https://app.codecov.io/github/covenengineering/libraries?components[0]=Coven%20Engineering%20Iterables)

♻️ `Iterable` and `AsyncIterable` utilities. iterables, which results in
duplicated code.

`@coven/iterables` provides 2 modules, the default for synchronous iterables and
then `@coven/iterables/async` for asynchronous iterables. All functions are
curried to reduce code duplication, and they work with all iterables (generator
functions, arrays, strings, Sets, Maps, etc.). // With iterables functions
functions, arrays, strings, Sets, Maps, etc.).

import { forEach, map } from "@coven/iterables";

// [1, 2, 3, 4] |> map(double) |> map(next) |> forEach(console.log);

````typescript
import { map } from "@coven/iterables";

const double = (multiplier: number) => multiplier * 2;.ts

One of the places curried functions shine the most is with iterables. More often
than not, mapping, filtering and so on is applied to multiple different
Like all [Coven Engineering](https://coven.engineering) libraries, it has 100%
test coverage and it's built in top of modern tech compatible with all
JavaScript runtimes.

## Examples

One of the key differences between this library and other similar collection
handling libraries like say lodash, is the heavy use of iterators. At first
Expand All @@ -47,27 +41,18 @@ const next = (value: number) => value + 1;
// 5. Logs 7
// 6. Logs 9

// With iterables functions

import { forEach, map } from "@coven/iterables";

// [1, 2, 3, 4] |> map(double) |> map(next) |> forEach(console.log);
forEach(console.log)(map(next)(map(double)([1, 2, 3, 4])));
// 1. 2 → 3 → Logs 3
// 2. 4 → 5 → Logs 5
// 3. 6 → 7 → Logs 7
// 4. 8 → 9 → Logs 9
````

Like all [Coven Engineering](https://coven.engineering) libraries, it has 100%
test coverage and it's built in top of modern tech compatible with all
JavaScript runtimes.

## Example

const doubles = map(double);

doubles([13, 42]); // Yields [26, 84]

```

## Other links

- [Coverage](https://app.codecov.io/github/covenengineering/libraries).
```
2 changes: 1 addition & 1 deletion @coven/iterables/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"./async": "./async/mod.ts"
},
"name": "@coven/iterables",
"version": "0.9.1"
"version": "0.9.2"
}
2 changes: 1 addition & 1 deletion @coven/iterables/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading