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
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.prettierPath": "./node_modules/prettier",
"typescript.tsdk": "./node_modules/typescript/lib"
}
12 changes: 12 additions & 0 deletions .yarn/patches/immutability-helper-npm-3.1.1-482f1f8f58.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/index.d.ts b/index.d.ts
index 77c12444ac3adf293518e92c07e1680f7d954cb2..8b8da3a4fe0405d81e14998045f8047b1822ac12 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -11,6 +11,7 @@ export declare const isEquals: any;
export declare const extend: <T>(directive: string, fn: (param: any, old: T) => T) => void;
declare const _default: <T, C extends CustomCommands<object> = never>(object: T, $spec: Spec<T, C>) => T;
export default _default;
+export = _default;
export declare type CustomCommands<T> = T & {
__noInferenceCustomCommandsBrand: any;
};
16 changes: 7 additions & 9 deletions .yarn/patches/nullthrows-npm-1.1.1-3d1f817134.patch
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
diff --git a/nullthrows.d.ts b/nullthrows.d.ts
index d4953f2f47b79701e5f125b9c041fb185668dd53..a39a37b30cd206e037ecbbb66bc90dacd6adb3af 100644
index d4953f2f47b79701e5f125b9c041fb185668dd53..2b48c84aa711910fe2d11d43dcf1e78e21fa56ab 100644
--- a/nullthrows.d.ts
+++ b/nullthrows.d.ts
@@ -1,5 +1,15 @@
@@ -1,5 +1,12 @@
/**
* Throws if value is null or undefined, otherwise returns value.
- * Throws if value is null or undefined, otherwise returns value.
+ * Throws if `value` is `null` or `undefined`, otherwise returns `value`.
*/
+declare function nullthrows<T>(
+ value?: T | null,
+ message?: string,
+): NonNullable<T>;
+

-export default function nullthrows<T>(value?: T | null, message?: string): T;
+// Patched based on https://github.com/microsoft/TypeScript/issues/46770#issuecomment-1039459991 and https://github.com/zertosh/nullthrows/pull/15
+
+declare namespace nullthrows {
+ export { nullthrows as default };
+}
+export default nullthrows;
+export = nullthrows;

