quake 3 | copy quake 3 script files | quake 3 menu image list | Search

This JavaScript code defines a configuration object containing lists of file extensions and directory names commonly used in a software project, likely a game. This object can be used for tasks like file filtering, directory navigation, and asset management within the project.

Run example

npm run import -- "quake 3 file whitelist"

quake 3 file whitelist


var imageTypes = [
    '.png',
    '.jpg',
    '.jpeg',
    '.tga',
    '.gif',
    '.pcx',
    '.webp',
]

var audioTypes = [
    '.opus',
    '.wav',
    '.mp3',
]

var sourceFiles = [
    '.map',
    '.scc',
]

var fileTypes = [
    '.cfg',
    '.qvm',
    '.bot',
    '.txt',
    '.bsp',
    '.aas',
    '.md3',
    '.md5',
    '.shader',
    '.skin',
    '.pk3',
    '.c',
    '.h',
    '.config',
    '.menu'
]


var knownDirs = [
    'scripts',
    'botfiles',
	'fonts',
	'gfx',
    'hud',
	'icons',
	'include',
	'menu',
	'models',
	'music',
	'powerups',  // powerup shaders
	'sprites',
	'sound',
	'ui',
    'maps',
    'textures',
    
]

module.exports = {
    imageTypes,
    audioTypes,
    sourceFiles,
    fileTypes,
    knownDirs,
}

What the code could have been:

/**
 * Module exports containing various file type classifications.
 *
 * @module fileType
 */

const knownDirs = [
 'scripts',
  'botfiles',
  'fonts',
  'gfx',
  'hud',
  'icons',
  'include',
 'menu',
 'models',
 'music',
  'powerups', // Power-up shaders
 'sprites',
 'sound',
  'ui',
 'maps',
  'textures',
];

const fileExtensions = {
  images: ['.png', '.jpg', '.jpeg', '.tga', '.gif', '.pcx', '.webp'],
  audio: ['.opus', '.wav', '.mp3'],
  source: ['.map', '.scc'],
  files: [
    '.cfg',
    '.qvm',
    '.bot',
    '.txt',
    '.bsp',
    '.aas',
    '.md3',
    '.md5',
    '.shader',
    '.skin',
    '.pk3',
    '.c',
    '.h',
    '.config',
    '.menu',
  ],
};

/**
 * Get the list of known directories.
 *
 * @function getKnownDirs
 * @returns {string[]} List of known directories.
 */
function getKnownDirs() {
  return knownDirs;
}

/**
 * Get the list of file extensions.
 *
 * @function getFileExtensions
 * @returns {Object} Object containing file extensions grouped by type.
 */
function getFileExtensions() {
  return fileExtensions;
}

module.exports = {
  getKnownDirs,
  getFileExtensions,
};

This code defines a JavaScript object containing lists of file extensions and directory names commonly associated with a specific type of software project (likely a game or similar application).

Key Components:

Purpose:

This object likely serves as a configuration or lookup table within the project. It could be used for: