@dragon708/docmind-markdown 1.2.5 → 1.2.7

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 (328) hide show
  1. package/node_modules/music-metadata/LICENSE.txt +3 -3
  2. package/node_modules/music-metadata/README.md +246 -690
  3. package/node_modules/music-metadata/lib/ParserFactory.d.ts +31 -27
  4. package/node_modules/music-metadata/lib/ParserFactory.js +219 -108
  5. package/node_modules/music-metadata/lib/aiff/AiffParser.d.ts +2 -2
  6. package/node_modules/music-metadata/lib/aiff/AiffParser.js +38 -34
  7. package/node_modules/music-metadata/lib/aiff/AiffTagMap.d.ts +1 -1
  8. package/node_modules/music-metadata/lib/aiff/AiffTagMap.js +7 -2
  9. package/node_modules/music-metadata/lib/aiff/AiffToken.d.ts +6 -32
  10. package/node_modules/music-metadata/lib/aiff/AiffToken.js +17 -27
  11. package/node_modules/music-metadata/lib/apev2/APEv2Parser.d.ts +8 -24
  12. package/node_modules/music-metadata/lib/apev2/APEv2Parser.js +66 -78
  13. package/node_modules/music-metadata/lib/apev2/APEv2TagMapper.d.ts +1 -1
  14. package/node_modules/music-metadata/lib/apev2/APEv2TagMapper.js +8 -4
  15. package/node_modules/music-metadata/lib/apev2/APEv2Token.d.ts +11 -10
  16. package/node_modules/music-metadata/lib/apev2/APEv2Token.js +27 -16
  17. package/node_modules/music-metadata/lib/asf/AsfObject.d.ts +53 -59
  18. package/node_modules/music-metadata/lib/asf/AsfObject.js +131 -97
  19. package/node_modules/music-metadata/lib/asf/AsfParser.d.ts +1 -1
  20. package/node_modules/music-metadata/lib/asf/AsfParser.js +43 -42
  21. package/node_modules/music-metadata/lib/asf/AsfTagMapper.d.ts +2 -2
  22. package/node_modules/music-metadata/lib/asf/AsfTagMapper.js +10 -6
  23. package/node_modules/music-metadata/lib/asf/AsfUtil.d.ts +13 -4
  24. package/node_modules/music-metadata/lib/asf/AsfUtil.js +36 -30
  25. package/node_modules/music-metadata/lib/asf/GUID.d.ts +84 -0
  26. package/node_modules/music-metadata/lib/asf/GUID.js +121 -0
  27. package/node_modules/music-metadata/lib/common/BasicParser.d.ts +9 -9
  28. package/node_modules/music-metadata/lib/common/BasicParser.js +7 -2
  29. package/node_modules/music-metadata/lib/common/CaseInsensitiveTagMap.d.ts +3 -3
  30. package/node_modules/music-metadata/lib/common/CaseInsensitiveTagMap.js +7 -2
  31. package/node_modules/music-metadata/lib/common/CombinedTagMapper.d.ts +5 -5
  32. package/node_modules/music-metadata/lib/common/CombinedTagMapper.js +28 -24
  33. package/node_modules/music-metadata/lib/common/FourCC.d.ts +1 -1
  34. package/node_modules/music-metadata/lib/common/FourCC.js +11 -10
  35. package/node_modules/music-metadata/lib/common/GenericTagMapper.d.ts +13 -13
  36. package/node_modules/music-metadata/lib/common/GenericTagMapper.js +12 -7
  37. package/node_modules/music-metadata/lib/common/GenericTagTypes.d.ts +6 -7
  38. package/node_modules/music-metadata/lib/common/GenericTagTypes.js +85 -86
  39. package/node_modules/music-metadata/lib/common/MetadataCollector.d.ts +10 -20
  40. package/node_modules/music-metadata/lib/common/MetadataCollector.js +69 -100
  41. package/node_modules/music-metadata/lib/common/RandomFileReader.d.ts +22 -0
  42. package/node_modules/music-metadata/lib/common/RandomFileReader.js +34 -0
  43. package/node_modules/music-metadata/lib/common/RandomUint8ArrayReader.d.ts +18 -0
  44. package/node_modules/music-metadata/lib/common/RandomUint8ArrayReader.js +25 -0
  45. package/node_modules/music-metadata/lib/common/Util.d.ts +12 -11
  46. package/node_modules/music-metadata/lib/common/Util.js +53 -47
  47. package/node_modules/music-metadata/lib/core.d.ts +15 -42
  48. package/node_modules/music-metadata/lib/core.js +38 -74
  49. package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.d.ts +1 -16
  50. package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.js +44 -55
  51. package/node_modules/music-metadata/lib/dsdiff/DsdiffToken.d.ts +3 -3
  52. package/node_modules/music-metadata/lib/dsdiff/DsdiffToken.js +7 -4
  53. package/node_modules/music-metadata/lib/dsf/DsfChunk.d.ts +10 -11
  54. package/node_modules/music-metadata/lib/dsf/DsfChunk.js +19 -15
  55. package/node_modules/music-metadata/lib/dsf/DsfParser.d.ts +1 -16
  56. package/node_modules/music-metadata/lib/dsf/DsfParser.js +20 -21
  57. package/node_modules/music-metadata/lib/flac/FlacParser.d.ts +15 -16
  58. package/node_modules/music-metadata/lib/flac/FlacParser.js +119 -69
  59. package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.d.ts +3 -7
  60. package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.js +36 -39
  61. package/node_modules/music-metadata/lib/id3v1/ID3v1TagMap.d.ts +1 -1
  62. package/node_modules/music-metadata/lib/id3v1/ID3v1TagMap.js +7 -2
  63. package/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.d.ts +2 -2
  64. package/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js +19 -15
  65. package/node_modules/music-metadata/lib/id3v2/FrameParser.d.ts +3 -64
  66. package/node_modules/music-metadata/lib/id3v2/FrameParser.js +103 -244
  67. package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.d.ts +2 -2
  68. package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.js +16 -6
  69. package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.d.ts +5 -5
  70. package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.js +35 -36
  71. package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.d.ts +6 -11
  72. package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.js +104 -91
  73. package/node_modules/music-metadata/lib/id3v2/ID3v2Token.d.ts +29 -67
  74. package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +36 -76
  75. package/node_modules/music-metadata/lib/iff/index.d.ts +1 -1
  76. package/node_modules/music-metadata/lib/iff/index.js +7 -4
  77. package/node_modules/music-metadata/lib/index.d.ts +31 -8
  78. package/node_modules/music-metadata/lib/index.js +53 -32
  79. package/node_modules/music-metadata/lib/lyrics3/Lyrics3.d.ts +2 -2
  80. package/node_modules/music-metadata/lib/lyrics3/Lyrics3.js +13 -13
  81. package/node_modules/music-metadata/lib/matroska/MatroskaDtd.d.ts +2 -2
  82. package/node_modules/music-metadata/lib/matroska/MatroskaDtd.js +242 -246
  83. package/node_modules/music-metadata/lib/matroska/MatroskaParser.d.ts +24 -6
  84. package/node_modules/music-metadata/lib/matroska/MatroskaParser.js +218 -124
  85. package/node_modules/music-metadata/lib/matroska/MatroskaTagMapper.d.ts +1 -1
  86. package/node_modules/music-metadata/lib/matroska/MatroskaTagMapper.js +7 -3
  87. package/node_modules/music-metadata/lib/matroska/types.d.ts +76 -43
  88. package/node_modules/music-metadata/lib/matroska/types.js +33 -27
  89. package/node_modules/music-metadata/lib/mp4/Atom.d.ts +7 -7
  90. package/node_modules/music-metadata/lib/mp4/Atom.js +22 -15
  91. package/node_modules/music-metadata/lib/mp4/AtomToken.d.ts +18 -110
  92. package/node_modules/music-metadata/lib/mp4/AtomToken.js +66 -184
  93. package/node_modules/music-metadata/lib/mp4/MP4Parser.d.ts +4 -6
  94. package/node_modules/music-metadata/lib/mp4/MP4Parser.js +128 -255
  95. package/node_modules/music-metadata/lib/mp4/MP4TagMapper.d.ts +4 -4
  96. package/node_modules/music-metadata/lib/mp4/MP4TagMapper.js +12 -8
  97. package/node_modules/music-metadata/lib/mpeg/ExtendedLameHeader.d.ts +5 -5
  98. package/node_modules/music-metadata/lib/mpeg/ExtendedLameHeader.js +10 -7
  99. package/node_modules/music-metadata/lib/mpeg/MpegParser.d.ts +4 -17
  100. package/node_modules/music-metadata/lib/mpeg/MpegParser.js +131 -176
  101. package/node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.d.ts +14 -16
  102. package/node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.js +19 -14
  103. package/node_modules/music-metadata/lib/mpeg/XingTag.d.ts +7 -6
  104. package/node_modules/music-metadata/lib/mpeg/XingTag.js +18 -14
  105. package/node_modules/music-metadata/lib/musepack/index.d.ts +5 -0
  106. package/node_modules/music-metadata/lib/musepack/index.js +32 -0
  107. package/node_modules/music-metadata/lib/musepack/sv7/BitReader.d.ts +2 -2
  108. package/node_modules/music-metadata/lib/musepack/sv7/BitReader.js +24 -16
  109. package/node_modules/music-metadata/lib/musepack/sv7/MpcSv7Parser.d.ts +1 -1
  110. package/node_modules/music-metadata/lib/musepack/sv7/MpcSv7Parser.js +15 -16
  111. package/node_modules/music-metadata/lib/musepack/sv7/StreamVersion7.d.ts +1 -1
  112. package/node_modules/music-metadata/lib/musepack/sv7/StreamVersion7.js +7 -5
  113. package/node_modules/music-metadata/lib/musepack/sv8/MpcSv8Parser.d.ts +1 -1
  114. package/node_modules/music-metadata/lib/musepack/sv8/MpcSv8Parser.js +17 -18
  115. package/node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.d.ts +3 -5
  116. package/node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.js +12 -14
  117. package/node_modules/music-metadata/lib/ogg/{OggToken.d.ts → Ogg.d.ts} +6 -17
  118. package/node_modules/music-metadata/lib/ogg/Ogg.js +2 -0
  119. package/node_modules/music-metadata/lib/ogg/OggParser.d.ts +12 -16
  120. package/node_modules/music-metadata/lib/ogg/OggParser.js +102 -101
  121. package/node_modules/music-metadata/lib/ogg/opus/Opus.d.ts +2 -17
  122. package/node_modules/music-metadata/lib/ogg/opus/Opus.js +14 -13
  123. package/node_modules/music-metadata/lib/ogg/opus/OpusParser.d.ts +25 -0
  124. package/node_modules/music-metadata/lib/ogg/opus/{OpusStream.js → OpusParser.js} +18 -18
  125. package/node_modules/music-metadata/lib/ogg/speex/Speex.d.ts +1 -1
  126. package/node_modules/music-metadata/lib/ogg/speex/Speex.js +19 -16
  127. package/node_modules/music-metadata/lib/ogg/speex/SpeexParser.d.ts +22 -0
  128. package/node_modules/music-metadata/lib/ogg/speex/{SpeexStream.js → SpeexParser.js} +13 -9
  129. package/node_modules/music-metadata/lib/ogg/theora/Theora.d.ts +1 -1
  130. package/node_modules/music-metadata/lib/ogg/theora/Theora.js +11 -8
  131. package/node_modules/music-metadata/lib/ogg/theora/TheoraParser.d.ts +28 -0
  132. package/node_modules/music-metadata/lib/ogg/theora/TheoraParser.js +44 -0
  133. package/node_modules/music-metadata/lib/ogg/vorbis/Vorbis.d.ts +7 -6
  134. package/node_modules/music-metadata/lib/ogg/vorbis/Vorbis.js +29 -34
  135. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.d.ts +1 -1
  136. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.js +9 -6
  137. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisParser.d.ts +36 -0
  138. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisParser.js +128 -0
  139. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.d.ts +3 -3
  140. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.js +9 -5
  141. package/node_modules/music-metadata/lib/riff/RiffChunk.d.ts +5 -5
  142. package/node_modules/music-metadata/lib/riff/RiffChunk.js +9 -5
  143. package/node_modules/music-metadata/lib/riff/RiffInfoTagMap.d.ts +2 -2
  144. package/node_modules/music-metadata/lib/riff/RiffInfoTagMap.js +25 -20
  145. package/node_modules/music-metadata/lib/type.d.ts +52 -121
  146. package/node_modules/music-metadata/lib/type.js +6 -2
  147. package/node_modules/music-metadata/lib/wav/BwfChunk.d.ts +1 -1
  148. package/node_modules/music-metadata/lib/wav/BwfChunk.js +11 -8
  149. package/node_modules/music-metadata/lib/wav/WaveChunk.d.ts +20 -50
  150. package/node_modules/music-metadata/lib/wav/WaveChunk.js +32 -45
  151. package/node_modules/music-metadata/lib/wav/WaveParser.d.ts +2 -2
  152. package/node_modules/music-metadata/lib/wav/WaveParser.js +39 -46
  153. package/node_modules/music-metadata/lib/wavpack/WavPackParser.d.ts +2 -18
  154. package/node_modules/music-metadata/lib/wavpack/WavPackParser.js +32 -42
  155. package/node_modules/music-metadata/lib/wavpack/WavPackToken.d.ts +18 -14
  156. package/node_modules/music-metadata/lib/wavpack/WavPackToken.js +30 -24
  157. package/node_modules/music-metadata/package.json +74 -81
  158. package/node_modules/{music-metadata/node_modules/strtok3/LICENSE.txt → turndown-plugin-gfm/LICENSE} +21 -21
  159. package/node_modules/turndown-plugin-gfm/README.md +50 -0
  160. package/node_modules/turndown-plugin-gfm/dist/turndown-plugin-gfm.js +165 -0
  161. package/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.browser.cjs.js +162 -0
  162. package/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.browser.es.js +154 -0
  163. package/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.cjs.js +162 -0
  164. package/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.es.js +154 -0
  165. package/node_modules/turndown-plugin-gfm/package.json +43 -0
  166. package/package.json +5 -5
  167. package/node_modules/@borewit/text-codec/LICENSE.txt +0 -9
  168. package/node_modules/@borewit/text-codec/README.md +0 -87
  169. package/node_modules/@borewit/text-codec/lib/index.d.ts +0 -6
  170. package/node_modules/@borewit/text-codec/lib/index.js +0 -380
  171. package/node_modules/@borewit/text-codec/package.json +0 -70
  172. package/node_modules/music-metadata/lib/ParseError.d.ts +0 -87
  173. package/node_modules/music-metadata/lib/ParseError.js +0 -38
  174. package/node_modules/music-metadata/lib/aiff/AiffLoader.d.ts +0 -2
  175. package/node_modules/music-metadata/lib/aiff/AiffLoader.js +0 -8
  176. package/node_modules/music-metadata/lib/apev2/Apev2Loader.d.ts +0 -2
  177. package/node_modules/music-metadata/lib/apev2/Apev2Loader.js +0 -8
  178. package/node_modules/music-metadata/lib/asf/AsfGuid.d.ts +0 -83
  179. package/node_modules/music-metadata/lib/asf/AsfGuid.js +0 -109
  180. package/node_modules/music-metadata/lib/asf/AsfLoader.d.ts +0 -2
  181. package/node_modules/music-metadata/lib/asf/AsfLoader.js +0 -8
  182. package/node_modules/music-metadata/lib/dsdiff/DsdiffLoader.d.ts +0 -2
  183. package/node_modules/music-metadata/lib/dsdiff/DsdiffLoader.js +0 -8
  184. package/node_modules/music-metadata/lib/dsf/DsfLoader.d.ts +0 -2
  185. package/node_modules/music-metadata/lib/dsf/DsfLoader.js +0 -8
  186. package/node_modules/music-metadata/lib/ebml/EbmlIterator.d.ts +0 -67
  187. package/node_modules/music-metadata/lib/ebml/EbmlIterator.js +0 -218
  188. package/node_modules/music-metadata/lib/ebml/types.d.ts +0 -37
  189. package/node_modules/music-metadata/lib/ebml/types.js +0 -8
  190. package/node_modules/music-metadata/lib/flac/FlacLoader.d.ts +0 -2
  191. package/node_modules/music-metadata/lib/flac/FlacLoader.js +0 -8
  192. package/node_modules/music-metadata/lib/flac/FlacToken.d.ts +0 -45
  193. package/node_modules/music-metadata/lib/flac/FlacToken.js +0 -63
  194. package/node_modules/music-metadata/lib/id3v2/FrameHeader.d.ts +0 -31
  195. package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +0 -73
  196. package/node_modules/music-metadata/lib/id3v2/ID3v2ChapterToken.d.ts +0 -11
  197. package/node_modules/music-metadata/lib/id3v2/ID3v2ChapterToken.js +0 -17
  198. package/node_modules/music-metadata/lib/lrc/LyricsParser.d.ts +0 -9
  199. package/node_modules/music-metadata/lib/lrc/LyricsParser.js +0 -45
  200. package/node_modules/music-metadata/lib/matroska/MatroskaLoader.d.ts +0 -2
  201. package/node_modules/music-metadata/lib/matroska/MatroskaLoader.js +0 -8
  202. package/node_modules/music-metadata/lib/mp4/Mp4Loader.d.ts +0 -2
  203. package/node_modules/music-metadata/lib/mp4/Mp4Loader.js +0 -8
  204. package/node_modules/music-metadata/lib/mpeg/MpegLoader.d.ts +0 -2
  205. package/node_modules/music-metadata/lib/mpeg/MpegLoader.js +0 -8
  206. package/node_modules/music-metadata/lib/musepack/MusepackConentError.d.ts +0 -15
  207. package/node_modules/music-metadata/lib/musepack/MusepackConentError.js +0 -3
  208. package/node_modules/music-metadata/lib/musepack/MusepackLoader.d.ts +0 -2
  209. package/node_modules/music-metadata/lib/musepack/MusepackLoader.js +0 -8
  210. package/node_modules/music-metadata/lib/musepack/MusepackParser.d.ts +0 -4
  211. package/node_modules/music-metadata/lib/musepack/MusepackParser.js +0 -30
  212. package/node_modules/music-metadata/lib/ogg/OggLoader.d.ts +0 -2
  213. package/node_modules/music-metadata/lib/ogg/OggLoader.js +0 -8
  214. package/node_modules/music-metadata/lib/ogg/OggToken.js +0 -41
  215. package/node_modules/music-metadata/lib/ogg/flac/FlacStream.d.ts +0 -29
  216. package/node_modules/music-metadata/lib/ogg/flac/FlacStream.js +0 -74
  217. package/node_modules/music-metadata/lib/ogg/opus/OpusStream.d.ts +0 -24
  218. package/node_modules/music-metadata/lib/ogg/speex/SpeexStream.d.ts +0 -20
  219. package/node_modules/music-metadata/lib/ogg/theora/TheoraStream.d.ts +0 -25
  220. package/node_modules/music-metadata/lib/ogg/theora/TheoraStream.js +0 -39
  221. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.d.ts +0 -53
  222. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.js +0 -136
  223. package/node_modules/music-metadata/lib/wav/WaveLoader.d.ts +0 -2
  224. package/node_modules/music-metadata/lib/wav/WaveLoader.js +0 -8
  225. package/node_modules/music-metadata/lib/wavpack/WavPackLoader.d.ts +0 -2
  226. package/node_modules/music-metadata/lib/wavpack/WavPackLoader.js +0 -8
  227. package/node_modules/music-metadata/node_modules/file-type/core.d.ts +0 -253
  228. package/node_modules/music-metadata/node_modules/file-type/core.js +0 -2899
  229. package/node_modules/music-metadata/node_modules/file-type/index.d.ts +0 -98
  230. package/node_modules/music-metadata/node_modules/file-type/index.js +0 -163
  231. package/node_modules/music-metadata/node_modules/file-type/license +0 -9
  232. package/node_modules/music-metadata/node_modules/file-type/package.json +0 -290
  233. package/node_modules/music-metadata/node_modules/file-type/readme.md +0 -667
  234. package/node_modules/music-metadata/node_modules/file-type/supported.js +0 -360
  235. package/node_modules/music-metadata/node_modules/file-type/util.js +0 -60
  236. package/node_modules/music-metadata/node_modules/strtok3/README.md +0 -399
  237. package/node_modules/music-metadata/node_modules/strtok3/lib/AbstractTokenizer.d.ts +0 -76
  238. package/node_modules/music-metadata/node_modules/strtok3/lib/AbstractTokenizer.js +0 -111
  239. package/node_modules/music-metadata/node_modules/strtok3/lib/BlobTokenizer.d.ts +0 -29
  240. package/node_modules/music-metadata/node_modules/strtok3/lib/BlobTokenizer.js +0 -53
  241. package/node_modules/music-metadata/node_modules/strtok3/lib/BufferTokenizer.d.ts +0 -29
  242. package/node_modules/music-metadata/node_modules/strtok3/lib/BufferTokenizer.js +0 -52
  243. package/node_modules/music-metadata/node_modules/strtok3/lib/FileTokenizer.d.ts +0 -37
  244. package/node_modules/music-metadata/node_modules/strtok3/lib/FileTokenizer.js +0 -61
  245. package/node_modules/music-metadata/node_modules/strtok3/lib/ReadStreamTokenizer.d.ts +0 -34
  246. package/node_modules/music-metadata/node_modules/strtok3/lib/ReadStreamTokenizer.js +0 -107
  247. package/node_modules/music-metadata/node_modules/strtok3/lib/core.d.ts +0 -40
  248. package/node_modules/music-metadata/node_modules/strtok3/lib/core.js +0 -62
  249. package/node_modules/music-metadata/node_modules/strtok3/lib/index.d.ts +0 -16
  250. package/node_modules/music-metadata/node_modules/strtok3/lib/index.js +0 -22
  251. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/AbstractStreamReader.d.ts +0 -54
  252. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/AbstractStreamReader.js +0 -71
  253. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Deferred.d.ts +0 -6
  254. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Deferred.js +0 -10
  255. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Errors.d.ts +0 -10
  256. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Errors.js +0 -16
  257. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/StreamReader.d.ts +0 -29
  258. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/StreamReader.js +0 -83
  259. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamByobReader.d.ts +0 -14
  260. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamByobReader.js +0 -27
  261. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamDefaultReader.d.ts +0 -19
  262. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamDefaultReader.js +0 -62
  263. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReader.d.ts +0 -14
  264. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReader.js +0 -13
  265. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReaderFactory.d.ts +0 -5
  266. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReaderFactory.js +0 -19
  267. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/index.d.ts +0 -6
  268. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/index.js +0 -5
  269. package/node_modules/music-metadata/node_modules/strtok3/lib/types.d.ts +0 -139
  270. package/node_modules/music-metadata/node_modules/strtok3/lib/types.js +0 -1
  271. package/node_modules/music-metadata/node_modules/strtok3/package.json +0 -94
  272. package/node_modules/music-metadata/node_modules/token-types/LICENSE.txt +0 -9
  273. package/node_modules/music-metadata/node_modules/token-types/README.md +0 -120
  274. package/node_modules/music-metadata/node_modules/token-types/lib/index.d.ts +0 -135
  275. package/node_modules/music-metadata/node_modules/token-types/lib/index.js +0 -401
  276. package/node_modules/music-metadata/node_modules/token-types/package.json +0 -81
  277. package/node_modules/sprintf-js/.npmignore +0 -1
  278. package/node_modules/sprintf-js/LICENSE +0 -24
  279. package/node_modules/sprintf-js/README.md +0 -88
  280. package/node_modules/sprintf-js/bower.json +0 -14
  281. package/node_modules/sprintf-js/demo/angular.html +0 -20
  282. package/node_modules/sprintf-js/dist/angular-sprintf.min.js +0 -4
  283. package/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +0 -1
  284. package/node_modules/sprintf-js/dist/angular-sprintf.min.map +0 -1
  285. package/node_modules/sprintf-js/dist/sprintf.min.js +0 -4
  286. package/node_modules/sprintf-js/dist/sprintf.min.js.map +0 -1
  287. package/node_modules/sprintf-js/dist/sprintf.min.map +0 -1
  288. package/node_modules/sprintf-js/gruntfile.js +0 -36
  289. package/node_modules/sprintf-js/package.json +0 -22
  290. package/node_modules/sprintf-js/src/angular-sprintf.js +0 -18
  291. package/node_modules/sprintf-js/src/sprintf.js +0 -208
  292. package/node_modules/sprintf-js/test/test.js +0 -82
  293. package/node_modules/uint8array-extras/index.d.ts +0 -331
  294. package/node_modules/uint8array-extras/index.js +0 -318
  295. package/node_modules/uint8array-extras/license +0 -9
  296. package/node_modules/uint8array-extras/package.json +0 -54
  297. package/node_modules/uint8array-extras/readme.md +0 -318
  298. package/node_modules/win-guid/LICENSE.txt +0 -9
  299. package/node_modules/win-guid/README.md +0 -113
  300. package/node_modules/win-guid/lib/guid.d.ts +0 -20
  301. package/node_modules/win-guid/lib/guid.js +0 -107
  302. package/node_modules/win-guid/package.json +0 -55
  303. /package/node_modules/{argparse → mammoth/node_modules/argparse}/LICENSE +0 -0
  304. /package/node_modules/{argparse → mammoth/node_modules/argparse}/README.md +0 -0
  305. /package/node_modules/{argparse → mammoth/node_modules/argparse}/index.js +0 -0
  306. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/append/constant.js +0 -0
  307. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/append.js +0 -0
  308. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/count.js +0 -0
  309. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/help.js +0 -0
  310. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/store/constant.js +0 -0
  311. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/store/false.js +0 -0
  312. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/store/true.js +0 -0
  313. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/store.js +0 -0
  314. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/subparsers.js +0 -0
  315. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/version.js +0 -0
  316. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action.js +0 -0
  317. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action_container.js +0 -0
  318. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argparse.js +0 -0
  319. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argument/error.js +0 -0
  320. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argument/exclusive.js +0 -0
  321. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argument/group.js +0 -0
  322. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argument_parser.js +0 -0
  323. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/const.js +0 -0
  324. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/help/added_formatters.js +0 -0
  325. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/help/formatter.js +0 -0
  326. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/namespace.js +0 -0
  327. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/utils.js +0 -0
  328. /package/node_modules/{argparse → mammoth/node_modules/argparse}/package.json +0 -0
