taglib-wasm 2.4.0 → 2.5.0

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.
Files changed (123) hide show
  1. package/LICENSE +0 -29
  2. package/NOTICE +35 -0
  3. package/README.md +42 -36
  4. package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/assertClassBrand.js +1 -1
  5. package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/checkPrivateRedeclaration.js +1 -1
  6. package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/classPrivateFieldGet2.js +1 -1
  7. package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/classPrivateFieldInitSpec.js +1 -1
  8. package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/classPrivateFieldSet2.js +1 -1
  9. package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/defineProperty.js +1 -1
  10. package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/toPrimitive.js +1 -1
  11. package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/toPropertyKey.js +1 -1
  12. package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/typeof.js +1 -1
  13. package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/usingCtx.js +1 -1
  14. package/dist/bwf/bext.d.ts.map +1 -1
  15. package/dist/bwf/bext.js +25 -16
  16. package/dist/constants/complex-properties.d.ts.map +1 -1
  17. package/dist/constants/general-extended-properties.d.ts +2 -1
  18. package/dist/constants/general-extended-properties.d.ts.map +1 -1
  19. package/dist/constants/general-extended-properties.js +5 -2
  20. package/dist/constants/properties.js +4 -2
  21. package/dist/constants/specialized-properties.d.ts +14 -0
  22. package/dist/constants/specialized-properties.d.ts.map +1 -1
  23. package/dist/constants/specialized-properties.js +21 -0
  24. package/dist/disc-folder.js +79 -45
  25. package/dist/folder-api/album-corroborate.d.ts.map +1 -1
  26. package/dist/folder-api/album-corroborate.js +25 -11
  27. package/dist/folder-api/album-discs.d.ts.map +1 -1
  28. package/dist/folder-api/album-discs.js +2 -5
  29. package/dist/folder-api/album-grouping.d.ts.map +1 -1
  30. package/dist/folder-api/album-grouping.js +27 -15
  31. package/dist/folder-api/album-identity.js +1 -1
  32. package/dist/folder-api/folder-disc.d.ts.map +1 -1
  33. package/dist/folder-api/folder-disc.js +24 -13
  34. package/dist/index.browser.d.ts +1 -1
  35. package/dist/index.browser.d.ts.map +1 -1
  36. package/dist/index.browser.js +2 -4453
  37. package/dist/index.d.ts +1 -1
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/msgpack/encoder.d.ts.map +1 -1
  40. package/dist/msgpack/encoder.js +3 -1
  41. package/dist/rating.js +1 -2
  42. package/dist/runtime/module-loader.d.ts.map +1 -1
  43. package/dist/runtime/module-loader.js +43 -33
  44. package/dist/runtime/platform-io.d.ts.map +1 -1
  45. package/dist/runtime/platform-io.js +4 -2
  46. package/dist/runtime/unified-loader/module-loading.d.ts.map +1 -1
  47. package/dist/runtime/unified-loader/module-loading.js +3 -2
  48. package/dist/runtime/wasi-adapter/adapter.js +1 -1
  49. package/dist/runtime/wasi-adapter/audio-properties.d.ts.map +1 -1
  50. package/dist/runtime/wasi-adapter/audio-properties.js +8 -2
  51. package/dist/runtime/wasi-adapter/file-handle.d.ts +3 -1
  52. package/dist/runtime/wasi-adapter/file-handle.d.ts.map +1 -1
  53. package/dist/runtime/wasi-adapter/file-handle.js +17 -5
  54. package/dist/runtime/wasi-adapter/handle-state.d.ts.map +1 -1
  55. package/dist/runtime/wasi-adapter/handle-state.js +7 -1
  56. package/dist/runtime/wasi-adapter/index.js +1 -2
  57. package/dist/runtime/wasi-adapter/mp4-items.d.ts +24 -0
  58. package/dist/runtime/wasi-adapter/mp4-items.d.ts.map +1 -1
  59. package/dist/runtime/wasi-adapter/mp4-items.js +119 -2
  60. package/dist/runtime/wasi-adapter/property-surface.d.ts.map +1 -1
  61. package/dist/runtime/wasi-adapter/property-surface.js +15 -6
  62. package/dist/runtime/wasi-adapter/structured-fields.js +1 -1
  63. package/dist/runtime/wasi-adapter/tag-keys.d.ts.map +1 -1
  64. package/dist/runtime/wasi-adapter/tag-keys.js +3 -1
  65. package/dist/runtime/wasi-adapter/wasm-io.d.ts.map +1 -1
  66. package/dist/runtime/wasi-adapter/wasm-io.js +1 -1
  67. package/dist/runtime/wasi-memory.js +3 -3
  68. package/dist/simple/batch-operations.d.ts.map +1 -1
  69. package/dist/simple/batch-operations.js +5 -1
  70. package/dist/simple/picture-operations.d.ts +6 -0
  71. package/dist/simple/picture-operations.d.ts.map +1 -1
  72. package/dist/simple/picture-operations.js +6 -0
  73. package/dist/simple/tag-operations.d.ts +7 -0
  74. package/dist/simple/tag-operations.d.ts.map +1 -1
  75. package/dist/simple/tag-operations.js +7 -0
  76. package/dist/simple/with-audio-file.d.ts.map +1 -1
  77. package/dist/simple/with-audio-file.js +2 -1
  78. package/dist/simple.browser.js +2 -3670
  79. package/dist/taglib/audio-file-base.d.ts +35 -1
  80. package/dist/taglib/audio-file-base.d.ts.map +1 -1
  81. package/dist/taglib/audio-file-base.js +91 -21
  82. package/dist/taglib/audio-file-checksum.d.ts.map +1 -1
  83. package/dist/taglib/audio-file-checksum.js +17 -13
  84. package/dist/taglib/audio-file-impl.d.ts.map +1 -1
  85. package/dist/taglib/audio-file-impl.js +1 -1
  86. package/dist/taglib/audio-file-interface.d.ts +18 -1
  87. package/dist/taglib/audio-file-interface.d.ts.map +1 -1
  88. package/dist/taglib/embind-adapter.d.ts +3 -0
  89. package/dist/taglib/embind-adapter.d.ts.map +1 -1
  90. package/dist/taglib/embind-adapter.js +6 -0
  91. package/dist/taglib/extra-state-registry.d.ts.map +1 -1
  92. package/dist/taglib/extra-state-registry.js +15 -0
  93. package/dist/taglib/load-audio-data.d.ts +11 -8
  94. package/dist/taglib/load-audio-data.d.ts.map +1 -1
  95. package/dist/taglib/load-audio-data.js +39 -43
  96. package/dist/taglib/metadata-extent.d.ts.map +1 -1
  97. package/dist/taglib/metadata-extent.js +59 -32
  98. package/dist/taglib/mutable-tag-impl.d.ts.map +1 -1
  99. package/dist/taglib/mutable-tag-impl.js +72 -69
  100. package/dist/taglib/taglib-class.d.ts.map +1 -1
  101. package/dist/taglib/taglib-class.js +16 -6
  102. package/dist/taglib-wasi.wasm +0 -0
  103. package/dist/taglib-web.wasm +0 -0
  104. package/dist/taglib-wrapper.js +1 -1
  105. package/dist/types/metadata-mappings.d.ts.map +1 -1
  106. package/dist/types/metadata-mappings.js +8 -0
  107. package/dist/types/tags.d.ts +48 -0
  108. package/dist/types/tags.d.ts.map +1 -1
  109. package/dist/utils/mp4-freeform.d.ts +20 -0
  110. package/dist/utils/mp4-freeform.d.ts.map +1 -0
  111. package/dist/utils/mp4-freeform.js +111 -0
  112. package/dist/utils/path.d.ts.map +1 -1
  113. package/dist/utils/path.js +3 -1
  114. package/dist/utils/tag-mapping.d.ts.map +1 -1
  115. package/dist/utils/tag-mapping.js +30 -18
  116. package/dist/version.d.ts +1 -1
  117. package/dist/version.js +1 -1
  118. package/dist/wasm.d.ts +3 -0
  119. package/dist/wasm.d.ts.map +1 -1
  120. package/dist/web-utils/data-url.js +1 -1
  121. package/dist/web.browser.js +2 -3388
  122. package/legal/COPYING.LGPL +502 -0
  123. package/package.json +17 -10
@@ -36,7 +36,9 @@ const INTERNAL_KEYS = /* @__PURE__ */ new Set([
36
36
  "bextData",
37
37
  "ixml",
38
38
  "_mp4ItemNames",
39
- "_mp4ItemRemovals"
39
+ "_mp4ItemRemovals",
40
+ "_mp4Freeform",
41
+ "_mp4FreeformDirty"
40
42
  ]);
41
43
  /**
42
44
  * A frame that exists holding an empty string is not the same state as no frame
@@ -1 +1 @@
1
- {"version":3,"file":"wasm-io.d.ts","sourceRoot":"","sources":["../../../src/runtime/wasi-adapter/wasm-io.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAahE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAyDnD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,UAAU,GACjB,UAAU,CA2BZ;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,GACX,UAAU,CAqBZ;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,UAAU,GAAG,MAAM,EAC3B,EAAE,CAAC,EAAE,MAAM,GACV,aAAa,EAAE,CA0CjB;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,WAAW,GACnB,OAAO,CA0BT;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,WAAW,GACnB,UAAU,GAAG,IAAI,CA8BnB"}
1
+ {"version":3,"file":"wasm-io.d.ts","sourceRoot":"","sources":["../../../src/runtime/wasi-adapter/wasm-io.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAShE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAyDnD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,UAAU,GACjB,UAAU,CA2BZ;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,GACX,UAAU,CAqBZ;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,UAAU,GAAG,MAAM,EAC3B,EAAE,CAAC,EAAE,MAAM,GACV,aAAa,EAAE,CA0CjB;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,WAAW,GACnB,OAAO,CA0BT;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,WAAW,GACnB,UAAU,GAAG,IAAI,CA8BnB"}
@@ -2,7 +2,7 @@ import { FileOperationError, InvalidFormatError, UnsupportedFormatError } from "
2
2
  import { decodeMessagePack } from "../../msgpack/decoder.js";
3
3
  import { encodeTagData } from "../../msgpack/encoder.js";
4
4
  import { WasmArena, WasmMemoryError } from "../wasi-memory.js";
5
- import _usingCtx from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/usingCtx.js";
5
+ import _usingCtx from "../../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/usingCtx.js";
6
6
  //#region src/runtime/wasi-adapter/wasm-io.ts
7
7
  const TL_ERROR_INVALID_INPUT = -1;
8
8
  const TL_ERROR_UNSUPPORTED_FORMAT = -2;
@@ -1,8 +1,8 @@
1
1
  import { TagLibError } from "../errors/base.js";
2
2
  import { MemoryError } from "../errors/classes.js";
3
- import _classPrivateFieldInitSpec from "../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/classPrivateFieldInitSpec.js";
4
- import _classPrivateFieldSet2 from "../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/classPrivateFieldSet2.js";
5
- import _classPrivateFieldGet2 from "../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/classPrivateFieldGet2.js";
3
+ import _classPrivateFieldInitSpec from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/classPrivateFieldInitSpec.js";
4
+ import _classPrivateFieldSet2 from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/classPrivateFieldSet2.js";
5
+ import _classPrivateFieldGet2 from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/classPrivateFieldGet2.js";
6
6
  //#region src/runtime/wasi-memory.ts
7
7
  /**
8
8
  * @fileoverview RAII Memory Management for WASI
@@ -1 +1 @@
1
- {"version":3,"file":"batch-operations.d.ts","sourceRoot":"","sources":["../../src/simple/batch-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,WAAW,EACX,QAAQ,EACT,MAAM,aAAa,CAAC;AAQrB,qDAAqD;AACrD,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7E,gEAAgE;IAChE,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,yEAAyE;AACzE,MAAM,MAAM,SAAS,CAAC,CAAC,IACnB;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GACvC;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CA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AM,EAAE,MAAM,EAAE,CAAC,CAAC;CACvC;AA0DD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,cAAc,EAAE,EACzB,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAsB5B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,EACrD,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAI5B"}
@@ -21,7 +21,11 @@ async function executeBatch(files, options, processor) {
21
21
  signal?.throwIfAborted();
22
22
  const chunkPromises = files.slice(i, i + concurrency).map(async (file, idx) => {
23
23
  const index = i + idx;
24
- const fileName = typeof file === "string" ? file : file instanceof File ? file.name : isNamedAudioInput(file) ? file.name : `buffer-${index}`;
24
+ let fileName;
25
+ if (typeof file === "string") fileName = file;
26
+ else if (file instanceof File) fileName = file.name;
27
+ else if (isNamedAudioInput(file)) fileName = file.name;
28
+ else fileName = `buffer-${index}`;
25
29
  try {
26
30
  const audioFile = await taglib.open(file);
27
31
  try {
@@ -11,6 +11,9 @@ export declare function readPictures(file: AudioFileInput): Promise<Picture[]>;
11
11
  /**
12
12
  * Replaces all embedded pictures in an audio file and returns the modified content as a buffer.
13
13
  *
14
+ * The input is read, never written: a path is only where the bytes come from,
15
+ * so the file on disk is left untouched.
16
+ *
14
17
  * @param file - File path, Uint8Array, ArrayBuffer, or File object
15
18
  * @param pictures - Complete set of pictures to embed; replaces any existing pictures
16
19
  * @returns Modified audio file contents with the updated picture set
@@ -22,6 +25,9 @@ export declare function applyPictures(file: AudioFileInput, pictures: Picture[])
22
25
  /**
23
26
  * Appends a single picture to an audio file's existing embedded pictures.
24
27
  *
28
+ * The input is read, never written: a path is only where the bytes come from,
29
+ * so the file on disk is left untouched.
30
+ *
25
31
  * @param file - File path, Uint8Array, ArrayBuffer, or File object
26
32
  * @param picture - Picture to append to the file
27
33
  * @returns Modified audio file contents with the new picture added
@@ -1 +1 @@
1
- {"version":3,"file":"picture-operations.d.ts","sourceRoot":"","sources":["../../src/simple/picture-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGxE;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAE3E;AAED;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,OAAO,EAAE,GAClB,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAE7E;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAYjC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,cAAc,EACpB,SAAS,EAAE,UAAU,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,UAAU,CAAC,CAQrB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,OAAO,EAAE,EACnB,IAAI,EAAE,WAAW,GAChB,OAAO,GAAG,SAAS,CAErB;AAED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,EACpB,UAAU,EAAE,OAAO,GAClB,OAAO,CAAC,UAAU,CAAC,CAUrB;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CACtE,KAAK,CAAC;IACJ,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CACH,CAQA"}
1
+ {"version":3,"file":"picture-operations.d.ts","sourceRoot":"","sources":["../../src/simple/picture-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGxE;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAE3E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,OAAO,EAAE,GAClB,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAE7E;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAYjC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,cAAc,EACpB,SAAS,EAAE,UAAU,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,UAAU,CAAC,CAQrB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,OAAO,EAAE,EACnB,IAAI,EAAE,WAAW,GAChB,OAAO,GAAG,SAAS,CAErB;AAED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,EACpB,UAAU,EAAE,OAAO,GAClB,OAAO,CAAC,UAAU,CAAC,CAUrB;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CACtE,KAAK,CAAC;IACJ,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CACH,CAQA"}
@@ -14,6 +14,9 @@ async function readPictures(file) {
14
14
  /**
15
15
  * Replaces all embedded pictures in an audio file and returns the modified content as a buffer.
16
16
  *
17
+ * The input is read, never written: a path is only where the bytes come from,
18
+ * so the file on disk is left untouched.
19
+ *
17
20
  * @param file - File path, Uint8Array, ArrayBuffer, or File object
18
21
  * @param pictures - Complete set of pictures to embed; replaces any existing pictures
19
22
  * @returns Modified audio file contents with the updated picture set
@@ -29,6 +32,9 @@ async function applyPictures(file, pictures) {
29
32
  /**
30
33
  * Appends a single picture to an audio file's existing embedded pictures.
31
34
  *
35
+ * The input is read, never written: a path is only where the bytes come from,
36
+ * so the file on disk is left untouched.
37
+ *
32
38
  * @param file - File path, Uint8Array, ArrayBuffer, or File object
33
39
  * @param picture - Picture to append to the file
34
40
  * @returns Modified audio file contents with the new picture added
@@ -15,6 +15,10 @@ export declare function readTags(file: AudioFileInput, options?: {
15
15
  /**
16
16
  * Applies metadata tag changes to an audio file and returns the modified content as a buffer.
17
17
  *
18
+ * The input is read, never written: a path is only where the bytes come from,
19
+ * so the file on disk is left untouched. Use {@link applyTagsToFile} for an
20
+ * in-place update.
21
+ *
18
22
  * @param file - File path, Uint8Array, ArrayBuffer, or File object
19
23
  * @param tags - Partial tag fields to merge with existing metadata
20
24
  * @returns Modified audio file contents with updated tags
@@ -63,6 +67,9 @@ export declare function readFormat(file: AudioFileInput): Promise<FileType | und
63
67
  /**
64
68
  * Removes all metadata tags and pictures from an audio file and returns the stripped content.
65
69
  *
70
+ * The input is read, never written: a path is only where the bytes come from,
71
+ * so the file on disk is left untouched.
72
+ *
66
73
  * @param file - File path, Uint8Array, ArrayBuffer, or File object
67
74
  * @returns Modified audio file contents with all tags and pictures cleared
68
75
  * @throws {TagLibInitializationError} If the Wasm module fails to initialize
@@ -1 +1 @@
1
- {"version":3,"file":"tag-operations.d.ts","sourceRoot":"","sources":["../../src/simple/tag-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,WAAW,EACX,QAAQ,EAER,QAAQ,EACT,MAAM,aAAa,CAAC;AAWrB;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,cAAc,EACpB,OAAO,GAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;CAAO,GAC7C,OAAO,CAAC,WAAW,CAAC,CAItB;AAED;;;;;;;;;GASG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GACtB,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GACtB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC,CAY1B;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAY7E;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAW/B;AAED;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAsBzE"}
1
+ {"version":3,"file":"tag-operations.d.ts","sourceRoot":"","sources":["../../src/simple/tag-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,WAAW,EACX,QAAQ,EAER,QAAQ,EACT,MAAM,aAAa,CAAC;AAWrB;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,cAAc,EACpB,OAAO,GAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;CAAO,GAC7C,OAAO,CAAC,WAAW,CAAC,CAItB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GACtB,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GACtB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC,CAY1B;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAY7E;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAW/B;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAsBzE"}
@@ -20,6 +20,10 @@ async function readTags(file, options = {}) {
20
20
  /**
21
21
  * Applies metadata tag changes to an audio file and returns the modified content as a buffer.
22
22
  *
23
+ * The input is read, never written: a path is only where the bytes come from,
24
+ * so the file on disk is left untouched. Use {@link applyTagsToFile} for an
25
+ * in-place update.
26
+ *
23
27
  * @param file - File path, Uint8Array, ArrayBuffer, or File object
24
28
  * @param tags - Partial tag fields to merge with existing metadata
25
29
  * @returns Modified audio file contents with updated tags
@@ -102,6 +106,9 @@ async function readFormat(file) {
102
106
  /**
103
107
  * Removes all metadata tags and pictures from an audio file and returns the stripped content.
104
108
  *
109
+ * The input is read, never written: a path is only where the bytes come from,
110
+ * so the file on disk is left untouched.
111
+ *
105
112
  * @param file - File path, Uint8Array, ArrayBuffer, or File object
106
113
  * @returns Modified audio file contents with all tags and pictures cleared
107
114
  * @throws {TagLibInitializationError} If the Wasm module fails to initialize
@@ -1 +1 @@
1
- {"version":3,"file":"with-audio-file.d.ts","sourceRoot":"","sources":["../../src/simple/with-audio-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/D,wBAAsB,aAAa,CAAC,CAAC,EACnC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAC5C,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,CAAC,CAAC,CAaZ;AAED,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,GACjC,OAAO,CAAC,UAAU,CAAC,CAerB;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,GACjC,OAAO,CAAC,IAAI,CAAC,CAKf"}
1
+ {"version":3,"file":"with-audio-file.d.ts","sourceRoot":"","sources":["../../src/simple/with-audio-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK/D,wBAAsB,aAAa,CAAC,CAAC,EACnC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAC5C,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,CAAC,CAAC,CAaZ;AAED,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,GACjC,OAAO,CAAC,UAAU,CAAC,CAoBrB;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,GACjC,OAAO,CAAC,IAAI,CAAC,CAKf"}
@@ -1,5 +1,6 @@
1
1
  import { FileOperationError, InvalidFormatError } from "../errors/classes.js";
2
2
  import "../errors.js";
3
+ import { readFileData } from "../utils/file.js";
3
4
  import { getTagLib } from "./config.js";
4
5
  //#region src/simple/with-audio-file.ts
5
6
  async function withAudioFile(file, fn, options) {
@@ -12,7 +13,7 @@ async function withAudioFile(file, fn, options) {
12
13
  }
13
14
  }
14
15
  async function withAudioFileSave(file, fn) {
15
- return withAudioFile(file, (audioFile) => {
16
+ return withAudioFile(typeof file === "string" ? await readFileData(file) : file, (audioFile) => {
16
17
  fn(audioFile);
17
18
  if (!audioFile.save()) throw new FileOperationError("save", "Failed to save metadata changes. The file may be read-only or corrupted.");
18
19
  return audioFile.getFileBuffer();