Skip to content

Instantly share code, notes, and snippets.

View vitaly-t's full-sized avatar
🐈
Meow!

Vitaly Tomilov vitaly-t

🐈
Meow!
View GitHub Profile
@vitaly-t
vitaly-t / ini_parser.ts
Last active July 25, 2025 22:15
Complete INI Parser for NodeJS
import {readFileSync} from 'node:fs';
/**
* Type of data produced by `parseIniFile`
*/
export type INI_Data<T> = { [name: string]: T | { [name: string]: T } };
/**
* Full section name, which consist of the section name itself, plus optional alias.
*
@vitaly-t
vitaly-t / chain-arrays.ts
Last active October 2, 2024 13:45
Logically concatenates arrays
/**
* Iterable arrays chain, extended for "getLength" and "at" accessor.
*/
export interface IArraysChain<T> extends RelativeIndexable<T>, Iterable<T> {
/**
* Calculates total length of all input arrays combined.
*/
getLength(): number;
}
@vitaly-t
vitaly-t / retry-async.ts
Last active May 20, 2025 15:20
retry-async
/**
* Retry-status object type, for use with RetryCB.
*/
export type RetryStatus<D = unknown> = {
/**
* Retry index, starting from 0.
*/
readonly index: number,
/**