export type SymbolWithPosition = {
  index: number;
  symbol: string;
};

const getSymbolsInPatternWithPosition = (pattern: string): SymbolWithPosition[] => {
  const patternWithSymbolsPosition: SymbolWithPosition[] = [];
  const patternArray = pattern.split('');
  patternArray.forEach((symbol, index) => {
    if (symbol !== '*') {
      patternWithSymbolsPosition.push({ index, symbol });
    }
  });

  return patternWithSymbolsPosition;
};

export default getSymbolsInPatternWithPosition;