@@ -1,45 +1,32 @@
1
- /**
2
- * Primary entry point, Node.js specific entry point is MusepackParser.ts
3
- */
4
- import { type AnyWebByteStream, type IFileInfo, type ITokenizer, type IRandomAccessTokenizer } from 'strtok3';
5
- import type { IAudioMetadata, INativeTagDict, IOptions, IPicture, IPrivateOptions, ITag } from './type.js';
6
- import type { Readable } from 'node:stream';
7
- export type { IFileInfo } from 'strtok3';
8
- export { type IAudioMetadata, type IOptions, type ITag, type INativeTagDict, type ICommonTagsResult, type IFormat, type IPicture, type IRatio, type IChapter, type ILyricsTag, LyricsContentType, TimestampFormat, IMetadataEventTag, IMetadataEvent } from './type.js';
9
- export { CouldNotDetermineFileTypeError, UnsupportedFileTypeError } from './ParseError.js';
10
- export * from './ParseError.js';
11
- /**
12
- * Parse Web API File
13
- * Requires Blob to be able to stream using a ReadableStreamBYOBReader, only available since Node.js ≥ 20
14
- * @param blob - Blob to parse
15
- * @param options - Parsing options
16
- * @returns Metadata
17
- */
18
- export declare function parseBlob(blob: Blob, options?: IOptions): Promise<IAudioMetadata>;
19
- /**
20
- * Parse audio from Web Stream.Readable
21
- * @param webStream - WebStream to read the audio track from
1
+ /// <reference types="node" />
2
+ import { Readable } from 'stream';
3
+ import * as strtok3 from 'strtok3/lib/core';
4
+ import { IAudioMetadata, INativeTagDict, IOptions, IPicture, IPrivateOptions, IRandomReader, ITag } from './type';
5
+ export { IFileInfo } from 'strtok3/lib/core';
6
+ /**
7
+ * Parse audio from Node Stream.Readable
8
+ * @param stream - Stream to read the audio track from
22
9
  * @param options - Parsing options
23
10
  * @param fileInfo - File information object or MIME-type string
24
11
  * @returns Metadata
25
12
  */
