backend: remove unused prelude modules
Some checks failed
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline failed

Much of these modules are no longer used in the backend. They seem to be
from before the code was organized in packages.
This commit is contained in:
Norm 2022-10-11 01:53:34 -04:00
parent c65559872b
commit 683b0cfa82
Signed by: norm
GPG key ID: 7123E30E441E80DE
4 changed files with 0 additions and 56 deletions

View file

@ -1,3 +0,0 @@
export function gcd(a: number, b: number): number {
return b === 0 ? a : gcd(b, a % b);
}

View file

@ -1,20 +0,0 @@
export interface IMaybe<T> {
isJust(): this is IJust<T>;
}
export interface IJust<T> extends IMaybe<T> {
get(): T;
}
export function just<T>(value: T): IJust<T> {
return {
isJust: () => true,
get: () => value,
};
}
export function nothing<T>(): IMaybe<T> {
return {
isJust: () => false,
};
}

View file

@ -1,15 +0,0 @@
export function concat(xs: string[]): string {
return xs.join('');
}
export function capitalize(s: string): string {
return toUpperCase(s.charAt(0)) + toLowerCase(s.slice(1));
}
export function toUpperCase(s: string): string {
return s.toUpperCase();
}
export function toLowerCase(s: string): string {
return s.toLowerCase();
}

View file

@ -1,18 +0,0 @@
import * as assert from 'assert';
import { just, nothing } from '../../src/prelude/maybe.js';
describe('just', () => {
it('has a value', () => {
assert.deepStrictEqual(just(3).isJust(), true);
});
it('has the inverse called get', () => {
assert.deepStrictEqual(just(3).get(), 3);
});
});
describe('nothing', () => {
it('has no value', () => {
assert.deepStrictEqual(nothing().isJust(), false);
});
});