Files
bare-operating-system/kernel/lib/bare/bundles/bareMime.js
T
Raven Scott 9bdecc4170
Release rolling / release (push) Successful in 11m16s
Sync Holepunch modules to current clone/npm latest
Bump published pins (compact-encoding 3, bare-fetch/tls/https/ws 3,
bare-subprocess 6, bare-signals 5, corestore 7.12, protomux 3.11,
hypercore-crypto 3.7, bare-runtime 1.31) and regenerate catalogs,
manifests, and kernel/seeder bundles.

Adapt call sites to the new APIs:
- Corestore: explicit session flush before suspend(); treeCache ctor opts
- bare-crypto: KeyObject.export() instead of removed ._key
- Protomux 3.11: wait for fullyOpened()/fullyClosed() on chat channels
- bare-fetch: surface response.type and Headers.getSetCookie
- host snapshots: bare-os 3.9 / bare-posix / bare-fs.statfs frsize
- bare-subprocess 6: optional IPC channel + json serialization

Keep catalog sync from wiping curated pearEntries. Teach the Node test
shim to stub bare-thread/bare-worker (ESM absolute paths) and chain
Bare.on so bare-timers can load. Booter 479, protocol 34, seeder 14.
2026-08-12 20:56:28 -04:00

153 lines
6.5 KiB
JavaScript

var __bare_os_bundle_exports__ = (() => {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// ../../node_modules/bare-mime/index.js
var require_bare_mime = __commonJS({
"../../node_modules/bare-mime/index.js"(exports, module) {
var MIME = class {
constructor(type, subtype, parameters = /* @__PURE__ */ new Map()) {
this._type = type;
this._subtype = subtype;
this._parameters = parameters;
}
// https://mimesniff.spec.whatwg.org/#type
get type() {
return this._type;
}
// https://mimesniff.spec.whatwg.org/#subtype
get subtype() {
return this._subtype;
}
// https://mimesniff.spec.whatwg.org/#parameters
get parameters() {
return this._parameters;
}
};
module.exports = exports = MIME;
exports.parse = function parse(input) {
input = input.replace(httpWhitespaceLeadingAndTrailing, "");
let position = 0;
let type = "";
while (position < input.length && input[position] !== "/") {
type += input[position++];
}
if (type === "" || !isHTTPTokenCodePoints(type)) return null;
if (position >= input.length) return null;
position++;
let subtype = "";
while (position < input.length && input[position] !== ";") {
subtype += input[position++];
}
subtype = subtype.replace(httpWhitespaceTrailing, "");
if (subtype === "" || !isHTTPTokenCodePoints(subtype)) return null;
const mimeType = new MIME(type.toLowerCase(), subtype.toLowerCase());
while (position < input.length) {
position++;
while (position < input.length && httpWhitespace.test(input[position])) {
position++;
}
let parameterName = "";
while (position < input.length && input[position] !== ";" && input[position] !== "=") {
parameterName += input[position++];
}
parameterName = parameterName.toLowerCase();
if (position < input.length && input[position] === ";") continue;
if (position >= input.length) break;
position++;
let parameterValue;
if (position < input.length && input[position] === '"') {
parameterValue = collectHTTPQuotedString(input, position);
position = parameterValue.position;
parameterValue = parameterValue.value;
while (position < input.length && input[position] !== ";") {
position++;
}
} else {
parameterValue = "";
while (position < input.length && input[position] !== ";") {
parameterValue += input[position++];
}
parameterValue = parameterValue.replace(httpWhitespaceTrailing, "");
if (parameterValue === "") continue;
}
if (parameterName !== "" && isHTTPTokenCodePoints(parameterName) && isHTTPQuotedStringTokenCodePoints(parameterValue) && !mimeType._parameters.has(parameterName)) {
mimeType._parameters.set(parameterName, parameterValue);
}
}
return mimeType;
};
var httpWhitespace = /[\t\n\r ]/;
var httpWhitespaceLeadingAndTrailing = /^[\t\n\r ]+|[\t\n\r ]+$/g;
var httpWhitespaceTrailing = /[\t\n\r ]+$/;
var httpTokenCodePoints = /^[!#$%&'*+\-.^_`|~A-Za-z0-9]+$/;
var httpQuotedStringTokenCodePoints = /^[\t\x20-\x7e\x80-\xff]*$/;
function isHTTPTokenCodePoints(s) {
return httpTokenCodePoints.test(s);
}
function isHTTPQuotedStringTokenCodePoints(s) {
return httpQuotedStringTokenCodePoints.test(s);
}
function collectHTTPQuotedString(input, position) {
let value = "";
position++;
while (true) {
while (position < input.length && input[position] !== '"' && input[position] !== "\\") {
value += input[position++];
}
if (position >= input.length) break;
const quoteOrBackslash = input[position++];
if (quoteOrBackslash === "\\") {
if (position >= input.length) {
value += "\\";
break;
}
value += input[position++];
} else {
break;
}
}
return { value, position };
}
}
});
// ../../bare-lib-entry-bareMime.js
var bare_lib_entry_bareMime_exports = {};
__export(bare_lib_entry_bareMime_exports, {
default: () => bare_lib_entry_bareMime_default
});
var import_bare_mime = __toESM(require_bare_mime());
var bare_lib_entry_bareMime_default = import_bare_mime.default;
return __toCommonJS(bare_lib_entry_bareMime_exports);
})();
;(function(){var g=globalThis;var s="__bare_os_stdlib__";g[s]=g[s]||{};var e=typeof __bare_os_bundle_exports__!=="undefined"?__bare_os_bundle_exports__:void 0;var v=e!=null&&typeof e==="object"&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;g[s]["bareMime"]=v;})();