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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"devDependencies": {
"@commitlint/cli": "20.2.0",
"@commitlint/config-conventional": "20.2.0",
"@fullstacksjs/oxlint-config": "0.6.1",
"@fullstacksjs/oxlint-config": "1.0.2",
"@semantic-release/github": "12.0.2",
"@semantic-release/npm": "13.1.3",
"@semantic-release/release-notes-generator": "14.1.0",
Expand All @@ -55,7 +55,7 @@
"oxlint": "1.76.0",
"pkg-ok": "3.0.0",
"semantic-release": "25.0.2",
"typescript": "5.9.3",
"typescript": "7.0.2",
"vite-plus": "0.2.6",
"vitest": "4.1.10"
},
Expand Down
580 changes: 506 additions & 74 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
saveExact: true
catalog:
vite: npm:@voidzero-dev/vite-plus-core@0.2.6
vite: npm:@voidzero-dev/vite-plus-core@0.3.0
vitest: 4.1.10
vite-plus: latest
vite-plus: 0.3.0
overrides:
vite: 'catalog:'
vitest: 'catalog:'
Expand All @@ -13,7 +13,3 @@ peerDependencyRules:
allowedVersions:
vite: '*'
vitest: '*'
allowBuilds:
unrs-resolver: true
minimumReleaseAgeExclude:
- '@fullstacksjs/oxlint-config@0.6.1'
2 changes: 1 addition & 1 deletion src/array/compact.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { compact } from './compact.ts';