26
- export declare function parseWebStream(webStream: AnyWebByteStream, fileInfo?: IFileInfo | string, options?: IOptions): Promise<IAudioMetadata>;
13
+ export declare function parseStream(stream: Readable, fileInfo?: strtok3.IFileInfo | string, options?: IOptions): Promise<IAudioMetadata>;
27
14
  /**
28
- * Parse audio from memory
15
+ * Parse audio from Node Buffer
29
16
  * @param uint8Array - Uint8Array holding audio data
30
17
  * @param fileInfo - File information object or MIME-type string
31
18
  * @param options - Parsing options
32
19
  * @returns Metadata
33
20
  * Ref: https://github.com/Borewit/strtok3/blob/e6938c81ff685074d5eb3064a11c0b03ca934c1d/src/index.ts#L15
34
21
  */
35
- export declare function parseBuffer(uint8Array: Uint8Array, fileInfo?: IFileInfo | string, options?: IOptions): Promise<IAudioMetadata>;
22
+ export declare function parseBuffer(uint8Array: Uint8Array, fileInfo?: strtok3.IFileInfo | string, options?: IOptions): Promise<IAudioMetadata>;
36
23
  /**
37
24
  * Parse audio from ITokenizer source
38
25
  * @param tokenizer - Audio source implementing the tokenizer interface
39
26
  * @param options - Parsing options
40
27
  * @returns Metadata
41
28
  */
