together-ai-sdk
Version:
A typescript SDK for the Together AI API
16 lines (15 loc) • 486 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeFront = void 0;
/**
* Removes the front of a string if it exists
* @param str - the string to remove the front of
* @param front - the string to remove from the front of str
* @returns str with front removed from the front
*/
const removeFront = (str, front) => {
if (!str.startsWith(front))
return str;
return str.slice(front.length);
};
exports.removeFront = removeFront;