import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
import { includes } from 'lodash';
var regex = /(rule\.つくる\(|\S\.しょうかんする\(|\S\.へんしんする\(|\.skill = )['"]([^'"]+)['"]/g;
var errorMessage = 'extractAssetNames allows only string at first argument';
export default function extractAssetNames() {
  var code = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  if (typeof code !== 'string') throw new TypeError(errorMessage);
  var assetNames = [];
  var result;
  regex.lastIndex = 0; // 正規表現のマッチを初期化

  while (result = regex.exec(code)) {
    var _result = result,
        _result2 = _slicedToArray(_result, 3),
        name = _result2[2];

    if (name && !includes(assetNames, name)) {
      assetNames.push(name);
    }
  }

  return assetNames;
}