42
- export declare function parseFromTokenizer(tokenizer: ITokenizer, options?: IOptions): Promise<IAudioMetadata>;
29
+ export declare function parseFromTokenizer(tokenizer: strtok3.ITokenizer, options?: IOptions): Promise<IAudioMetadata>;
43
30
  /**
44
31
  * Create a dictionary ordered by their tag id (key)
45
32
  * @param nativeTags list of tags
@@ -48,28 +35,14 @@ export declare function parseFromTokenizer(tokenizer: ITokenizer, options?: IOpt
48
35
  export declare function orderTags(nativeTags: ITag[]): INativeTagDict;
49
36
  /**
50
37
  * Convert rating to 1-5 star rating
51
- * @param rating Normalized rating [0..1] (common.rating[n].rating)
38
+ * @param rating: Normalized rating [0..1] (common.rating[n].rating)
52
39
  * @returns Number of stars: 1, 2, 3, 4 or 5 stars
53
40
  */
54
- export declare function ratingToStars(rating: number | undefined): number;
41
+ export declare function ratingToStars(rating: number): number;
55
42
  /**
56
43
  * Select most likely cover image.
57
44
  * @param pictures Usually metadata.common.picture
58
45
  * @return Cover image, if any, otherwise null
59
46
  */
60
47
  export declare function selectCover(pictures?: IPicture[]): IPicture | null;
