UNPKG

readmeasy

Version:

Creates README.md for node modules using any template engine as easy as possible.

44 lines (43 loc) 1.65 kB
/** @ignore */ declare type shortCaseMethodName = "camel" | "capital" | "constant" | "dot" | "header" | "no" | "param" | "pascal" | "path" | "sentence" | "snake" | "title"; /** @ignore */ declare type CaseMethodName = "camelCase" | "capitalCase" | "constantCase" | "dotCase" | "headerCase" | "noCase" | "paramCase" | "pascalCase" | "pathCase" | "sentenceCase" | "snakeCase" | "titleCase"; /** * Implements the library [change-case](https://github.com/blakeembrey/change-case). * * @ignore * @param to is shorthand or full name for the change-case function. * @param string is the string to modify. * @returns string with case changed. * @example * changeCase("camelCase", "test string"); // testString */ export declare function changeCase(string: string, to: shortCaseMethodName | CaseMethodName): string; /** * Prefixes a string to the beginning of each line in the first string * * @ignore * @param string is the string to modify. * @param replacer is the string to prefix to each line. * @returns prefixed lines. * @example * prefixLines("abc\nabc", "--"); * // --abc * // --abc */ export declare function prefixLines(string: string, replacer?: string): string; /** * Returns first defined or non-empty input. This may be useful for `handlebars`, because it does not provide * short circuit operator like `nunjucks` * * @ignore * @param input is list of inputs to check. * @example * // Handlebars: * {{ '{{ firstAvaialbale package.label package.name }}' }} * * // Equals this in nunjucks * {{ '{{ package.label or package.name }}' }} */ export declare function firstAvailable(...input: any[]): any; export {};