'use strict';

const ifStartWith = require('./../utils/if-start-with'),
      PREFIXES    = require('./../utils/prefixes');

function getPrefix (word) {
  let prefix     = '',
      prefixTemp = '';

  for (let i = 0; i < PREFIXES.length; i++) {
    if (
         ifStartWith(word, PREFIXES[i])
      && prefixTemp.length < PREFIXES[i].length
    ) {
      prefix = prefixTemp = PREFIXES[i];
    }
  }

  return prefix;
}

module.exports = getPrefix;

@@ -99,20 +99,21 @@
 e('./../
-util
+const
 s/prefix

fix PREFIXES path