61
- export declare function scanAppendingHeaders(tokenizer: IRandomAccessTokenizer, options?: IPrivateOptions): Promise<void>;
62
- /**
63
- * Implementation only available when loaded as Node.js
64
- * This method will throw an Error, always.
65
- */
66
- export declare function parseFile(_filePath: string, _options?: IOptions): Promise<IAudioMetadata>;
67
- /**
68
- * Implementation only available when loaded as Node.js
69
- * This method will throw an Error, always.
70
- */
71
- export declare function parseStream(_stream: Readable, _fileInfo?: IFileInfo | string, _options?: IOptions): Promise<IAudioMetadata>;
72
- /**
73
- * Return a list of supported mime-types
74
- */
75
- export declare function getSupportedMimeTypes(): string[];
48
+ export declare function scanAppendingHeaders(randomReader: IRandomReader, options?: IPrivateOptions): Promise<void>;
@@ -1,126 +1,90 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.scanAppendingHeaders = exports.selectCover = exports.ratingToStars = exports.orderTags = exports.parseFromTokenizer = exports.parseBuffer = exports.parseStream = void 0;
4
+ const strtok3 = require("strtok3/lib/core");
5
+ const ParserFactory_1 = require("./ParserFactory");
6
+ const RandomUint8ArrayReader_1 = require("./common/RandomUint8ArrayReader");
7
+ const APEv2Parser_1 = require("./apev2/APEv2Parser");
8
+ const ID3v1Parser_1 = require("./id3v1/ID3v1Parser");
9
+ const Lyrics3_1 = require("./lyrics3/Lyrics3");
1
10
  /**
2
- * Primary entry point, Node.js specific entry point is MusepackParser.ts
3
- */
4
- import { fromWebStream, fromBuffer, fromBlob } from 'strtok3';
5
- import { ParserFactory } from './ParserFactory.js';
6
- import { APEv2Parser } from './apev2/APEv2Parser.js';
7
- import { hasID3v1Header } from './id3v1/ID3v1Parser.js';
8
- import { getLyricsHeaderLength } from './lyrics3/Lyrics3.js';
9
- export { LyricsContentType, TimestampFormat } from './type.js';
10
- export { CouldNotDetermineFileTypeError, UnsupportedFileTypeError } from './ParseError.js';
11
- export * from './ParseError.js';
12
- /**
13
- * Parse Web API File
14
- * Requires Blob to be able to stream using a ReadableStreamBYOBReader, only available since Node.js ≥ 20
15
- * @param blob - Blob to parse
16
- * @param options - Parsing options
17
- * @returns Metadata
18
- */
19
- export async function parseBlob(blob, options = {}) {
20
- const tokenizer = fromBlob(blob);
21
- try {
22
- return await parseFromTokenizer(tokenizer, options);
23
- }
24
- finally {
25
- await tokenizer.close();
26
- }
27
- }
28
- /**
29
- * Parse audio from Web Stream.Readable
30
- * @param webStream - WebStream to read the audio track from
11
+ * Parse audio from Node Stream.Readable
12
+ * @param stream - Stream to read the audio track from
31
13
  * @param options - Parsing options
32
14
  * @param fileInfo - File information object or MIME-type string
33
15
  * @returns Metadata
34
16
  */
