Skip to content

Commit

Permalink
Inline URIUtils.js. NFC
Browse files Browse the repository at this point in the history
This is only three lines and doesn't warrant a separate file.

Prior to #23297 it did need to be separately usable.
  • Loading branch information
sbc100 committed Jan 25, 2025
1 parent 73ebb91 commit 097b3b2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
1 change: 0 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export default [{
'src/proxyWorker.js',
'src/proxyClient.js',
'src/IDBStore.js',
'src/URIUtils.js',
'tools/experimental',
],
}, ...compat.extends('prettier'), js.configs.recommended, {
Expand Down
14 changes: 0 additions & 14 deletions src/URIUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,3 @@
* SPDX-License-Identifier: MIT
*/

// Prefix of data URIs emitted by SINGLE_FILE and related options.
var dataURIPrefix = 'data:application/octet-stream;base64,';

/**
* Indicates whether filename is a base64 data URI.
* @noinline
*/
var isDataURI = (filename) => filename.startsWith(dataURIPrefix);

/**
* Indicates whether filename is delivered via file protocol (as opposed to http/https)
* @noinline
*/
var isFileURI = (filename) => filename.startsWith('file://');
15 changes: 14 additions & 1 deletion src/preamble.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,20 @@ var runtimeInitialized = false;
var runtimeExited = false;
#endif

#include "URIUtils.js"
// Prefix of data URIs emitted by SINGLE_FILE and related options.
var dataURIPrefix = 'data:application/octet-stream;base64,';

/**
* Indicates whether filename is a base64 data URI.
* @noinline
*/
var isDataURI = (filename) => filename.startsWith(dataURIPrefix);

/**
* Indicates whether filename is delivered via file protocol (as opposed to http/https)
* @noinline
*/
var isFileURI = (filename) => filename.startsWith('file://');

#include "runtime_shared.js"

Expand Down

0 comments on commit 097b3b2

Please sign in to comment.