cmpstr-cli
Version:
Simple CLI wrapper for the CmpStr package to normalize and compare strings directly via terminal
32 lines (31 loc) • 1.07 kB
TypeScript
/**
* @fileoverview
* Input utilities for CmpStr CLI.
*
* Provides functions to resolve string or file input and
* to parse lists from input.
*
* @author Paul Köhler (komed3)
* @license MIT
*/
/**
* Resolves the input string.
* If the input is a path to a readable file, reads and returns its trimmed content.
* Otherwise, returns the trimmed input string itself.
*
* @async
* @param {string} input - The input string or file path.
* @returns {Promise<string>} The resolved input content.
*/
export declare function resolveInput(input: string): Promise<string>;
/**
* Resolves a list of strings from input.
* If the input is a file, reads and splits its content by line or delimiter.
* If the input is a string, splits by delimiter.
*
* @async
* @param {string} input - The input string or file path.
* @param {string} [delimiter=','] - The delimiter to use for splitting (default: `,`).
* @returns {Promise<string[]>} The resolved list of strings.
*/
export declare function resolveListInput(input: string, delimiter?: string): Promise<string[]>;