chore:remove const function

This commit is contained in:
Jacob Nguyen
2023-04-16 13:27:17 -05:00
parent 8e2ba871c4
commit bc4802f261

View File

@@ -1,14 +1,6 @@
import * as Files from '../module-loading/readFile';
import { basename } from 'path';
import { Err, Ok } from 'ts-results-es';
/**
* A function that returns whatever value is provided.
* Warning: this evaluates { @param value }. It does not defer a value.
* @param value
* @__PURE__
*/
// prettier-ignore
export const _const = <T>(value: T) => () => value;
/**
*
* @param modName
@@ -19,8 +11,8 @@ export function nameOrFilename(modName: string | undefined, absPath: string) {
}
//function wrappers for empty ok / err
export const ok = _const(Ok.EMPTY);
export const err = _const(Err.EMPTY);
export const ok = () => Ok.EMPTY;
export const err = () => Err.EMPTY;
export function partition<T, V>(arr: (T & V)[], condition: (e: T & V) => boolean): [T[], V[]] {
const t: T[] = [];