Skip to content

Commit

Permalink
imp: Release v1.5.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Byloth committed Jul 11, 2024
1 parent 4835a35 commit 00c1be9
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 31 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@byloth/core",
"version": "1.5.0-rc.8",
"version": "1.5.0",
"description": "An unopinionated collection of useful functions and classes that I use widely in all my projects. 🔧",
"keywords": [
"Core",
Expand Down
33 changes: 24 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const VERSION = "1.5.0-rc.7";
export const VERSION = "1.5.0";

export type { Constructor, Interval, Timeout } from "./core/types.js";

Expand All @@ -12,7 +12,11 @@ export {
FatalErrorException,
FileNotFoundException,
JsonStorage,
NotImplementedException,
NetworkException,
PermissionException,
ReducedIterator,
ReferenceException,
RuntimeException,
SmartIterator,
SmartAsyncIterator,
Expand All @@ -26,32 +30,43 @@ export {
} from "./models/index.js";

export type {
GeneratorFunction,
AsyncGeneratorFunction,
AsyncIterLike,
FulfilledHandler,
GeneratorFunction,
Iteratee,
IterLike,
KeyIteratee,
KeyReducer,
KeyTypeGuardIteratee,
MaybeAsyncKeyIteratee,
MaybeAsyncKeyReducer,
MaybeAsyncKeyTypeGuardIteratee,
MaybeAsyncReducer,
MaybeAsyncIteratee,
TypeGuardIteratee,
MaybeAsyncIterLike,
MaybeAsyncTypeGuardIteratee,
Reducer,
MaybeAsyncReducer,
MaybePromise,
FulfilledHandler,
RejectedHandler,
PromiseResolver,
PromiseExecutor,
PromiseRejecter,
PromiseExecutor
PromiseResolver,
Reducer,
RejectedHandler,
TypeGuardIteratee

} from "./models/types.js";

export {
average,
capitalize,
chain,
count,
delay,
dateDifference,
dateRange,
dateRound,
DateUnit,
enumerate,
hash,
loadScript,
nextAnimationFrame,
Expand Down
6 changes: 3 additions & 3 deletions src/models/aggregators/aggregated-async-iterator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SmartAsyncIterator } from "../iterators/index.js";
import type { AsyncGeneratorFunction, GeneratorFunction, MaybeAsyncIterables } from "../iterators/types.js";
import type { AsyncGeneratorFunction, GeneratorFunction, MaybeAsyncIterLike } from "../iterators/types.js";
import type { MaybePromise } from "../types.js";

import ReducedIterator from "./reduced-iterator.js";
Expand All @@ -15,8 +15,8 @@ export default class AggregatedAsyncIterator<K extends PropertyKey, T>
public constructor(iterator: AsyncIterator<[K, T]>);
public constructor(generatorFn: GeneratorFunction<[K, T]>);
public constructor(generatorFn: AsyncGeneratorFunction<[K, T]>);
public constructor(argument: MaybeAsyncIterables<[K, T]>);
public constructor(argument: MaybeAsyncIterables<[K, T]>)
public constructor(argument: MaybeAsyncIterLike<[K, T]>);
public constructor(argument: MaybeAsyncIterLike<[K, T]>)
{
this._elements = new SmartAsyncIterator(argument);
}
Expand Down
6 changes: 3 additions & 3 deletions src/models/aggregators/aggregator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import AggregatedIterator from "./aggregated-iterator.js";

import { SmartIterator } from "../iterators/index.js";
import type { GeneratorFunction, Iteratee, Iterables, TypeGuardIteratee } from "../iterators/types.js";
import type { GeneratorFunction, Iteratee, IterLike, TypeGuardIteratee } from "../iterators/types.js";

export default class Aggregator<T>
{
Expand All @@ -10,8 +10,8 @@ export default class Aggregator<T>
public constructor(iterable: Iterable<T>);
public constructor(iterator: Iterator<T>);
public constructor(generatorFn: GeneratorFunction<T>);
public constructor(argument: Iterables<T>);
public constructor(argument: Iterables<T>)
public constructor(argument: IterLike<T>);
public constructor(argument: IterLike<T>)
{
this._elements = new SmartIterator(argument);
}
Expand Down
6 changes: 3 additions & 3 deletions src/models/aggregators/async-aggregator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SmartAsyncIterator } from "../iterators/index.js";
import type {
AsyncGeneratorFunction,
GeneratorFunction,
MaybeAsyncIterables,
MaybeAsyncIterLike,
MaybeAsyncIteratee,
MaybeAsyncTypeGuardIteratee

Expand All @@ -20,8 +20,8 @@ export default class AsyncAggregator<T>
public constructor(iterator: AsyncIterator<T>);
public constructor(generatorFn: GeneratorFunction<T>);
public constructor(generatorFn: AsyncGeneratorFunction<T>);
public constructor(argument: MaybeAsyncIterables<T>);
public constructor(argument: MaybeAsyncIterables<T>)
public constructor(argument: MaybeAsyncIterLike<T>);
public constructor(argument: MaybeAsyncIterLike<T>)
{
this._elements = new SmartAsyncIterator(argument);
}
Expand Down
6 changes: 3 additions & 3 deletions src/models/iterators/smart-async-iterator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
GeneratorFunction,
MaybeAsyncIteratee,
MaybeAsyncReducer,
MaybeAsyncIterables,
MaybeAsyncIterLike,
MaybeAsyncTypeGuardIteratee

} from "./types.js";
Expand All @@ -21,8 +21,8 @@ export default class SmartAsyncIterator<T, R = void, N = undefined> implements A
public constructor(iterator: AsyncIterator<T, R, N>);
public constructor(generatorFn: GeneratorFunction<T, R, N>);
public constructor(generatorFn: AsyncGeneratorFunction<T, R, N>);
public constructor(argument: MaybeAsyncIterables<T, R, N>);
public constructor(argument: MaybeAsyncIterables<T, R, N>)
public constructor(argument: MaybeAsyncIterLike<T, R, N>);
public constructor(argument: MaybeAsyncIterLike<T, R, N>)
{
if (argument instanceof Function)
{
Expand Down
6 changes: 3 additions & 3 deletions src/models/iterators/smart-iterator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { GeneratorFunction, Iteratee, TypeGuardIteratee, Reducer, Iterables } from "./types.js";
import type { GeneratorFunction, Iteratee, TypeGuardIteratee, Reducer, IterLike } from "./types.js";

export default class SmartIterator<T, R = void, N = undefined> implements Iterator<T, R, N>
{
Expand All @@ -10,8 +10,8 @@ export default class SmartIterator<T, R = void, N = undefined> implements Iterat
public constructor(iterable: Iterable<T>);
public constructor(iterator: Iterator<T, R, N>);
public constructor(generatorFn: GeneratorFunction<T, R, N>);
public constructor(argument: Iterables<T, R, N>);
public constructor(argument: Iterables<T, R, N>)
public constructor(argument: IterLike<T, R, N>);
public constructor(argument: IterLike<T, R, N>)
{
if (argument instanceof Function)
{
Expand Down
6 changes: 3 additions & 3 deletions src/models/iterators/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export type MaybeAsyncTypeGuardIteratee<T, R extends T> = (value: MaybePromise<T
export type Reducer<T, A> = (accumulator: A, value: T, index: number) => A;
export type MaybeAsyncReducer<T, A> = (accumulator: A, value: T, index: number) => MaybePromise<A>;

export type Iterables<T, R = void, N = undefined> = Iterable<T> | Iterator<T, R, N> | GeneratorFunction<T, R, N>;
export type AsyncIterables<T, R = void, N = undefined> =
export type IterLike<T, R = void, N = undefined> = Iterable<T> | Iterator<T, R, N> | GeneratorFunction<T, R, N>;
export type AsyncIterLike<T, R = void, N = undefined> =
AsyncIterable<T> | AsyncIterator<T, R, N> | AsyncGeneratorFunction<T, R, N>;

export type MaybeAsyncIterables<T, R = void, N = undefined> = Iterables<T, R, N> | AsyncIterables<T, R, N>;
export type MaybeAsyncIterLike<T, R = void, N = undefined> = IterLike<T, R, N> | AsyncIterLike<T, R, N>;
16 changes: 14 additions & 2 deletions src/models/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
export type { KeyIteratee, KeyReducer, KeyTypeGuardIteratee } from "./aggregators/types.js";
export type {
KeyIteratee,
MaybeAsyncKeyIteratee,
KeyTypeGuardIteratee,
MaybeAsyncKeyTypeGuardIteratee,
KeyReducer,
MaybeAsyncKeyReducer

} from "./aggregators/types.js";

export type {
GeneratorFunction,
AsyncGeneratorFunction,
Expand All @@ -7,7 +16,10 @@ export type {
TypeGuardIteratee,
MaybeAsyncTypeGuardIteratee,
Reducer,
MaybeAsyncReducer
MaybeAsyncReducer,
IterLike,
AsyncIterLike,
MaybeAsyncIterLike

} from "./iterators/types.js";

Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Random from "./random.js";
export { delay, nextAnimationFrame } from "./async.js";
export { dateDifference, dateRange, dateRound, DateUnit } from "./date.js";
export { loadScript } from "./dom.js";
export { count, range, shuffle, unique, zip } from "./iterator.js";
export { chain, count, enumerate, range, shuffle, unique, zip } from "./iterator.js";
export { average, hash, sum } from "./math.js";
export { capitalize } from "./string.js";

Expand Down

0 comments on commit 00c1be9

Please sign in to comment.