tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

tooltips.js (487B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 "use strict";
      6 
      7 /**
      8 * Returns first 128 characters of value for use as a tooltip.
      9 *
     10 * @param object
     11 * @returns {*}
     12 */
     13 function limitTooltipLength(object) {
     14  return object.length > 128 ? object.substring(0, 128) + "…" : object;
     15 }
     16 
     17 module.exports = {
     18  limitTooltipLength,
     19 };