35
- export async function parseWebStream(webStream, fileInfo, options = {}) {
36
- const tokenizer = fromWebStream(webStream, { fileInfo: typeof fileInfo === 'string' ? { mimeType: fileInfo } : fileInfo });
37
- try {
38
- return await parseFromTokenizer(tokenizer, options);
39
- }
40
- finally {
41
- await tokenizer.close();
42
- }
17
+ function parseStream(stream, fileInfo, options = {}) {
18
+ return parseFromTokenizer(strtok3.fromStream(stream, typeof fileInfo === 'string' ? { mimeType: fileInfo } : fileInfo), options);
43
19
  }
20
+ exports.parseStream = parseStream;
44
21
  /**
45
- * Parse audio from memory
22
+ * Parse audio from Node Buffer
46
23
  * @param uint8Array - Uint8Array holding audio data
47
24
  * @param fileInfo - File information object or MIME-type string
48
25
  * @param options - Parsing options
49
26
  * @returns Metadata
50
27
  * Ref: https://github.com/Borewit/strtok3/blob/e6938c81ff685074d5eb3064a11c0b03ca934c1d/src/index.ts#L15
51
28
  */
52
- export async function parseBuffer(uint8Array, fileInfo, options = {}) {
53
- const tokenizer = fromBuffer(uint8Array, { fileInfo: typeof fileInfo === 'string' ? { mimeType: fileInfo } : fileInfo });
29
+ async function parseBuffer(uint8Array, fileInfo, options = {}) {
30
+ const bufferReader = new RandomUint8ArrayReader_1.RandomUint8ArrayReader(uint8Array);
31
+ await scanAppendingHeaders(bufferReader, options);
32
+ const tokenizer = strtok3.fromBuffer(uint8Array, typeof fileInfo === 'string' ? { mimeType: fileInfo } : fileInfo);
54
33
  return parseFromTokenizer(tokenizer, options);
55
34
  }
35
+ exports.parseBuffer = parseBuffer;
56
36
  /**
57
37
  * Parse audio from ITokenizer source
58
38
  * @param tokenizer - Audio source implementing the tokenizer interface
59
39
  * @param options - Parsing options
60
40
  * @returns Metadata
61
41
  */
62
- export function parseFromTokenizer(tokenizer, options) {
63
- const parserFactory = new ParserFactory();
64
- return parserFactory.parse(tokenizer, undefined, options);
42
+ function parseFromTokenizer(tokenizer, options) {
43
+ return ParserFactory_1.ParserFactory.parseOnContentType(tokenizer, options);
65
44
  }
45
+ exports.parseFromTokenizer = parseFromTokenizer;
66
46
  /**
67
47
  * Create a dictionary ordered by their tag id (key)
68
48
  * @param nativeTags list of tags
69
49
  * @returns tags indexed by id
70
50
  */
71
- export function orderTags(nativeTags) {
51
+ function orderTags(nativeTags) {
72
52
  const tags = {};
73
- for (const { id, value } of nativeTags) {
74
- (tags[id] || (tags[id] = [])).push(value);
53
+ for (const tag of nativeTags) {
54
+ (tags[tag.id] = (tags[tag.id] || [])).push(tag.value);
75
55
  }
76
56
  return tags;
77
57
  }
58
+ exports.orderTags = orderTags;
78
59
  /**
79
60
  * Convert rating to 1-5 star rating
80
- * @param rating Normalized rating [0..1] (common.rating[n].rating)
61
+ * @param rating: Normalized rating [0..1] (common.rating[n].rating)
81
62
  * @returns Number of stars: 1, 2, 3, 4 or 5 stars
82
63
  */
83
- export function ratingToStars(rating) {
64
+ function ratingToStars(rating) {
84
65
  return rating === undefined ? 0 : 1 + Math.round(rating * 4);
85
66
  }
67
+ exports.ratingToStars = ratingToStars;
86
68
  /**
87
69
  * Select most likely cover image.
88
70
  * @param pictures Usually metadata.common.picture
89
71
  * @return Cover image, if any, otherwise null
90
72
  */
91
- export function selectCover(pictures) {
73
+ function selectCover(pictures) {
92
74
  return pictures ? pictures.reduce((acc, cur) => {
93
75
  if (cur.name && cur.name.toLowerCase() in ['front', 'cover', 'cover (front)'])
94
76
  return cur;
95
77
  return acc;
96
78
  }) : null;
97
79
  }
98
- export async function scanAppendingHeaders(tokenizer, options = {}) {
99
- let apeOffset = tokenizer.fileInfo.size;
100
- if (await hasID3v1Header(tokenizer)) {
80
+ exports.selectCover = selectCover;
81
+ async function scanAppendingHeaders(randomReader, options = {}) {
82
+ let apeOffset = randomReader.fileSize;
83
+ if (await (0, ID3v1Parser_1.hasID3v1Header)(randomReader)) {
101
84
  apeOffset -= 128;
102
- const lyricsLen = await getLyricsHeaderLength(tokenizer);
85
+ const lyricsLen = await (0, Lyrics3_1.getLyricsHeaderLength)(randomReader);
103
86
  apeOffset -= lyricsLen;
104
87
  }
105
- options.apeHeader = await APEv2Parser.findApeFooterOffset(tokenizer, apeOffset);
106
- }
107
- /**
108
- * Implementation only available when loaded as Node.js
109
- * This method will throw an Error, always.
110
- */
111
- export async function parseFile(_filePath, _options = {}) {
112
- throw new Error('This function require a Node engine. To load Web API File objects use parseBlob instead.');
113
- }
114
- /**
115
- * Implementation only available when loaded as Node.js
116
- * This method will throw an Error, always.
117
- */
118
- export async function parseStream(_stream, _fileInfo, _options = {}) {
119
- throw new Error('This function require a Node engine.');
120
- }
121
- /**
122
- * Return a list of supported mime-types
123
- */
124
- export function getSupportedMimeTypes() {
125
- return new ParserFactory().getSupportedMimeTypes();
88
+ options.apeHeader = await APEv2Parser_1.APEv2Parser.findApeFooterOffset(randomReader, apeOffset);
126
89
  }
90
+ exports.scanAppendingHeaders = scanAppendingHeaders;
@@ -1,18 +1,4 @@
1
- import { BasicParser } from '../common/BasicParser.js';
2
- declare const DsdiffContentParseError_base: {
3
- new (message: string): {
4
- readonly fileType: string;
5
- toString(): string;
6
- name: "UnexpectedFileContentError";
7
- message: string;
8
- stack?: string;
9
- };
10
- captureStackTrace(targetObject: object, constructorOpt?: Function): void;
11
- prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
12
- stackTraceLimit: number;
13
- };
14
- export declare class DsdiffContentParseError extends DsdiffContentParseError_base {
15
- }
1
+ import { BasicParser } from '../common/BasicParser';
16
2
  /**
17
3
  * DSDIFF - Direct Stream Digital Interchange File Format (Phillips)
18
4
  *
@@ -26,4 +12,3 @@ export declare class DsdiffParser extends BasicParser {
26
12
  private handleSoundPropertyChunks;
27
13
  private handleChannelChunks;
28
14
  }
29
- export {};
@@ -1,78 +1,70 @@
1
- import * as Token from 'token-types';
2
- import initDebug from 'debug';
3
- import * as strtok3 from 'strtok3';
4
- import { FourCcToken } from '../common/FourCC.js';
5
- import { BasicParser } from '../common/BasicParser.js';
6
- import { ID3v2Parser } from '../id3v2/ID3v2Parser.js';
7
- import { ChunkHeader64 } from './DsdiffToken.js';
8
- import { makeUnexpectedFileContentError } from '../ParseError.js';
9
- const debug = initDebug('music-metadata:parser:aiff');
10
- export class DsdiffContentParseError extends makeUnexpectedFileContentError('DSDIFF') {
11
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DsdiffParser = void 0;
4
+ const Token = require("token-types");
5
+ const debug_1 = require("debug");
6
+ const strtok3 = require("strtok3/lib/core");
7
+ const FourCC_1 = require("../common/FourCC");
8
+ const BasicParser_1 = require("../common/BasicParser");
9
+ const ID3v2Parser_1 = require("../id3v2/ID3v2Parser");
10
+ const DsdiffToken_1 = require("./DsdiffToken");
11
+ const debug = (0, debug_1.default)('music-metadata:parser:aiff');
12
12
  /**
13
13
  * DSDIFF - Direct Stream Digital Interchange File Format (Phillips)
14
14
  *
15
15
  * Ref:
16
16
  * - http://www.sonicstudio.com/pdf/dsd/DSDIFF_1.5_Spec.pdf
17
17
  */
18
- export class DsdiffParser extends BasicParser {
18
+ class DsdiffParser extends BasicParser_1.BasicParser {
19
19
  async parse() {
20
- const header = await this.tokenizer.readToken(ChunkHeader64);
20
+ const header = await this.tokenizer.readToken(DsdiffToken_1.ChunkHeader64);
21
21
  if (header.chunkID !== 'FRM8')
22
- throw new DsdiffContentParseError('Unexpected chunk-ID');
23
- this.metadata.setAudioOnly();
24
- const type = (await this.tokenizer.readToken(FourCcToken)).trim();
22
+ throw new Error('Unexpected chunk-ID');
23
+ const type = (await this.tokenizer.readToken(FourCC_1.FourCcToken)).trim();
25
24
  switch (type) {
26
25
  case 'DSD':
27
26
  this.metadata.setFormat('container', `DSDIFF/${type}`);
28
27
  this.metadata.setFormat('lossless', true);
29
- return this.readFmt8Chunks(header.chunkSize - BigInt(FourCcToken.len));
28
+ return this.readFmt8Chunks(header.chunkSize - BigInt(FourCC_1.FourCcToken.len));
30
29
  default:
31
- throw new DsdiffContentParseError(`Unsupported DSDIFF type: ${type}`);
30
+ throw Error(`Unsupported DSDIFF type: ${type}`);
32
31
  }
33
32
  }
34
33
  async readFmt8Chunks(remainingSize) {
35
- while (remainingSize >= ChunkHeader64.len) {
36
- const chunkHeader = await this.tokenizer.readToken(ChunkHeader64);
34
+ while (remainingSize >= DsdiffToken_1.ChunkHeader64.len) {
35
+ const chunkHeader = await this.tokenizer.readToken(DsdiffToken_1.ChunkHeader64);
37
36
  // If the data is an odd number of bytes in length, a pad byte must be added at the end
38
37
  debug(`Chunk id=${chunkHeader.chunkID}`);
39
38
  await this.readData(chunkHeader);
40
- remainingSize -= (BigInt(ChunkHeader64.len) + chunkHeader.chunkSize);
39
+ remainingSize -= (BigInt(DsdiffToken_1.ChunkHeader64.len) + chunkHeader.chunkSize);
41
40
  }
42
41
  }
43
42
  async readData(header) {
44
43
  debug(`Reading data of chunk[ID=${header.chunkID}, size=${header.chunkSize}]`);
45
44
  const p0 = this.tokenizer.position;
46
45
  switch (header.chunkID.trim()) {
47
- case 'FVER': { // 3.1 FORMAT VERSION CHUNK
46
+ case 'FVER': // 3.1 FORMAT VERSION CHUNK
48
47
  const version = await this.tokenizer.readToken(Token.UINT32_LE);
49
48
  debug(`DSDIFF version=${version}`);
50
49
  break;
51
- }
52
- case 'PROP': { // 3.2 PROPERTY CHUNK
53
- const propType = await this.tokenizer.readToken(FourCcToken);
50
+ case 'PROP': // 3.2 PROPERTY CHUNK
51
+ const propType = await this.tokenizer.readToken(FourCC_1.FourCcToken);
54
52
  if (propType !== 'SND ')
55
- throw new DsdiffContentParseError('Unexpected PROP-chunk ID');
56
- await this.handleSoundPropertyChunks(header.chunkSize - BigInt(FourCcToken.len));
53
+ throw new Error('Unexpected PROP-chunk ID');
54
+ await this.handleSoundPropertyChunks(header.chunkSize - BigInt(FourCC_1.FourCcToken.len));
57
55
  break;
58
- }
59
- case 'ID3': { // Unofficial ID3 tag support
56
+ case 'ID3': // Unofficial ID3 tag support
60
57
  const id3_data = await this.tokenizer.readToken(new Token.Uint8ArrayType(Number(header.chunkSize)));
61
58
  const rst = strtok3.fromBuffer(id3_data);
62
- await new ID3v2Parser().parse(this.metadata, rst, this.options);
63
- break;
64
- }
65
- case 'DSD':
66
- if (this.metadata.format.numberOfChannels) {
67
- this.metadata.setFormat('numberOfSamples', Number(header.chunkSize * BigInt(8) / BigInt(this.metadata.format.numberOfChannels)));
68
- }
69
- if (this.metadata.format.numberOfSamples && this.metadata.format.sampleRate) {
70
- this.metadata.setFormat('duration', this.metadata.format.numberOfSamples / this.metadata.format.sampleRate);
71
- }
59
+ await new ID3v2Parser_1.ID3v2Parser().parse(this.metadata, rst, this.options);
72
60
  break;
73
61
  default:
74
62
  debug(`Ignore chunk[ID=${header.chunkID}, size=${header.chunkSize}]`);
75
63
  break;
64
+ case 'DSD':
65
+ this.metadata.setFormat('numberOfSamples', Number(header.chunkSize * BigInt(8) / BigInt(this.metadata.format.numberOfChannels)));
66
+ this.metadata.setFormat('duration', this.metadata.format.numberOfSamples / this.metadata.format.sampleRate);
67
+ break;
76
68
  }
77
69
  const remaining = header.chunkSize - BigInt(this.tokenizer.position - p0);
78
70
  if (remaining > 0) {
@@ -83,23 +75,21 @@ export class DsdiffParser extends BasicParser {
83
75
  async handleSoundPropertyChunks(remainingSize) {
84
76
  debug(`Parsing sound-property-chunks, remainingSize=${remainingSize}`);
85
77
  while (remainingSize > 0) {
86
- const sndPropHeader = await this.tokenizer.readToken(ChunkHeader64);
78
+ const sndPropHeader = await this.tokenizer.readToken(DsdiffToken_1.ChunkHeader64);
87
79
  debug(`Sound-property-chunk[ID=${sndPropHeader.chunkID}, size=${sndPropHeader.chunkSize}]`);
88
80
  const p0 = this.tokenizer.position;
89
81
  switch (sndPropHeader.chunkID.trim()) {
90
- case 'FS': { // 3.2.1 Sample Rate Chunk
82
+ case 'FS': // 3.2.1 Sample Rate Chunk
91
83
  const sampleRate = await this.tokenizer.readToken(Token.UINT32_BE);
92
84
  this.metadata.setFormat('sampleRate', sampleRate);
93
85
  break;
94
- }
95
- case 'CHNL': { // 3.2.2 Channels Chunk
86
+ case 'CHNL': // 3.2.2 Channels Chunk
96
87
  const numChannels = await this.tokenizer.readToken(Token.UINT16_BE);
97
88
  this.metadata.setFormat('numberOfChannels', numChannels);
98
89
  await this.handleChannelChunks(sndPropHeader.chunkSize - BigInt(Token.UINT16_BE.len));
99
90
  break;
100
- }
101
- case 'CMPR': { // 3.2.3 Compression Type Chunk
102
- const compressionIdCode = (await this.tokenizer.readToken(FourCcToken)).trim();
91
+ case 'CMPR': // 3.2.3 Compression Type Chunk
92
+ const compressionIdCode = (await this.tokenizer.readToken(FourCC_1.FourCcToken)).trim();
103
93
  const count = await this.tokenizer.readToken(Token.UINT8);
104
94
  const compressionName = await this.tokenizer.readToken(new Token.StringType(count, 'ascii'));
105
95
  if (compressionIdCode === 'DSD') {
@@ -108,20 +98,18 @@ export class DsdiffParser extends BasicParser {
108
98
  }
109
99
  this.metadata.setFormat('codec', `${compressionIdCode} (${compressionName})`);
110
100
  break;
111
- }
112
- case 'ABSS': { // 3.2.4 Absolute Start Time Chunk
101
+ case 'ABSS': // 3.2.4 Absolute Start Time Chunk
113
102
  const hours = await this.tokenizer.readToken(Token.UINT16_BE);
114
103
  const minutes = await this.tokenizer.readToken(Token.UINT8);
115
104
  const seconds = await this.tokenizer.readToken(Token.UINT8);
116
105
  const samples = await this.tokenizer.readToken(Token.UINT32_BE);
117
106
  debug(`ABSS ${hours}:${minutes}:${seconds}.${samples}`);
118
107
  break;
119
- }
120
- case 'LSCO': { // 3.2.5 Loudspeaker Configuration Chunk
108
+ case 'LSCO': // 3.2.5 Loudspeaker Configuration Chunk
121
109
  const lsConfig = await this.tokenizer.readToken(Token.UINT16_BE);
122
110
  debug(`LSCO lsConfig=${lsConfig}`);
123
111
  break;
124
- }
112
+ case 'COMT':
125
113
  default:
126
114
  debug(`Unknown sound-property-chunk[ID=${sndPropHeader.chunkID}, size=${sndPropHeader.chunkSize}]`);
127
115
  await this.tokenizer.ignore(Number(sndPropHeader.chunkSize));
@@ -131,7 +119,7 @@ export class DsdiffParser extends BasicParser {
131
119
  debug(`After Parsing sound-property-chunk ${sndPropHeader.chunkSize}, remaining ${remaining} bytes`);
132
120
  await this.tokenizer.ignore(Number(remaining));
133
121
  }
134
- remainingSize -= BigInt(ChunkHeader64.len) + sndPropHeader.chunkSize;
122
+ remainingSize -= BigInt(DsdiffToken_1.ChunkHeader64.len) + sndPropHeader.chunkSize;
135
123
  debug(`Parsing sound-property-chunks, remainingSize=${remainingSize}`);
136
124
  }
137
125
  if (this.metadata.format.lossless && this.metadata.format.sampleRate && this.metadata.format.numberOfChannels && this.metadata.format.bitsPerSample) {
@@ -142,13 +130,14 @@ export class DsdiffParser extends BasicParser {
142
130
  async handleChannelChunks(remainingSize) {
143
131
  debug(`Parsing channel-chunks, remainingSize=${remainingSize}`);
144
132
  const channels = [];
145
- while (remainingSize >= FourCcToken.len) {
146
- const channelId = await this.tokenizer.readToken(FourCcToken);
133
+ while (remainingSize >= FourCC_1.FourCcToken.len) {
134
+ const channelId = await this.tokenizer.readToken(FourCC_1.FourCcToken);
147
135
  debug(`Channel[ID=${channelId}]`);
148
136
  channels.push(channelId);
149
- remainingSize -= BigInt(FourCcToken.len);
137
+ remainingSize -= BigInt(FourCC_1.FourCcToken.len);
150
138
  }
151
139
  debug(`Channels: ${channels.join(', ')}`);
152
140
  return channels;
153
141
  }
154
142
  }
143
+ exports.DsdiffParser = DsdiffParser;
@@ -1,6 +1,6 @@
1
- import type { IGetToken } from 'strtok3';
2
- import type { IChunkHeader64 } from '../iff/index.js';
3
- export type { IChunkHeader64 } from '../iff/index.js';
1
+ import { IGetToken } from 'strtok3/lib/core';
2
+ import { IChunkHeader64 } from '../iff';
3
+ export { IChunkHeader64 } from '../iff';
4
4
  /**
5
5
  * DSDIFF chunk header
6
6
  * The data-size encoding is deviating from EA-IFF 85
@@ -1,16 +1,19 @@
1
- import * as Token from 'token-types';
2
- import { FourCcToken } from '../common/FourCC.js';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChunkHeader64 = void 0;
4
+ const Token = require("token-types");
5
+ const FourCC_1 = require("../common/FourCC");
3
6
  /**
4
7
  * DSDIFF chunk header
5
8
  * The data-size encoding is deviating from EA-IFF 85
6
9
  * Ref: http://www.sonicstudio.com/pdf/dsd/DSDIFF_1.5_Spec.pdf
7
10
  */
8
- export const ChunkHeader64 = {
11
+ exports.ChunkHeader64 = {
9
12
  len: 12,
10
13
  get: (buf, off) => {
11
14
  return {
12
15
  // Group-ID
13
- chunkID: FourCcToken.get(buf, off),
16
+ chunkID: FourCC_1.FourCcToken.get(buf, off),
14
17
  // Size
15
18
  chunkSize: Token.INT64_BE.get(buf, off + 4)
16
19
  };
@@ -1,4 +1,4 @@
1
- import type { IGetToken } from 'strtok3';
1
+ import { IGetToken } from 'strtok3/lib/core';
2
2
  /**
3
3
  * Common interface for the common chunk DSD header
4
4
  */
@@ -34,16 +34,15 @@ export interface IDsdChunk {
34
34
  * Common chunk DSD header: the 'chunk name (Four-CC)' & chunk size
35
35
  */
36
36
  export declare const DsdChunk: IGetToken<IDsdChunk>;
37
- export declare const ChannelType: {
38
- mono: number;
39
- stereo: number;
40
- channels: number;
41
- quad: number;
42
- '4 channels': number;
43
- '5 channels': number;
44
- '5.1 channels': number;
45
- };
46
- export type ChannelType = typeof ChannelType[keyof typeof ChannelType];
37
+ export declare enum ChannelType {
38
+ mono = 1,
39
+ stereo = 2,
40
+ channels = 3,
41
+ quad = 4,
42
+ '4 channels' = 5,
43
+ '5 channels' = 6,
44
+ '5.1 channels' = 7
45
+ }
47
46
  /**
48
47
  * Interface to format chunk payload chunk
49
48
  */
@@ -1,18 +1,21 @@
1
- import * as Token from 'token-types';
2
- import { FourCcToken } from '../common/FourCC.js';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormatChunk = exports.ChannelType = exports.DsdChunk = exports.ChunkHeader = void 0;
4
+ const Token = require("token-types");
5
+ const FourCC_1 = require("../common/FourCC");
3
6
  /**
4
7
  * Common chunk DSD header: the 'chunk name (Four-CC)' & chunk size
5
8
  */
6
- export const ChunkHeader = {
9
+ exports.ChunkHeader = {
7
10
  len: 12,
8
11
  get: (buf, off) => {
9
- return { id: FourCcToken.get(buf, off), size: Token.UINT64_LE.get(buf, off + 4) };
12
+ return { id: FourCC_1.FourCcToken.get(buf, off), size: Token.UINT64_LE.get(buf, off + 4) };
10
13
  }
11
14
  };
12
15
  /**
13
16
  * Common chunk DSD header: the 'chunk name (Four-CC)' & chunk size
14
17
  */
15
- export const DsdChunk = {
18
+ exports.DsdChunk = {
16
19
  len: 16,
17
20
  get: (buf, off) => {
18
21
  return {
@@ -21,19 +24,20 @@ export const DsdChunk = {
21
24
  };
22
25
  }
23
26
  };
24
- export const ChannelType = {
25
- mono: 1,
26
- stereo: 2,
27
- channels: 3,
28
- quad: 4,
29
- '4 channels': 5,
30
- '5 channels': 6,
31
- '5.1 channels': 7
32
- };
27
+ var ChannelType;
28
+ (function (ChannelType) {
29
+ ChannelType[ChannelType["mono"] = 1] = "mono";
30
+ ChannelType[ChannelType["stereo"] = 2] = "stereo";
31
+ ChannelType[ChannelType["channels"] = 3] = "channels";
32
+ ChannelType[ChannelType["quad"] = 4] = "quad";
33
+ ChannelType[ChannelType["4 channels"] = 5] = "4 channels";
34
+ ChannelType[ChannelType["5 channels"] = 6] = "5 channels";
35
+ ChannelType[ChannelType["5.1 channels"] = 7] = "5.1 channels";
36
+ })(ChannelType = exports.ChannelType || (exports.ChannelType = {}));
33
37
  /**
34
38
  * Common chunk DSD header: the 'chunk name (Four-CC)' & chunk size
35
39
  */
36
- export const FormatChunk = {
40
+ exports.FormatChunk = {
37
41
  len: 40,
38
42
  get: (buf, off) => {
39
43
  return {
@@ -1,18 +1,4 @@
1
- import { AbstractID3Parser } from '../id3v2/AbstractID3Parser.js';
2
- declare const DsdContentParseError_base: {
3
- new (message: string): {
4
- readonly fileType: string;
5
- toString(): string;
6
- name: "UnexpectedFileContentError";
7
- message: string;
8
- stack?: string;
9
- };
10
- captureStackTrace(targetObject: object, constructorOpt?: Function): void;
11
- prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
12
- stackTraceLimit: number;
13
- };
14
- export declare class DsdContentParseError extends DsdContentParseError_base {
15
- }
1
+ import { AbstractID3Parser } from '../id3v2/AbstractID3Parser';
16
2
  /**
17
3
  * DSF (dsd stream file) File Parser
18
4
  * Ref: https://dsd-guide.com/sites/default/files/white-papers/DSFFileFormatSpec_E.pdf
@@ -21,4 +7,3 @@ export declare class DsfParser extends AbstractID3Parser {
21
7
  postId3v2Parse(): Promise<void>;
22
8
  private parseChunks;
23
9
  }
24
- export {};