source: trip-planner-front/node_modules/postcss-colormin/dist/lib/getShortestString.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 468 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7
8/**
9 * Returns the shortest string in array
10 */
11const getShortestString = strings => {
12 let shortest = null;
13
14 for (let string of strings) {
15 if (shortest === null || string.length < shortest.length) {
16 shortest = string;
17 }
18 }
19
20 return shortest;
21};
22
23var _default = getShortestString;
24exports.default = _default;
25module.exports = exports.default;
Note: See TracBrowser for help on using the repository browser.