@ply-ct/ply
Version:
REST API Automated Testing
51 lines (50 loc) • 1.95 kB
TypeScript
import { Options } from './options';
/**
* Turn a date into a timestamp based on the OS locale
* Note: Node/V8 bug causes hour = 24 (https://github.com/nodejs/node/issues/33089)
* eg: 7/3/2021, 24:52:33:347
*/
export declare function timestamp(date: Date, withTimeZone?: boolean, withMillis?: boolean): string;
/**
* time in nanoseconds
*/
export declare function nanoTime(): number;
export declare function genId(): string;
/**
* Expected format is per timestamp() --
* TODO: Only works for these two locale formats:
* MM/DD/YYYY, HH:mm:ss
* DD/MM/YYYY, HH:mm:ss (not tested actually)
*/
export declare function timeparse(time: string): Date | undefined;
/**
* Remove windows newline characters (\r)
*/
export declare function newlines(input: string): string;
/**
* split a string into an array of lines, ignoring escaped
*/
export declare function lines(input: string): string[];
/**
* Return the trailing comment portion of a line. Only works with no
* embedded comment tokens (in string content, etc).
*/
export declare function lineComment(line: string, token?: string): string | undefined;
/**
* substitute a forward slash for all backslashes
*/
export declare function fwdSlashes(path: string): string;
export declare function fixEol(path: string): string;
export declare function isJson(str: string): boolean;
export declare function writeableName(name: string): string;
export declare function writeableFileName(file: string): string;
export declare function writeablePath(path: string): string;
export declare function header(headers: {
[key: string]: string;
}, name: string): [string, string] | undefined;
export declare function isBinary(headers?: {
[key: string]: string;
}, options?: Options): boolean;
export declare function uintArrayToBase64(uintArray: Uint8Array): string;
export declare function base64ToUintArray(str: string): Uint8Array;
export declare function plyVersion(): Promise<string>;