mirror of
https://github.com/sern-handler/handler
synced 2026-06-06 01:16:55 +00:00
chore:remove const function
This commit is contained in:
@@ -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[] = [];
|
||||
|
||||
Reference in New Issue
Block a user