import { shorten } from "https://deno.land/x/typeorm@v0.2.23-rc10/src/util/StringUtils.ts";
Shorten a given input
. Useful for RDBMS imposing a limit on the
maximum length of aliases and column names in SQL queries.
Examples
// returns: "UsShCa__orde__mark__dire"
shorten('UserShoppingCart__order__market__director')
// returns: "UsShCa__orde__mark__dire" shorten('UserShoppingCart__order__market__director')
// returns: "cat_wit_ver_lon_nam_pos_wit_ver_lon_nam_pos_wit_ver_lon_nam" shorten( 'category_with_very_long_name_posts_with_very_long_name_post_with_very_long_name', { separator: '_', segmentLength: 3 } )
// equals: UsShCa__orde__mark_market_id
${shorten('UserShoppingCart__order__market')}_market_id