filter(config = {}) {
    const filtered = {};

    for (const [mode, value] of Object.entries(config)) {
      let configMode = null;

      if (isPlainObject(value)) {
        configMode = value;
      } else if (value === true) {
        configMode = {};
      }

      if (configMode !== null && spriteTypes.has(configMode.mode || mode)) {
        filtered[mode] = configMode;
        filtered[mode].mode = configMode.mode || mode;
      }
    }

    return filtered;
  }
Pick out the relevant mode options out of a configuration object

@param {object} config                 Configuration object
@returns {object}                      Mode relevant options