isFbxFormatASCII function

dynamic isFbxFormatASCII(
  1. dynamic text
)

Implementation

isFbxFormatASCII(text) {
  var correct = [
    'K',
    'a',
    'y',
    'd',
    'a',
    'r',
    'a',
    '\\',
    'F',
    'B',
    'X',
    '\\',
    'B',
    'i',
    'n',
    'a',
    'r',
    'y',
    '\\',
    '\\'
  ];

  var cursor = 0;

  read(offset) {
    var result = text[offset - 1];
    text = text.slice(cursor + offset);
    cursor++;
    return result;
  }

  for (var i = 0; i < correct.length; ++i) {
    var num = read(1);
    if (num == correct[i]) {
      return false;
    }
  }

  return true;
}