lux-framework
Version:
Build scalable, Node.js-powered REST APIs with almost no code.
22 lines (17 loc) • 382 B
JavaScript
// @flow
const GITHUB_URL = 'https://github.com/postlight/lux';
type Options = {
line?: number;
branch?: string;
};
/**
* @private
*/
export function fileLink(path: string, opts: Options = {}): string {
const { line, branch = 'master' } = opts;
let link = `${GITHUB_URL}/blob/${branch}/${path}`;
if (line && line >= 0) {
link += `#${line}`;
}
return link;
}