describe('compact', () => {
describe(compact, () => {
it('should return empty array with an empty array as arg', () => {
expect(compact([])).toEqual([]);
});
Expand Down
2 changes: 1 addition & 1 deletion src/array/copy.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { copy } from './copy.ts';

describe('copyArray', () => {
describe(copy, () => {
it('return value should be a new array', () => {
const array = [1];
const copied = copy(array);
Expand Down
2 changes: 1 addition & 1 deletion src/array/ensureArray.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ensureArray } from './ensureArray.ts';

describe('ensureArray', () => {
describe(ensureArray, () => {
it(`should return [undefined] when arg is undefined array`, () => {
expect(ensureArray(undefined)).toStrictEqual([undefined]);
});
Expand Down
3 changes: 2 additions & 1 deletion src/array/getRandom.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* oxlint-disable vitest/no-conditional-in-test */
import { getRandom } from './getRandom.ts';

describe('getRandom', () => {
describe(getRandom, () => {
it('should return undefined when given empty array', () => {
expect(getRandom([])).toBeUndefined();
});
Expand Down
2 changes: 1 addition & 1 deletion src/array/isEmpty.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isEmpty } from './isEmpty.ts';

describe('isEmpty', () => {
describe(isEmpty, () => {
const cases = [
{ arr: [], expected: true },
{ arr: [1], expected: false },
Expand Down
4 changes: 2 additions & 2 deletions src/array/isLastIndex.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isLastIndex } from './isLastIndex.ts';

describe('array', () => {
describe('isLastIndex', () => {
describe(isLastIndex, () => {
describe(isLastIndex, () => {
const cases = [
{ arr: [], index: 0, expected: false },
{ arr: [1], index: 0, expected: true },
Expand Down
2 changes: 1 addition & 1 deletion src/array/isNullOrEmptyArray.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isNullOrEmptyArray } from './isNullOrEmptyArray.ts';

describe('isNullOrEmptyArray', () => {
describe(isNullOrEmptyArray, () => {
const cases = [
{ x: null, expected: true },
{ x: undefined, expected: true },
Expand Down
2 changes: 1 addition & 1 deletion src/array/range.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { range } from './range.ts';

describe('range', () => {
describe(range, () => {
it('should create an empty array for zero-length', () => {
expect(range(0)).toStrictEqual([]);
});
Expand Down
2 changes: 1 addition & 1 deletion src/array/shuffle.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { range } from './range.ts';
import { shuffle } from './shuffle.ts';

describe('shuffle', () => {
describe(shuffle, () => {
it('should return an empty array for empty array', () => {
expect(shuffle([])).toEqual([]);
});
Expand Down
2 changes: 1 addition & 1 deletion src/array/toArray.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { toArray } from './toArray.ts';

describe('toArray', () => {
describe(toArray, () => {
it('should return an empty array for null', () => {
expect(toArray(null)).toStrictEqual([]);
});
Expand Down
2 changes: 1 addition & 1 deletion src/array/uniq.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { uniq } from './uniq.ts';

describe('uniq', () => {
describe(uniq, () => {
it('should not mutate original array', () => {
const arr = [1, 2];

Expand Down
3 changes: 2 additions & 1 deletion src/boolean/randomBool.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* oxlint-disable vitest/no-conditional-in-test */
import { randomBool } from './randomBool.ts';

describe('randomBool', () => {
describe(randomBool, () => {
it('should return an boolean', () => {
for (let i = 0; i < 100; i++) {
const boolean = randomBool();
Expand Down
2 changes: 1 addition & 1 deletion src/error/assert.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert } from './assert.ts';

describe('assert', () => {
describe(assert, () => {
it('should throw error when condition is false', () => {
expect(() => assert(false, 'WTF')).toThrow('WTF');
});
Expand Down
2 changes: 1 addition & 1 deletion src/error/assertNotNull.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assertNotNull } from './assertNotNull.ts';

describe('assertNotNull', () => {
describe(assertNotNull, () => {
it('should throw error when condition is null', () => {
expect(() => assertNotNull(null, 'WTF')).toThrow('WTF');
});
Expand Down
2 changes: 1 addition & 1 deletion src/error/throwErr.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { throwErr } from './throwErr.ts';

describe('throwErr', () => {
describe(throwErr, () => {
it('should throw Error instance', () => {
expect(() => throwErr(new Error('error'))).toThrow('error');
});
Expand Down
2 changes: 1 addition & 1 deletion src/function/callAll.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { callAll } from './callAll.ts';

describe('callAll', () => {
describe(callAll, () => {
it('should call given functions with an args', () => {
const fns = [vi.fn(), vi.fn(), vi.fn()];
const args = [1, 2, 3];
Expand Down
2 changes: 1 addition & 1 deletion src/function/compose.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const diff = (a: number, b: number) => a - b;
const toString = (n: number) => n.toString();
const padStart = (s: string) => s.padStart(2, '0');

describe('compose', () => {
describe(compose, () => {
it('works when first function has 0 params', () => {
expect(compose(one, inc)()).toBe(2);
});
Expand Down
2 changes: 1 addition & 1 deletion src/function/debounce.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { debounce } from './debounce.ts';

describe('debounce', () => {
describe(debounce, () => {
beforeEach(() => {
vi.useFakeTimers();
});
Expand Down
2 changes: 1 addition & 1 deletion src/function/formatSeconds.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { formatSeconds } from './formatSeconds.ts';

describe('secondToTime', () => {
describe(formatSeconds, () => {
it('should return zero when pass 0 seconds', () => {
const format = 'mm:ss';
const sec = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/function/noop.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { noop } from './noop.ts';

describe('noop', () => {
describe(noop, () => {
it('should return undefined', () => {
expect(noop()).toBeUndefined();
});
Expand Down
2 changes: 1 addition & 1 deletion src/function/not.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { not } from './not.ts';

describe('not', () => {
describe(not, () => {
it('should negate boolean', () => {
const t = true;
const f = false;
Expand Down
2 changes: 1 addition & 1 deletion src/function/pipe.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { pipe } from './pipe.ts';

describe('pipe', () => {
describe(pipe, () => {
it('should pipe value through functions from left to right', () => {
const add = (x: number) => x + 1;
const multiply = (x: number) => x * 2;
Expand Down
2 changes: 1 addition & 1 deletion src/function/sleep.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { sleep } from './sleep.ts';

describe('sleep', () => {
describe(sleep, () => {
beforeEach(() => {
vi.useFakeTimers();
vi.spyOn(globalThis, 'setTimeout');
Expand Down
2 changes: 1 addition & 1 deletion src/function/throttle.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { throttle } from './throttle.ts';

const oneSecond = 1000;

describe('throttle', () => {
describe(throttle, () => {
beforeEach(() => {
vi.useFakeTimers();
});
Expand Down
10 changes: 5 additions & 5 deletions src/function/tryOr.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { tryOr } from './tryOr.ts';

describe('try catch', () => {
describe(tryOr, () => {
it('should call the passed function to it', () => {
const fn = vi.fn();
tryOr(fn);

expect(fn).toBeCalledWith();
expect(fn).toHaveBeenCalledWith();
});

it('should return the function return value', () => {
Expand All @@ -23,7 +23,7 @@ describe('try catch', () => {
};
tryOr(fn, handler);

expect(handler).toBeCalledWith('custom error message');
expect(handler).toHaveBeenCalledWith('custom error message');
});

it('should return the handler return value if there is an error', () => {
Expand All @@ -49,7 +49,7 @@ describe('try catch', () => {

tryOr(fn, handler);

expect(handler).toBeCalledWith(error);
expect(handler).toHaveBeenCalledWith(error);
});

it('the default handler should return error', () => {
Expand All @@ -75,7 +75,7 @@ describe('try catch', () => {
const handler = vi.fn();
await tryOr(fn, handler);

expect(handler).toBeCalledWith(1);
expect(handler).toHaveBeenCalledWith(1);
});

it("should return the handler return value if it's rejected", async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/guards/isBoolean.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isBoolean } from './isBoolean.ts';

describe('isBoolean', () => {
describe(isBoolean, () => {
const cases = [
{ x: true, expected: true },
{ x: false, expected: true },
Expand Down
2 changes: 1 addition & 1 deletion src/guards/isEmptyObject.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isEmptyObject } from './isEmptyObject.ts';

describe('isEmptyObject', () => {
describe(isEmptyObject, () => {
const cases = [
{ x: {}, expected: true },
{ x: [], expected: false },
Expand Down
2 changes: 1 addition & 1 deletion src/guards/isFunction.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isFunction } from './isFunction.ts';

describe('isFunction', () => {
describe(isFunction, () => {
it('should return false for undefined', () => {
expect(isFunction(undefined)).toBe(false);
});
Expand Down
2 changes: 1 addition & 1 deletion src/guards/isIterable.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isIterable } from './isIterable.ts';

describe('isIterable', () => {
describe(isIterable, () => {
it('should return false for undefined', () => {
expect(isIterable(undefined)).toBe(false);
});
Expand Down
2 changes: 1 addition & 1 deletion src/guards/isMap.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isMap } from './isMap.ts';

describe('isMap', () => {
describe(isMap, () => {
const cases = [
{ x: new Map([['a', 1]]), expected: true },
{ x: new Map(), expected: true },
Expand Down
2 changes: 1 addition & 1 deletion src/guards/isNotNull.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isNotNull } from './isNotNull.ts';

describe('isNotNull', () => {
describe(isNotNull, () => {
const cases = [
{ x: undefined, expected: false },
{ x: null, expected: false },
Expand Down
2 changes: 1 addition & 1 deletion src/guards/isNull.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isNull } from './isNull.ts';

describe('isNull', () => {
describe(isNull, () => {
const cases = [
{ x: undefined, expected: true },
{ x: null, expected: true },
Expand Down
2 changes: 1 addition & 1 deletion src/guards/isObject.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isObject } from './isObject.ts';

describe('isObject', () => {
describe(isObject, () => {
const cases = [
{ x: '', expected: false },
{ x: 'hello world', expected: false },
Expand Down
2 changes: 1 addition & 1 deletion src/guards/isPlainObject.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isPlainObject } from './isPlainObject.ts';

describe('isPlainObject', () => {
describe(isPlainObject, () => {
const cases = [
{ x: '', expected: false },
{ x: 'hello world', expected: false },
Expand Down
2 changes: 1 addition & 1 deletion src/guards/isPromise.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isPromise } from './isPromise.ts';

describe('isPromise', () => {
describe(isPromise, () => {
const falseCases = [
null,
undefined,
Expand Down
2 changes: 1 addition & 1 deletion src/guards/isSet.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isSet } from './isSet.ts';

describe('isSet', () => {
describe(isSet, () => {
const cases = [
{ x: new Set([1, 2]), expected: true },
{ x: new Set(), expected: true },
Expand Down
2 changes: 1 addition & 1 deletion src/guards/isString.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isString } from './isString.ts';

describe('isString', () => {
describe(isString, () => {
const cases = [
{ x: '', expected: true },
{ x: undefined, expected: false },
Expand Down
2 changes: 1 addition & 1 deletion src/guards/isTruthy.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isTruthy } from './isTruthy.ts';

describe('isTruthy', () => {
describe(isTruthy, () => {
const cases = [
{ x: undefined, expected: false },
{ x: NaN, expected: false },
Expand Down
2 changes: 1 addition & 1 deletion src/internals/changeCase.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { changeCase } from './changeCase.ts';

describe('changeCase', () => {
describe(changeCase, () => {
const defaultCases = [
{ x: '', expected: '' },
{ x: ' ', expected: '' },
Expand Down
2 changes: 1 addition & 1 deletion src/node/getNodeEnv.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getNodeEnv } from './getNodeEnv.ts';

describe('getNodeEnv', () => {
describe(getNodeEnv, () => {
beforeEach(() => {
vi.unstubAllEnvs();
});
Expand Down
Loading