noodl-loader
Version:
Loader for noodl applications
33 lines (32 loc) • 1.97 kB
TypeScript
import type FileSystemHost from '../file-system';
import type { Ext } from '../types';
/**
* Returns true if two names are equivalent when comparing for existence in lists with/without the `.yml` extension
*
* @example
* ```js
* isEqualFileKey('www', 'www.yml') // true
* isEqualFileKey('www', 'www') // true
* isEqualFileKey('.yml', '') // true
* isEqualFileKey('', '') // true
* isEqualFileKey('www', 'wwww.yml') // false
* isEqualFileKey('www', 'www.ymll') // false
* isEqualFileKey('www', 'wwww') // false
* isEqualFileKey('www', '') // false
* isEqualFileKey('www.yml', '') // false
* ```
*/
export declare function equalFileKey(v1: unknown, v2: unknown): boolean;
export declare function fileSystemHost(value: unknown): value is FileSystemHost;
export declare function typeOf(value: unknown): "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | "array" | "null";
export declare function image<S extends string = string>(value: unknown): value is `${S}.${Ext.Image}`;
export declare function json<S extends string = string>(value: string): value is `${S}.${Ext.Json}`;
export declare function pdf<S extends string = string>(value: string): value is `${S}.${Ext.Pdf}`;
export declare function script<S extends string = string>(value: string): value is `${S}.${Ext.Script}`;
export declare function text<S extends string = string>(value: string): value is `${S}.${Ext.Text}`;
export declare function video<S extends string = string>(value: string): value is `${S}.${Ext.Video}`;
export declare function file<S extends string = string>(value: unknown): value is `${S}.${Ext.Image | Ext.Video}`;
export declare function promise<V = any>(value: unknown): value is Promise<V>;
export declare function stringInArray(arr: any[], value: unknown): boolean;
export declare function yaml(value: unknown): value is `${string}.yml`;
export declare function url(value: unknown): boolean;