web: Rename Config.public_paths to Config.publicPaths

This commit is contained in:
Nathan Adams 2020-11-20 23:27:10 +01:00 committed by Mike Welsh
parent 707788218d
commit bcfe59c351
2 changed files with 6 additions and 6 deletions

View File

@ -52,12 +52,12 @@ export interface Config {
/**
* A map of public paths from source name to URL.
*/
public_paths?: Record<string, string>;
publicPaths?: Record<string, string>;
/**
* The URL at which Ruffle can load its extra files (ie `.wasm`).
*
* [public_paths] is consulted first for a source-specific URL,
* [publicPaths] is consulted first for a source-specific URL,
* with this field being a fallback.
*/
publicPath?: string;

View File

@ -9,7 +9,7 @@ import { Config } from "./config";
*
* 1. The public path can be specified on a per-source basis using the
* RufflePlayer config, for example:
* `window.RufflePlayer.config.public_paths.local = "/dist/";`
* `window.RufflePlayer.config.publicPaths.local = "/dist/";`
* 2. A global public path can be specified for all sources, also in config.
* `window.RufflePlayer.config.publicPath = "/dist/";`
* 3. If there is absolutely no configuration that yields a public path then we
@ -24,10 +24,10 @@ export function publicPath(config: Config, source_name: string): string {
let path = "";
if (
config !== undefined &&
config.public_paths !== undefined &&
config.public_paths[source_name] !== undefined
config.publicPaths !== undefined &&
config.publicPaths[source_name] !== undefined
) {
path = config.public_paths[source_name];
path = config.publicPaths[source_name];
} else if (config !== undefined && config.publicPath !== undefined) {
path = config.publicPath;
} else if (