@character-foundry/character-foundry 0.4.3-dev.1766019473 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/voxta.js CHANGED
@@ -7212,22 +7212,6 @@ function sanitizeName(name, ext) {
7212
7212
  if (!safeName) safeName = "asset";
7213
7213
  return safeName;
7214
7214
  }
7215
- function sanitizeExtension(ext) {
7216
- const normalized = ext.trim().replace(/^\./, "").toLowerCase();
7217
- if (!normalized) {
7218
- throw new Error("Invalid asset extension: empty extension");
7219
- }
7220
- if (normalized.length > 64) {
7221
- throw new Error(`Invalid asset extension: too long (${normalized.length} chars)`);
7222
- }
7223
- if (normalized.includes("/") || normalized.includes("\\") || normalized.includes("\0")) {
7224
- throw new Error("Invalid asset extension: path separators are not allowed");
7225
- }
7226
- if (!/^[a-z0-9][a-z0-9._-]*$/.test(normalized)) {
7227
- throw new Error(`Invalid asset extension: "${ext}"`);
7228
- }
7229
- return normalized;
7230
- }
7231
7215
  function writeVoxta(card, assets, options = {}) {
7232
7216
  const { compressionLevel = 6, includePackageJson = false } = options;
7233
7217
  const cardData = card.data;
@@ -7316,9 +7300,8 @@ function writeVoxta(card, assets, options = {}) {
7316
7300
  let assetCount = 0;
7317
7301
  let mainThumbnail;
7318
7302
  for (const asset of assets) {
7319
- const safeExt = sanitizeExtension(asset.ext);
7320
- const safeName = sanitizeName(asset.name, safeExt);
7321
- const finalFilename = `${safeName}.${safeExt}`;
7303
+ const safeName = sanitizeName(asset.name, asset.ext);
7304
+ const finalFilename = `${safeName}.${asset.ext}`;
7322
7305
  let voxtaPath = "";
7323
7306
  const tags = asset.tags || [];
7324
7307
  const isMainIcon = asset.type === "icon" && (tags.includes("portrait-override") || asset.name === "main" || asset.isMain);