-export default function nullthrows<T>(value?: T | null, message?: string): T;
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"workspaces/repository-scripts",
"workspaces/util"
],
"type": "module",
"scripts": {
"format": "yarn workspace @code-chronicles/repository-scripts start format",
"lint": "yarn workspace @code-chronicles/repository-scripts start lint",
Expand All @@ -27,7 +28,7 @@
},
"devDependencies": {
"@code-chronicles/eslint-config": "workspace:*",
"eslint": "9.10.0",
"eslint": "9.11.0",
"husky": "9.1.6",
"lint-staged": "15.2.10",
"prettier": "3.3.3"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "@jest/globals";

import "./index";
import "./index.ts";

describe("Array.prototype.slidingWindows", () => {
it("can slide over an array", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type IndexableArraySlice, ArraySlice } from "../ArraySlice";
import { type IndexableArraySlice, ArraySlice } from "../ArraySlice/index.ts";

declare global {
interface Array<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "../Array.prototype.swap";
import "../Array.prototype.swap/index.ts";

export class BinaryHeap<T> {
private readonly elements: T[] = [];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "@jest/globals";

import "./index";
import "./index.ts";

const VALUES = [
42,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { describe, expect, it } from "@jest/globals";

import "../Iterator.prototype.take";
import "../Iterator.prototype.take/index.ts";

import { iteratorPrototype } from "../Iterator.prototype";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";
delete (iteratorPrototype as unknown as Record<string, unknown>).drop;
// eslint-disable-next-line import-x/first -- This has to happen after we delete the built-in implementation.
import "./index";
import "./index.ts";

describe("Iterator.prototype.drop", () => {
it("drops the specified number of elements from the iterator", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "../Iterator.prototype.toIterable";
import { iteratorPrototype } from "../Iterator.prototype";
import "../Iterator.prototype.toIterable/index.ts";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";

declare global {
interface Iterator<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { describe, expect, it, jest } from "@jest/globals";

import { iteratorPrototype } from "../Iterator.prototype";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";
delete (iteratorPrototype as unknown as Record<string, unknown>).every;
// eslint-disable-next-line import-x/first -- This has to happen after we delete the built-in implementation.
import "./index";
import "./index.ts";

describe("Iterator.prototype.every", () => {
it("returns true if all elements pass the test and false if an element fails a test", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "../Iterator.prototype.toIterable";
import { iteratorPrototype } from "../Iterator.prototype";
import "../Iterator.prototype.toIterable/index.ts";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";

declare global {
interface Iterator<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { describe, expect, it } from "@jest/globals";

import { iteratorPrototype } from "../Iterator.prototype";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";
delete (iteratorPrototype as unknown as Record<string, unknown>).filter;
// eslint-disable-next-line import-x/first -- This has to happen after we delete the built-in implementation.
import "./index";
import "./index.ts";

describe("Iterator.prototype.filter", () => {
it.each([
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "../Iterator.prototype.toIterable";
import { iteratorPrototype } from "../Iterator.prototype";
import "../Iterator.prototype.toIterable/index.ts";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";

declare global {
interface Iterator<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { describe, expect, it, jest } from "@jest/globals";

import { iteratorPrototype } from "../Iterator.prototype";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";
delete (iteratorPrototype as unknown as Record<string, unknown>).find;
// eslint-disable-next-line import-x/first -- This has to happen after we delete the built-in implementation.
import "./index";
import "./index.ts";

describe("Iterator.prototype.find", () => {
it("returns the first element that satisfies the callback", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "../Iterator.prototype.toIterable";
import { iteratorPrototype } from "../Iterator.prototype";
import "../Iterator.prototype.toIterable/index.ts";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";

declare global {
interface Iterator<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { describe, expect, it } from "@jest/globals";

import { iteratorPrototype } from "../Iterator.prototype";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";
delete (iteratorPrototype as unknown as Record<string, unknown>).flatMap;
// eslint-disable-next-line import-x/first -- This has to happen after we delete the built-in implementation.
import "./index";
import "./index.ts";

describe("Iterator.prototype.flatMap", () => {
it("can flatten an Array's values()", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "../Iterator.prototype.toIterable";
import { iteratorPrototype } from "../Iterator.prototype";
import "../Iterator.prototype.toIterable/index.ts";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";

declare global {
interface Iterator<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { describe, expect, it, jest } from "@jest/globals";

import { iteratorPrototype } from "../Iterator.prototype";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";
delete (iteratorPrototype as unknown as Record<string, unknown>).forEach;
// eslint-disable-next-line import-x/first -- This has to happen after we delete the built-in implementation.
import "./index";
import "./index.ts";

describe("Iterator.prototype.forEach", () => {
it("calls the callback function for each array element", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "../Iterator.prototype.toIterable";
import { iteratorPrototype } from "../Iterator.prototype";
import "../Iterator.prototype.toIterable/index.ts";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";

declare global {
interface Iterator<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { describe, expect, it } from "@jest/globals";

import { iteratorPrototype } from "../Iterator.prototype";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";
delete (iteratorPrototype as unknown as Record<string, unknown>).map;
// eslint-disable-next-line import-x/first -- This has to happen after we delete the built-in implementation.
import "./index";
import "./index.ts";

describe("Iterator.prototype.map", () => {
it("can map an Array's values()", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "../Iterator.prototype.toIterable";
import { iteratorPrototype } from "../Iterator.prototype";
import "../Iterator.prototype.toIterable/index.ts";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";

declare global {
interface Iterator<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "@jest/globals";

import "./index";
import "./index.ts";

describe("Iterator.prototype.max", () => {
it("can find the max of an iterator of numbers", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { compareNatural } from "../compareNatural";
import "../Iterator.prototype.toIterable";
import { iteratorPrototype } from "../Iterator.prototype";
import { compareNatural } from "../compareNatural/index.ts";
import "../Iterator.prototype.toIterable/index.ts";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";

declare global {
interface Iterator<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "@jest/globals";

import "./index";
import "./index.ts";

describe("Iterator.prototype.min", () => {
it("can find the min of an iterator of numbers", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { compareNatural } from "../compareNatural";
import "../Iterator.prototype.toIterable";
import { iteratorPrototype } from "../Iterator.prototype";
import { compareNatural } from "../compareNatural/index.ts";
import "../Iterator.prototype.toIterable/index.ts";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";

declare global {
interface Iterator<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "@jest/globals";

import "./index";
import "./index.ts";

describe("Iterator.prototype.product", () => {
it("multiplies an Array's values()", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "../Iterator.prototype.toIterable";
import { iteratorPrototype } from "../Iterator.prototype";
import "../Iterator.prototype.toIterable/index.ts";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";

declare global {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { describe, expect, it } from "@jest/globals";

import "../String.prototype.chars";
import { iteratorPrototype } from "../Iterator.prototype";
import "../String.prototype.chars/index.ts";

import { iteratorPrototype } from "../Iterator.prototype/index.ts";
delete (iteratorPrototype as unknown as Record<string, unknown>).reduce;
// eslint-disable-next-line import-x/first -- This has to happen after we delete the built-in implementation.
import "./index";
import "./index.ts";

describe("Iterator.prototype.reduce", () => {
it("can reduce an iterator without an initial value", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "../Iterator.prototype.toIterable";
import { iteratorPrototype } from "../Iterator.prototype";
import "../Iterator.prototype.toIterable/index.ts";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";

declare global {
interface Iterator<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { describe, expect, it, jest } from "@jest/globals";

import { iteratorPrototype } from "../Iterator.prototype";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";
delete (iteratorPrototype as unknown as Record<string, unknown>).some;
// eslint-disable-next-line import-x/first -- This has to happen after we delete the built-in implementation.
import "./index";
import "./index.ts";

describe("Iterator.prototype.some", () => {
it("returns true if one element passes a test and false if all elements fail the test", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "../Iterator.prototype.toIterable";
import { iteratorPrototype } from "../Iterator.prototype";
import "../Iterator.prototype.toIterable/index.ts";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";

declare global {
interface Iterator<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "@jest/globals";

import "./index";
import "./index.ts";

describe("Iterator.prototype.sum", () => {
it("sums an Array's values()", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "../Iterator.prototype.toIterable";
import { iteratorPrototype } from "../Iterator.prototype";
import "../Iterator.prototype.toIterable/index.ts";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";

declare global {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { describe, expect, it } from "@jest/globals";

import { iteratorPrototype } from "../Iterator.prototype";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";
delete (iteratorPrototype as unknown as Record<string, unknown>).take;
// eslint-disable-next-line import-x/first -- This has to happen after we delete the built-in implementation.
import "./index";
import "./index.ts";

describe("Iterator.prototype.take", () => {
it("takes the specified number of elements from the iterator", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "../Iterator.prototype.toIterable";
import { iteratorPrototype } from "../Iterator.prototype";
import "../Iterator.prototype.toIterable/index.ts";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";

declare global {
interface Iterator<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { describe, expect, it } from "@jest/globals";

import "../Iterator.prototype.filter";
import "../Iterator.prototype.map";
import "../Iterator.prototype.filter/index.ts";
import "../Iterator.prototype.map/index.ts";

import "./index";
import "./index.ts";

describe("Iterator.prototype.tally", () => {
it("tallies an Array's values()", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "../Iterator.prototype.toIterable";
import { iteratorPrototype } from "../Iterator.prototype";
import "../Iterator.prototype.toIterable/index.ts";
import { iteratorPrototype } from "../Iterator.prototype/index.ts";

declare global {
interface Iterator<T> {
Expand Down
Loading
Loading