@jadujoel/web-audio-clip-node 0.1.2 → 0.1.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.
Files changed (310) hide show
  1. package/dist/audio/processor-code.d.ts +1 -1
  2. package/dist/audio/processor-code.js +1 -1
  3. package/dist/audio/processor-kernel.js +20 -6
  4. package/dist/audio/version.d.ts +1 -1
  5. package/dist/audio/version.js +1 -1
  6. package/dist/lib.bundle.js +3 -3
  7. package/dist/lib.bundle.js.map +3 -3
  8. package/dist/processor.js +2 -2
  9. package/dist/processor.js.map +3 -3
  10. package/examples/cdn-vanilla/README.md +1 -1
  11. package/examples/cdn-vanilla/index.html +2 -14
  12. package/examples/esm-bundler/README.md +3 -4
  13. package/examples/esm-bundler/bun.lock +15 -0
  14. package/examples/esm-bundler/index.html +1 -1
  15. package/examples/esm-bundler/{src/main.ts → main.ts} +2 -4
  16. package/examples/esm-bundler/package.json +3 -6
  17. package/package.json +1 -1
  18. package/examples/esm-bundler/node_modules/.package-lock.json +0 -1168
  19. package/examples/esm-bundler/node_modules/@esbuild/darwin-arm64/README.md +0 -3
  20. package/examples/esm-bundler/node_modules/@esbuild/darwin-arm64/bin/esbuild +0 -0
  21. package/examples/esm-bundler/node_modules/@esbuild/darwin-arm64/package.json +0 -20
  22. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/LICENSE +0 -21
  23. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/README.md +0 -91
  24. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/audio/ClipNode.d.ts +0 -86
  25. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/audio/ClipNode.js +0 -312
  26. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/audio/processor-code.d.ts +0 -1
  27. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/audio/processor-code.js +0 -2
  28. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/audio/processor-kernel.d.ts +0 -43
  29. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/audio/processor-kernel.js +0 -861
  30. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/audio/processor.d.ts +0 -1
  31. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/audio/processor.js +0 -80
  32. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/audio/types.d.ts +0 -192
  33. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/audio/types.js +0 -9
  34. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/audio/utils.d.ts +0 -22
  35. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/audio/utils.js +0 -128
  36. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/audio/version.d.ts +0 -1
  37. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/audio/version.js +0 -2
  38. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/audio/workletUrl.d.ts +0 -6
  39. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/audio/workletUrl.js +0 -17
  40. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/AudioControl.d.ts +0 -28
  41. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/AudioControl.js +0 -99
  42. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/ContextMenu.d.ts +0 -17
  43. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/ContextMenu.js +0 -73
  44. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/ControlSection.d.ts +0 -26
  45. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/ControlSection.js +0 -74
  46. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/DetuneControl.d.ts +0 -10
  47. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/DetuneControl.js +0 -44
  48. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/DisplayPanel.d.ts +0 -14
  49. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/DisplayPanel.js +0 -6
  50. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/FilterControl.d.ts +0 -12
  51. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/FilterControl.js +0 -48
  52. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/GainControl.d.ts +0 -10
  53. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/GainControl.js +0 -44
  54. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/PanControl.d.ts +0 -10
  55. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/PanControl.js +0 -50
  56. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/PlaybackRateControl.d.ts +0 -10
  57. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/PlaybackRateControl.js +0 -44
  58. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/PlayheadSlider.d.ts +0 -13
  59. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/PlayheadSlider.js +0 -20
  60. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/SnappableSlider.d.ts +0 -18
  61. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/SnappableSlider.js +0 -174
  62. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/TransportButtons.d.ts +0 -14
  63. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/components/TransportButtons.js +0 -9
  64. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/controls/controlDefs.d.ts +0 -31
  65. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/controls/controlDefs.js +0 -211
  66. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/controls/formatValueText.d.ts +0 -2
  67. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/controls/formatValueText.js +0 -80
  68. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/controls/linkedControlPairs.d.ts +0 -20
  69. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/controls/linkedControlPairs.js +0 -51
  70. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/data/cache.d.ts +0 -1
  71. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/data/cache.js +0 -17
  72. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/data/fileStore.d.ts +0 -6
  73. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/data/fileStore.js +0 -39
  74. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/hooks/useClipNode.d.ts +0 -31
  75. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/hooks/useClipNode.js +0 -338
  76. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/lib-react.d.ts +0 -15
  77. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/lib-react.js +0 -17
  78. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/lib.d.ts +0 -16
  79. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/lib.js +0 -16
  80. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/processor.js +0 -4
  81. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/processor.js.map +0 -12
  82. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/store/clipStore.d.ts +0 -63
  83. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/store/clipStore.js +0 -71
  84. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/dist/styles.css +0 -739
  85. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/examples/README.md +0 -10
  86. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/examples/cdn-vanilla/README.md +0 -13
  87. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/examples/cdn-vanilla/index.html +0 -61
  88. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/examples/esm-bundler/README.md +0 -8
  89. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/examples/esm-bundler/index.html +0 -12
  90. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/examples/esm-bundler/package.json +0 -15
  91. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/examples/esm-bundler/src/main.ts +0 -43
  92. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/examples/react/README.md +0 -10
  93. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/examples/react/index.html +0 -12
  94. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/examples/react/package.json +0 -21
  95. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/examples/react/src/App.tsx +0 -20
  96. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/examples/react/src/main.tsx +0 -9
  97. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/examples/react/vite.config.ts +0 -6
  98. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/examples/self-hosted/README.md +0 -11
  99. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/examples/self-hosted/index.html +0 -12
  100. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/examples/self-hosted/package.json +0 -16
  101. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/examples/self-hosted/public/.gitkeep +0 -1
  102. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/examples/self-hosted/src/main.ts +0 -46
  103. package/examples/esm-bundler/node_modules/@jadujoel/web-audio-clip-node/package.json +0 -88
  104. package/examples/esm-bundler/node_modules/@rollup/rollup-darwin-arm64/README.md +0 -3
  105. package/examples/esm-bundler/node_modules/@rollup/rollup-darwin-arm64/package.json +0 -22
  106. package/examples/esm-bundler/node_modules/@rollup/rollup-darwin-arm64/rollup.darwin-arm64.node +0 -0
  107. package/examples/esm-bundler/node_modules/@types/estree/LICENSE +0 -21
  108. package/examples/esm-bundler/node_modules/@types/estree/README.md +0 -15
  109. package/examples/esm-bundler/node_modules/@types/estree/flow.d.ts +0 -167
  110. package/examples/esm-bundler/node_modules/@types/estree/index.d.ts +0 -694
  111. package/examples/esm-bundler/node_modules/@types/estree/package.json +0 -27
  112. package/examples/esm-bundler/node_modules/esbuild/LICENSE.md +0 -21
  113. package/examples/esm-bundler/node_modules/esbuild/README.md +0 -3
  114. package/examples/esm-bundler/node_modules/esbuild/bin/esbuild +0 -0
  115. package/examples/esm-bundler/node_modules/esbuild/install.js +0 -289
  116. package/examples/esm-bundler/node_modules/esbuild/lib/main.d.ts +0 -716
  117. package/examples/esm-bundler/node_modules/esbuild/lib/main.js +0 -2242
  118. package/examples/esm-bundler/node_modules/esbuild/package.json +0 -49
  119. package/examples/esm-bundler/node_modules/fdir/LICENSE +0 -7
  120. package/examples/esm-bundler/node_modules/fdir/README.md +0 -91
  121. package/examples/esm-bundler/node_modules/fdir/dist/index.cjs +0 -588
  122. package/examples/esm-bundler/node_modules/fdir/dist/index.d.cts +0 -155
  123. package/examples/esm-bundler/node_modules/fdir/dist/index.d.mts +0 -155
  124. package/examples/esm-bundler/node_modules/fdir/dist/index.mjs +0 -570
  125. package/examples/esm-bundler/node_modules/fdir/package.json +0 -103
  126. package/examples/esm-bundler/node_modules/nanoid/LICENSE +0 -20
  127. package/examples/esm-bundler/node_modules/nanoid/README.md +0 -39
  128. package/examples/esm-bundler/node_modules/nanoid/async/index.browser.cjs +0 -69
  129. package/examples/esm-bundler/node_modules/nanoid/async/index.browser.js +0 -34
  130. package/examples/esm-bundler/node_modules/nanoid/async/index.cjs +0 -71
  131. package/examples/esm-bundler/node_modules/nanoid/async/index.d.ts +0 -56
  132. package/examples/esm-bundler/node_modules/nanoid/async/index.js +0 -35
  133. package/examples/esm-bundler/node_modules/nanoid/async/index.native.js +0 -26
  134. package/examples/esm-bundler/node_modules/nanoid/async/package.json +0 -12
  135. package/examples/esm-bundler/node_modules/nanoid/bin/nanoid.cjs +0 -55
  136. package/examples/esm-bundler/node_modules/nanoid/index.browser.cjs +0 -72
  137. package/examples/esm-bundler/node_modules/nanoid/index.browser.js +0 -34
  138. package/examples/esm-bundler/node_modules/nanoid/index.cjs +0 -85
  139. package/examples/esm-bundler/node_modules/nanoid/index.d.cts +0 -91
  140. package/examples/esm-bundler/node_modules/nanoid/index.d.ts +0 -91
  141. package/examples/esm-bundler/node_modules/nanoid/index.js +0 -45
  142. package/examples/esm-bundler/node_modules/nanoid/nanoid.js +0 -1
  143. package/examples/esm-bundler/node_modules/nanoid/non-secure/index.cjs +0 -34
  144. package/examples/esm-bundler/node_modules/nanoid/non-secure/index.d.ts +0 -33
  145. package/examples/esm-bundler/node_modules/nanoid/non-secure/index.js +0 -21
  146. package/examples/esm-bundler/node_modules/nanoid/non-secure/package.json +0 -6
  147. package/examples/esm-bundler/node_modules/nanoid/package.json +0 -89
  148. package/examples/esm-bundler/node_modules/nanoid/url-alphabet/index.cjs +0 -7
  149. package/examples/esm-bundler/node_modules/nanoid/url-alphabet/index.js +0 -3
  150. package/examples/esm-bundler/node_modules/nanoid/url-alphabet/package.json +0 -6
  151. package/examples/esm-bundler/node_modules/picocolors/LICENSE +0 -15
  152. package/examples/esm-bundler/node_modules/picocolors/README.md +0 -21
  153. package/examples/esm-bundler/node_modules/picocolors/package.json +0 -25
  154. package/examples/esm-bundler/node_modules/picocolors/picocolors.browser.js +0 -4
  155. package/examples/esm-bundler/node_modules/picocolors/picocolors.d.ts +0 -5
  156. package/examples/esm-bundler/node_modules/picocolors/picocolors.js +0 -75
  157. package/examples/esm-bundler/node_modules/picocolors/types.d.ts +0 -51
  158. package/examples/esm-bundler/node_modules/picomatch/LICENSE +0 -21
  159. package/examples/esm-bundler/node_modules/picomatch/README.md +0 -749
  160. package/examples/esm-bundler/node_modules/picomatch/index.js +0 -17
  161. package/examples/esm-bundler/node_modules/picomatch/lib/constants.js +0 -184
  162. package/examples/esm-bundler/node_modules/picomatch/lib/parse.js +0 -1386
  163. package/examples/esm-bundler/node_modules/picomatch/lib/picomatch.js +0 -349
  164. package/examples/esm-bundler/node_modules/picomatch/lib/scan.js +0 -391
  165. package/examples/esm-bundler/node_modules/picomatch/lib/utils.js +0 -72
  166. package/examples/esm-bundler/node_modules/picomatch/package.json +0 -82
  167. package/examples/esm-bundler/node_modules/picomatch/posix.js +0 -3
  168. package/examples/esm-bundler/node_modules/postcss/LICENSE +0 -20
  169. package/examples/esm-bundler/node_modules/postcss/README.md +0 -28
  170. package/examples/esm-bundler/node_modules/postcss/lib/at-rule.d.ts +0 -139
  171. package/examples/esm-bundler/node_modules/postcss/lib/at-rule.js +0 -25
  172. package/examples/esm-bundler/node_modules/postcss/lib/comment.d.ts +0 -67
  173. package/examples/esm-bundler/node_modules/postcss/lib/comment.js +0 -13
  174. package/examples/esm-bundler/node_modules/postcss/lib/container.d.ts +0 -478
  175. package/examples/esm-bundler/node_modules/postcss/lib/container.js +0 -447
  176. package/examples/esm-bundler/node_modules/postcss/lib/css-syntax-error.d.ts +0 -247
  177. package/examples/esm-bundler/node_modules/postcss/lib/css-syntax-error.js +0 -133
  178. package/examples/esm-bundler/node_modules/postcss/lib/declaration.d.ts +0 -150
  179. package/examples/esm-bundler/node_modules/postcss/lib/declaration.js +0 -24
  180. package/examples/esm-bundler/node_modules/postcss/lib/document.d.ts +0 -68
  181. package/examples/esm-bundler/node_modules/postcss/lib/document.js +0 -33
  182. package/examples/esm-bundler/node_modules/postcss/lib/fromJSON.d.ts +0 -9
  183. package/examples/esm-bundler/node_modules/postcss/lib/fromJSON.js +0 -54
  184. package/examples/esm-bundler/node_modules/postcss/lib/input.d.ts +0 -226
  185. package/examples/esm-bundler/node_modules/postcss/lib/input.js +0 -273
  186. package/examples/esm-bundler/node_modules/postcss/lib/lazy-result.d.ts +0 -189
  187. package/examples/esm-bundler/node_modules/postcss/lib/lazy-result.js +0 -550
  188. package/examples/esm-bundler/node_modules/postcss/lib/list.d.ts +0 -60
  189. package/examples/esm-bundler/node_modules/postcss/lib/list.js +0 -58
  190. package/examples/esm-bundler/node_modules/postcss/lib/map-generator.js +0 -376
  191. package/examples/esm-bundler/node_modules/postcss/lib/no-work-result.d.ts +0 -45
  192. package/examples/esm-bundler/node_modules/postcss/lib/no-work-result.js +0 -137
  193. package/examples/esm-bundler/node_modules/postcss/lib/node.d.ts +0 -555
  194. package/examples/esm-bundler/node_modules/postcss/lib/node.js +0 -449
  195. package/examples/esm-bundler/node_modules/postcss/lib/parse.d.ts +0 -9
  196. package/examples/esm-bundler/node_modules/postcss/lib/parse.js +0 -42
  197. package/examples/esm-bundler/node_modules/postcss/lib/parser.js +0 -611
  198. package/examples/esm-bundler/node_modules/postcss/lib/postcss.d.mts +0 -66
  199. package/examples/esm-bundler/node_modules/postcss/lib/postcss.d.ts +0 -456
  200. package/examples/esm-bundler/node_modules/postcss/lib/postcss.js +0 -101
  201. package/examples/esm-bundler/node_modules/postcss/lib/postcss.mjs +0 -30
  202. package/examples/esm-bundler/node_modules/postcss/lib/previous-map.d.ts +0 -80
  203. package/examples/esm-bundler/node_modules/postcss/lib/previous-map.js +0 -145
  204. package/examples/esm-bundler/node_modules/postcss/lib/processor.d.ts +0 -114
  205. package/examples/esm-bundler/node_modules/postcss/lib/processor.js +0 -67
  206. package/examples/esm-bundler/node_modules/postcss/lib/result.d.ts +0 -204
  207. package/examples/esm-bundler/node_modules/postcss/lib/result.js +0 -42
  208. package/examples/esm-bundler/node_modules/postcss/lib/root.d.ts +0 -86
  209. package/examples/esm-bundler/node_modules/postcss/lib/root.js +0 -61
  210. package/examples/esm-bundler/node_modules/postcss/lib/rule.d.ts +0 -126
  211. package/examples/esm-bundler/node_modules/postcss/lib/rule.js +0 -27
  212. package/examples/esm-bundler/node_modules/postcss/lib/stringifier.d.ts +0 -45
  213. package/examples/esm-bundler/node_modules/postcss/lib/stringifier.js +0 -353
  214. package/examples/esm-bundler/node_modules/postcss/lib/stringify.d.ts +0 -9
  215. package/examples/esm-bundler/node_modules/postcss/lib/stringify.js +0 -11
  216. package/examples/esm-bundler/node_modules/postcss/lib/symbols.js +0 -5
  217. package/examples/esm-bundler/node_modules/postcss/lib/terminal-highlight.js +0 -70
  218. package/examples/esm-bundler/node_modules/postcss/lib/tokenize.js +0 -266
  219. package/examples/esm-bundler/node_modules/postcss/lib/warn-once.js +0 -13
  220. package/examples/esm-bundler/node_modules/postcss/lib/warning.d.ts +0 -146
  221. package/examples/esm-bundler/node_modules/postcss/lib/warning.js +0 -37
  222. package/examples/esm-bundler/node_modules/postcss/package.json +0 -88
  223. package/examples/esm-bundler/node_modules/rollup/LICENSE.md +0 -679
  224. package/examples/esm-bundler/node_modules/rollup/README.md +0 -134
  225. package/examples/esm-bundler/node_modules/rollup/dist/bin/rollup +0 -1912
  226. package/examples/esm-bundler/node_modules/rollup/dist/es/getLogFilter.js +0 -64
  227. package/examples/esm-bundler/node_modules/rollup/dist/es/package.json +0 -1
  228. package/examples/esm-bundler/node_modules/rollup/dist/es/parseAst.js +0 -12
  229. package/examples/esm-bundler/node_modules/rollup/dist/es/rollup.js +0 -17
  230. package/examples/esm-bundler/node_modules/rollup/dist/es/shared/node-entry.js +0 -24463
  231. package/examples/esm-bundler/node_modules/rollup/dist/es/shared/parseAst.js +0 -2124
  232. package/examples/esm-bundler/node_modules/rollup/dist/es/shared/watch.js +0 -9909
  233. package/examples/esm-bundler/node_modules/rollup/dist/getLogFilter.d.ts +0 -5
  234. package/examples/esm-bundler/node_modules/rollup/dist/getLogFilter.js +0 -69
  235. package/examples/esm-bundler/node_modules/rollup/dist/loadConfigFile.d.ts +0 -20
  236. package/examples/esm-bundler/node_modules/rollup/dist/loadConfigFile.js +0 -29
  237. package/examples/esm-bundler/node_modules/rollup/dist/native.js +0 -161
  238. package/examples/esm-bundler/node_modules/rollup/dist/parseAst.d.ts +0 -4
  239. package/examples/esm-bundler/node_modules/rollup/dist/parseAst.js +0 -22
  240. package/examples/esm-bundler/node_modules/rollup/dist/rollup.d.ts +0 -1225
  241. package/examples/esm-bundler/node_modules/rollup/dist/rollup.js +0 -127
  242. package/examples/esm-bundler/node_modules/rollup/dist/shared/fsevents-importer.js +0 -37
  243. package/examples/esm-bundler/node_modules/rollup/dist/shared/index.js +0 -9615
  244. package/examples/esm-bundler/node_modules/rollup/dist/shared/loadConfigFile.js +0 -572
  245. package/examples/esm-bundler/node_modules/rollup/dist/shared/parseAst.js +0 -2361
  246. package/examples/esm-bundler/node_modules/rollup/dist/shared/rollup.js +0 -24385
  247. package/examples/esm-bundler/node_modules/rollup/dist/shared/watch-cli.js +0 -542
  248. package/examples/esm-bundler/node_modules/rollup/dist/shared/watch.js +0 -324
  249. package/examples/esm-bundler/node_modules/rollup/package.json +0 -289
  250. package/examples/esm-bundler/node_modules/source-map-js/LICENSE +0 -28
  251. package/examples/esm-bundler/node_modules/source-map-js/README.md +0 -765
  252. package/examples/esm-bundler/node_modules/source-map-js/lib/array-set.js +0 -121
  253. package/examples/esm-bundler/node_modules/source-map-js/lib/base64-vlq.js +0 -140
  254. package/examples/esm-bundler/node_modules/source-map-js/lib/base64.js +0 -67
  255. package/examples/esm-bundler/node_modules/source-map-js/lib/binary-search.js +0 -111
  256. package/examples/esm-bundler/node_modules/source-map-js/lib/mapping-list.js +0 -79
  257. package/examples/esm-bundler/node_modules/source-map-js/lib/quick-sort.js +0 -132
  258. package/examples/esm-bundler/node_modules/source-map-js/lib/source-map-consumer.d.ts +0 -1
  259. package/examples/esm-bundler/node_modules/source-map-js/lib/source-map-consumer.js +0 -1188
  260. package/examples/esm-bundler/node_modules/source-map-js/lib/source-map-generator.d.ts +0 -1
  261. package/examples/esm-bundler/node_modules/source-map-js/lib/source-map-generator.js +0 -444
  262. package/examples/esm-bundler/node_modules/source-map-js/lib/source-node.d.ts +0 -1
  263. package/examples/esm-bundler/node_modules/source-map-js/lib/source-node.js +0 -413
  264. package/examples/esm-bundler/node_modules/source-map-js/lib/util.js +0 -594
  265. package/examples/esm-bundler/node_modules/source-map-js/package.json +0 -71
  266. package/examples/esm-bundler/node_modules/source-map-js/source-map.d.ts +0 -104
  267. package/examples/esm-bundler/node_modules/source-map-js/source-map.js +0 -8
  268. package/examples/esm-bundler/node_modules/tinyglobby/LICENSE +0 -21
  269. package/examples/esm-bundler/node_modules/tinyglobby/README.md +0 -25
  270. package/examples/esm-bundler/node_modules/tinyglobby/dist/index.cjs +0 -334
  271. package/examples/esm-bundler/node_modules/tinyglobby/dist/index.d.cts +0 -148
  272. package/examples/esm-bundler/node_modules/tinyglobby/dist/index.d.mts +0 -148
  273. package/examples/esm-bundler/node_modules/tinyglobby/dist/index.mjs +0 -306
  274. package/examples/esm-bundler/node_modules/tinyglobby/package.json +0 -73
  275. package/examples/esm-bundler/node_modules/vite/LICENSE.md +0 -2406
  276. package/examples/esm-bundler/node_modules/vite/README.md +0 -20
  277. package/examples/esm-bundler/node_modules/vite/bin/openChrome.applescript +0 -95
  278. package/examples/esm-bundler/node_modules/vite/bin/vite.js +0 -79
  279. package/examples/esm-bundler/node_modules/vite/client.d.ts +0 -279
  280. package/examples/esm-bundler/node_modules/vite/dist/client/client.mjs +0 -1134
  281. package/examples/esm-bundler/node_modules/vite/dist/client/env.mjs +0 -24
  282. package/examples/esm-bundler/node_modules/vite/dist/node/chunks/dep-3RmXg9uo.js +0 -553
  283. package/examples/esm-bundler/node_modules/vite/dist/node/chunks/dep-4-IQbZQm.js +0 -822
  284. package/examples/esm-bundler/node_modules/vite/dist/node/chunks/dep-CvfTChi5.js +0 -8218
  285. package/examples/esm-bundler/node_modules/vite/dist/node/chunks/dep-Dq2t6Dq0.js +0 -49565
  286. package/examples/esm-bundler/node_modules/vite/dist/node/chunks/dep-lpEPC2f9.js +0 -7113
  287. package/examples/esm-bundler/node_modules/vite/dist/node/cli.js +0 -949
  288. package/examples/esm-bundler/node_modules/vite/dist/node/constants.js +0 -149
  289. package/examples/esm-bundler/node_modules/vite/dist/node/index.d.ts +0 -4227
  290. package/examples/esm-bundler/node_modules/vite/dist/node/index.js +0 -194
  291. package/examples/esm-bundler/node_modules/vite/dist/node/module-runner.d.ts +0 -290
  292. package/examples/esm-bundler/node_modules/vite/dist/node/module-runner.js +0 -1311
  293. package/examples/esm-bundler/node_modules/vite/dist/node/moduleRunnerTransport.d-DJ_mE5sf.d.ts +0 -87
  294. package/examples/esm-bundler/node_modules/vite/dist/node-cjs/publicUtils.cjs +0 -3987
  295. package/examples/esm-bundler/node_modules/vite/index.cjs +0 -96
  296. package/examples/esm-bundler/node_modules/vite/index.d.cts +0 -6
  297. package/examples/esm-bundler/node_modules/vite/misc/false.js +0 -1
  298. package/examples/esm-bundler/node_modules/vite/misc/true.js +0 -1
  299. package/examples/esm-bundler/node_modules/vite/package.json +0 -204
  300. package/examples/esm-bundler/node_modules/vite/types/customEvent.d.ts +0 -45
  301. package/examples/esm-bundler/node_modules/vite/types/hmrPayload.d.ts +0 -74
  302. package/examples/esm-bundler/node_modules/vite/types/hot.d.ts +0 -39
  303. package/examples/esm-bundler/node_modules/vite/types/import-meta.d.ts +0 -5
  304. package/examples/esm-bundler/node_modules/vite/types/importGlob.d.ts +0 -75
  305. package/examples/esm-bundler/node_modules/vite/types/importMeta.d.ts +0 -31
  306. package/examples/esm-bundler/node_modules/vite/types/internal/cssPreprocessorOptions.d.ts +0 -63
  307. package/examples/esm-bundler/node_modules/vite/types/internal/lightningcssOptions.d.ts +0 -18
  308. package/examples/esm-bundler/node_modules/vite/types/metadata.d.ts +0 -35
  309. package/examples/esm-bundler/node_modules/vite/types/package.json +0 -4
  310. package/examples/esm-bundler/package-lock.json +0 -1127
@@ -1,765 +0,0 @@
1
- # Source Map JS
2
-
3
- [![NPM](https://nodei.co/npm/source-map-js.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/source-map-js)
4
-
5
- Difference between original [source-map](https://github.com/mozilla/source-map):
6
-
7
- > TL,DR: it's fork of original source-map@0.6, but with perfomance optimizations.
8
-
9
- This journey starts from [source-map@0.7.0](https://github.com/mozilla/source-map/blob/master/CHANGELOG.md#070). Some part of it was rewritten to Rust and WASM and API became async.
10
-
11
- It's still a major block for many libraries like PostCSS or Sass for example because they need to migrate the whole API to the async way. This is the reason why 0.6.1 has 2x more downloads than 0.7.3 while it's faster several times.
12
-
13
- ![Downloads count](media/downloads.png)
14
-
15
- More important that WASM version has some optimizations in JS code too. This is why [community asked to create branch for 0.6 version](https://github.com/mozilla/source-map/issues/324) and port these optimizations but, sadly, the answer was «no». A bit later I discovered [the issue](https://github.com/mozilla/source-map/issues/370) created by [Ben Rothman (@benthemonkey)](https://github.com/benthemonkey) with no response at all.
16
-
17
- [Roman Dvornov (@lahmatiy)](https://github.com/lahmatiy) wrote a [serveral posts](https://t.me/gorshochekvarit/76) (russian, only, sorry) about source-map library in his own Telegram channel. He mentioned the article [«Maybe you don't need Rust and WASM to speed up your JS»](https://mrale.ph/blog/2018/02/03/maybe-you-dont-need-rust-to-speed-up-your-js.html) written by [Vyacheslav Egorov (@mraleph)](https://github.com/mraleph). This article contains optimizations and hacks that lead to almost the same performance compare to WASM implementation.
18
-
19
- I decided to fork the original source-map and port these optimizations from the article and several others PR from the original source-map.
20
-
21
- ---------
22
-
23
- This is a library to generate and consume the source map format
24
- [described here][format].
25
-
26
- [format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
27
-
28
- ## Use with Node
29
-
30
- $ npm install source-map-js
31
-
32
- <!-- ## Use on the Web
33
-
34
- <script src="https://raw.githubusercontent.com/mozilla/source-map/master/dist/source-map.min.js" defer></script> -->
35
-
36
- --------------------------------------------------------------------------------
37
-
38
- <!-- `npm run toc` to regenerate the Table of Contents -->
39
-
40
- <!-- START doctoc generated TOC please keep comment here to allow auto update -->
41
- <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
42
- ## Table of Contents
43
-
44
- - [Examples](#examples)
45
- - [Consuming a source map](#consuming-a-source-map)
46
- - [Generating a source map](#generating-a-source-map)
47
- - [With SourceNode (high level API)](#with-sourcenode-high-level-api)
48
- - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api)
49
- - [API](#api)
50
- - [SourceMapConsumer](#sourcemapconsumer)
51
- - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap)
52
- - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans)
53
- - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition)
54
- - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition)
55
- - [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition)
56
- - [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources)
57
- - [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing)
58
- - [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order)
59
- - [SourceMapGenerator](#sourcemapgenerator)
60
- - [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap)
61
- - [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer)
62
- - [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping)
63
- - [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent)
64
- - [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath)
65
- - [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring)
66
- - [SourceNode](#sourcenode)
67
- - [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name)
68
- - [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath)
69
- - [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk)
70
- - [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk)
71
- - [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent)
72
- - [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn)
73
- - [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn)
74
- - [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep)
75
- - [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement)
76
- - [SourceNode.prototype.toString()](#sourcenodeprototypetostring)
77
- - [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap)
78
-
79
- <!-- END doctoc generated TOC please keep comment here to allow auto update -->
80
-
81
- ## Examples
82
-
83
- ### Consuming a source map
84
-
85
- ```js
86
- var rawSourceMap = {
87
- version: 3,
88
- file: 'min.js',
89
- names: ['bar', 'baz', 'n'],
90
- sources: ['one.js', 'two.js'],
91
- sourceRoot: 'http://example.com/www/js/',
92
- mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
93
- };
94
-
95
- var smc = new SourceMapConsumer(rawSourceMap);
96
-
97
- console.log(smc.sources);
98
- // [ 'http://example.com/www/js/one.js',
99
- // 'http://example.com/www/js/two.js' ]
100
-
101
- console.log(smc.originalPositionFor({
102
- line: 2,
103
- column: 28
104
- }));
105
- // { source: 'http://example.com/www/js/two.js',
106
- // line: 2,
107
- // column: 10,
108
- // name: 'n' }
109
-
110
- console.log(smc.generatedPositionFor({
111
- source: 'http://example.com/www/js/two.js',
112
- line: 2,
113
- column: 10
114
- }));
115
- // { line: 2, column: 28 }
116
-
117
- smc.eachMapping(function (m) {
118
- // ...
119
- });
120
- ```
121
-
122
- ### Generating a source map
123
-
124
- In depth guide:
125
- [**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/)
126
-
127
- #### With SourceNode (high level API)
128
-
129
- ```js
130
- function compile(ast) {
131
- switch (ast.type) {
132
- case 'BinaryExpression':
133
- return new SourceNode(
134
- ast.location.line,
135
- ast.location.column,
136
- ast.location.source,
137
- [compile(ast.left), " + ", compile(ast.right)]
138
- );
139
- case 'Literal':
140
- return new SourceNode(
141
- ast.location.line,
142
- ast.location.column,
143
- ast.location.source,
144
- String(ast.value)
145
- );
146
- // ...
147
- default:
148
- throw new Error("Bad AST");
149
- }
150
- }
151
-
152
- var ast = parse("40 + 2", "add.js");
153
- console.log(compile(ast).toStringWithSourceMap({
154
- file: 'add.js'
155
- }));
156
- // { code: '40 + 2',
157
- // map: [object SourceMapGenerator] }
158
- ```
159
-
160
- #### With SourceMapGenerator (low level API)
161
-
162
- ```js
163
- var map = new SourceMapGenerator({
164
- file: "source-mapped.js"
165
- });
166
-
167
- map.addMapping({
168
- generated: {
169
- line: 10,
170
- column: 35
171
- },
172
- source: "foo.js",
173
- original: {
174
- line: 33,
175
- column: 2
176
- },
177
- name: "christopher"
178
- });
179
-
180
- console.log(map.toString());
181
- // '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}'
182
- ```
183
-
184
- ## API
185
-
186
- Get a reference to the module:
187
-
188
- ```js
189
- // Node.js
190
- var sourceMap = require('source-map');
191
-
192
- // Browser builds
193
- var sourceMap = window.sourceMap;
194
-
195
- // Inside Firefox
196
- const sourceMap = require("devtools/toolkit/sourcemap/source-map.js");
197
- ```
198
-
199
- ### SourceMapConsumer
200
-
201
- A SourceMapConsumer instance represents a parsed source map which we can query
202
- for information about the original file positions by giving it a file position
203
- in the generated source.
204
-
205
- #### new SourceMapConsumer(rawSourceMap)
206
-
207
- The only parameter is the raw source map (either as a string which can be
208
- `JSON.parse`'d, or an object). According to the spec, source maps have the
209
- following attributes:
210
-
211
- * `version`: Which version of the source map spec this map is following.
212
-
213
- * `sources`: An array of URLs to the original source files.
214
-
215
- * `names`: An array of identifiers which can be referenced by individual
216
- mappings.
217
-
218
- * `sourceRoot`: Optional. The URL root from which all sources are relative.
219
-
220
- * `sourcesContent`: Optional. An array of contents of the original source files.
221
-
222
- * `mappings`: A string of base64 VLQs which contain the actual mappings.
223
-
224
- * `file`: Optional. The generated filename this source map is associated with.
225
-
226
- ```js
227
- var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData);
228
- ```
229
-
230
- #### SourceMapConsumer.prototype.computeColumnSpans()
231
-
232
- Compute the last column for each generated mapping. The last column is
233
- inclusive.
234
-
235
- ```js
236
- // Before:
237
- consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
238
- // [ { line: 2,
239
- // column: 1 },
240
- // { line: 2,
241
- // column: 10 },
242
- // { line: 2,
243
- // column: 20 } ]
244
-
245
- consumer.computeColumnSpans();
246
-
247
- // After:
248
- consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
249
- // [ { line: 2,
250
- // column: 1,
251
- // lastColumn: 9 },
252
- // { line: 2,
253
- // column: 10,
254
- // lastColumn: 19 },
255
- // { line: 2,
256
- // column: 20,
257
- // lastColumn: Infinity } ]
258
-
259
- ```
260
-
261
- #### SourceMapConsumer.prototype.originalPositionFor(generatedPosition)
262
-
263
- Returns the original source, line, and column information for the generated
264
- source's line and column positions provided. The only argument is an object with
265
- the following properties:
266
-
267
- * `line`: The line number in the generated source. Line numbers in
268
- this library are 1-based (note that the underlying source map
269
- specification uses 0-based line numbers -- this library handles the
270
- translation).
271
-
272
- * `column`: The column number in the generated source. Column numbers
273
- in this library are 0-based.
274
-
275
- * `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or
276
- `SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest
277
- element that is smaller than or greater than the one we are searching for,
278
- respectively, if the exact element cannot be found. Defaults to
279
- `SourceMapConsumer.GREATEST_LOWER_BOUND`.
280
-
281
- and an object is returned with the following properties:
282
-
283
- * `source`: The original source file, or null if this information is not
284
- available.
285
-
286
- * `line`: The line number in the original source, or null if this information is
287
- not available. The line number is 1-based.
288
-
289
- * `column`: The column number in the original source, or null if this
290
- information is not available. The column number is 0-based.
291
-
292
- * `name`: The original identifier, or null if this information is not available.
293
-
294
- ```js
295
- consumer.originalPositionFor({ line: 2, column: 10 })
296
- // { source: 'foo.coffee',
297
- // line: 2,
298
- // column: 2,
299
- // name: null }
300
-
301
- consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 })
302
- // { source: null,
303
- // line: null,
304
- // column: null,
305
- // name: null }
306
- ```
307
-
308
- #### SourceMapConsumer.prototype.generatedPositionFor(originalPosition)
309
-
310
- Returns the generated line and column information for the original source,
311
- line, and column positions provided. The only argument is an object with
312
- the following properties:
313
-
314
- * `source`: The filename of the original source.
315
-
316
- * `line`: The line number in the original source. The line number is
317
- 1-based.
318
-
319
- * `column`: The column number in the original source. The column
320
- number is 0-based.
321
-
322
- and an object is returned with the following properties:
323
-
324
- * `line`: The line number in the generated source, or null. The line
325
- number is 1-based.
326
-
327
- * `column`: The column number in the generated source, or null. The
328
- column number is 0-based.
329
-
330
- ```js
331
- consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 })
332
- // { line: 1,
333
- // column: 56 }
334
- ```
335
-
336
- #### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)
337
-
338
- Returns all generated line and column information for the original source, line,
339
- and column provided. If no column is provided, returns all mappings
340
- corresponding to a either the line we are searching for or the next closest line
341
- that has any mappings. Otherwise, returns all mappings corresponding to the
342
- given line and either the column we are searching for or the next closest column
343
- that has any offsets.
344
-
345
- The only argument is an object with the following properties:
346
-
347
- * `source`: The filename of the original source.
348
-
349
- * `line`: The line number in the original source. The line number is
350
- 1-based.
351
-
352
- * `column`: Optional. The column number in the original source. The
353
- column number is 0-based.
354
-
355
- and an array of objects is returned, each with the following properties:
356
-
357
- * `line`: The line number in the generated source, or null. The line
358
- number is 1-based.
359
-
360
- * `column`: The column number in the generated source, or null. The
361
- column number is 0-based.
362
-
363
- ```js
364
- consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" })
365
- // [ { line: 2,
366
- // column: 1 },
367
- // { line: 2,
368
- // column: 10 },
369
- // { line: 2,
370
- // column: 20 } ]
371
- ```
372
-
373
- #### SourceMapConsumer.prototype.hasContentsOfAllSources()
374
-
375
- Return true if we have the embedded source content for every source listed in
376
- the source map, false otherwise.
377
-
378
- In other words, if this method returns `true`, then
379
- `consumer.sourceContentFor(s)` will succeed for every source `s` in
380
- `consumer.sources`.
381
-
382
- ```js
383
- // ...
384
- if (consumer.hasContentsOfAllSources()) {
385
- consumerReadyCallback(consumer);
386
- } else {
387
- fetchSources(consumer, consumerReadyCallback);
388
- }
389
- // ...
390
- ```
391
-
392
- #### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])
393
-
394
- Returns the original source content for the source provided. The only
395
- argument is the URL of the original source file.
396
-
397
- If the source content for the given source is not found, then an error is
398
- thrown. Optionally, pass `true` as the second param to have `null` returned
399
- instead.
400
-
401
- ```js
402
- consumer.sources
403
- // [ "my-cool-lib.clj" ]
404
-
405
- consumer.sourceContentFor("my-cool-lib.clj")
406
- // "..."
407
-
408
- consumer.sourceContentFor("this is not in the source map");
409
- // Error: "this is not in the source map" is not in the source map
410
-
411
- consumer.sourceContentFor("this is not in the source map", true);
412
- // null
413
- ```
414
-
415
- #### SourceMapConsumer.prototype.eachMapping(callback, context, order)
416
-
417
- Iterate over each mapping between an original source/line/column and a
418
- generated line/column in this source map.
419
-
420
- * `callback`: The function that is called with each mapping. Mappings have the
421
- form `{ source, generatedLine, generatedColumn, originalLine, originalColumn,
422
- name }`
423
-
424
- * `context`: Optional. If specified, this object will be the value of `this`
425
- every time that `callback` is called.
426
-
427
- * `order`: Either `SourceMapConsumer.GENERATED_ORDER` or
428
- `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over
429
- the mappings sorted by the generated file's line/column order or the
430
- original's source/line/column order, respectively. Defaults to
431
- `SourceMapConsumer.GENERATED_ORDER`.
432
-
433
- ```js
434
- consumer.eachMapping(function (m) { console.log(m); })
435
- // ...
436
- // { source: 'illmatic.js',
437
- // generatedLine: 1,
438
- // generatedColumn: 0,
439
- // originalLine: 1,
440
- // originalColumn: 0,
441
- // name: null }
442
- // { source: 'illmatic.js',
443
- // generatedLine: 2,
444
- // generatedColumn: 0,
445
- // originalLine: 2,
446
- // originalColumn: 0,
447
- // name: null }
448
- // ...
449
- ```
450
- ### SourceMapGenerator
451
-
452
- An instance of the SourceMapGenerator represents a source map which is being
453
- built incrementally.
454
-
455
- #### new SourceMapGenerator([startOfSourceMap])
456
-
457
- You may pass an object with the following properties:
458
-
459
- * `file`: The filename of the generated source that this source map is
460
- associated with.
461
-
462
- * `sourceRoot`: A root for all relative URLs in this source map.
463
-
464
- * `skipValidation`: Optional. When `true`, disables validation of mappings as
465
- they are added. This can improve performance but should be used with
466
- discretion, as a last resort. Even then, one should avoid using this flag when
467
- running tests, if possible.
468
-
469
- * `ignoreInvalidMapping`: Optional. When `true`, instead of throwing error on
470
- invalid mapping, it will be ignored.
471
-
472
- ```js
473
- var generator = new sourceMap.SourceMapGenerator({
474
- file: "my-generated-javascript-file.js",
475
- sourceRoot: "http://example.com/app/js/"
476
- });
477
- ```
478
-
479
- #### SourceMapGenerator.fromSourceMap(sourceMapConsumer, sourceMapGeneratorOptions)
480
-
481
- Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance.
482
-
483
- * `sourceMapConsumer` The SourceMap.
484
-
485
- * `sourceMapGeneratorOptions` options that will be passed to the SourceMapGenerator constructor which used under the hood.
486
-
487
- ```js
488
- var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer, {
489
- ignoreInvalidMapping: true,
490
- });
491
- ```
492
-
493
- #### SourceMapGenerator.prototype.addMapping(mapping)
494
-
495
- Add a single mapping from original source line and column to the generated
496
- source's line and column for this source map being created. The mapping object
497
- should have the following properties:
498
-
499
- * `generated`: An object with the generated line and column positions.
500
-
501
- * `original`: An object with the original line and column positions.
502
-
503
- * `source`: The original source file (relative to the sourceRoot).
504
-
505
- * `name`: An optional original token name for this mapping.
506
-
507
- ```js
508
- generator.addMapping({
509
- source: "module-one.scm",
510
- original: { line: 128, column: 0 },
511
- generated: { line: 3, column: 456 }
512
- })
513
- ```
514
-
515
- #### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)
516
-
517
- Set the source content for an original source file.
518
-
519
- * `sourceFile` the URL of the original source file.
520
-
521
- * `sourceContent` the content of the source file.
522
-
523
- ```js
524
- generator.setSourceContent("module-one.scm",
525
- fs.readFileSync("path/to/module-one.scm"))
526
- ```
527
-
528
- #### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])
529
-
530
- Applies a SourceMap for a source file to the SourceMap.
531
- Each mapping to the supplied source file is rewritten using the
532
- supplied SourceMap. Note: The resolution for the resulting mappings
533
- is the minimum of this map and the supplied map.
534
-
535
- * `sourceMapConsumer`: The SourceMap to be applied.
536
-
537
- * `sourceFile`: Optional. The filename of the source file.
538
- If omitted, sourceMapConsumer.file will be used, if it exists.
539
- Otherwise an error will be thrown.
540
-
541
- * `sourceMapPath`: Optional. The dirname of the path to the SourceMap
542
- to be applied. If relative, it is relative to the SourceMap.
543
-
544
- This parameter is needed when the two SourceMaps aren't in the same
545
- directory, and the SourceMap to be applied contains relative source
546
- paths. If so, those relative source paths need to be rewritten
547
- relative to the SourceMap.
548
-
549
- If omitted, it is assumed that both SourceMaps are in the same directory,
550
- thus not needing any rewriting. (Supplying `'.'` has the same effect.)
551
-
552
- #### SourceMapGenerator.prototype.toString()
553
-
554
- Renders the source map being generated to a string.
555
-
556
- ```js
557
- generator.toString()
558
- // '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}'
559
- ```
560
-
561
- ### SourceNode
562
-
563
- SourceNodes provide a way to abstract over interpolating and/or concatenating
564
- snippets of generated JavaScript source code, while maintaining the line and
565
- column information associated between those snippets and the original source
566
- code. This is useful as the final intermediate representation a compiler might
567
- use before outputting the generated JS and source map.
568
-
569
- #### new SourceNode([line, column, source[, chunk[, name]]])
570
-
571
- * `line`: The original line number associated with this source node, or null if
572
- it isn't associated with an original line. The line number is 1-based.
573
-
574
- * `column`: The original column number associated with this source node, or null
575
- if it isn't associated with an original column. The column number
576
- is 0-based.
577
-
578
- * `source`: The original source's filename; null if no filename is provided.
579
-
580
- * `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see
581
- below.
582
-
583
- * `name`: Optional. The original identifier.
584
-
585
- ```js
586
- var node = new SourceNode(1, 2, "a.cpp", [
587
- new SourceNode(3, 4, "b.cpp", "extern int status;\n"),
588
- new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"),
589
- new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"),
590
- ]);
591
- ```
592
-
593
- #### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])
594
-
595
- Creates a SourceNode from generated code and a SourceMapConsumer.
596
-
597
- * `code`: The generated code
598
-
599
- * `sourceMapConsumer` The SourceMap for the generated code
600
-
601
- * `relativePath` The optional path that relative sources in `sourceMapConsumer`
602
- should be relative to.
603
-
604
- ```js
605
- var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8"));
606
- var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"),
607
- consumer);
608
- ```
609
-
610
- #### SourceNode.prototype.add(chunk)
611
-
612
- Add a chunk of generated JS to this source node.
613
-
614
- * `chunk`: A string snippet of generated JS code, another instance of
615
- `SourceNode`, or an array where each member is one of those things.
616
-
617
- ```js
618
- node.add(" + ");
619
- node.add(otherNode);
620
- node.add([leftHandOperandNode, " + ", rightHandOperandNode]);
621
- ```
622
-
623
- #### SourceNode.prototype.prepend(chunk)
624
-
625
- Prepend a chunk of generated JS to this source node.
626
-
627
- * `chunk`: A string snippet of generated JS code, another instance of
628
- `SourceNode`, or an array where each member is one of those things.
629
-
630
- ```js
631
- node.prepend("/** Build Id: f783haef86324gf **/\n\n");
632
- ```
633
-
634
- #### SourceNode.prototype.setSourceContent(sourceFile, sourceContent)
635
-
636
- Set the source content for a source file. This will be added to the
637
- `SourceMap` in the `sourcesContent` field.
638
-
639
- * `sourceFile`: The filename of the source file
640
-
641
- * `sourceContent`: The content of the source file
642
-
643
- ```js
644
- node.setSourceContent("module-one.scm",
645
- fs.readFileSync("path/to/module-one.scm"))
646
- ```
647
-
648
- #### SourceNode.prototype.walk(fn)
649
-
650
- Walk over the tree of JS snippets in this node and its children. The walking
651
- function is called once for each snippet of JS and is passed that snippet and
652
- the its original associated source's line/column location.
653
-
654
- * `fn`: The traversal function.
655
-
656
- ```js
657
- var node = new SourceNode(1, 2, "a.js", [
658
- new SourceNode(3, 4, "b.js", "uno"),
659
- "dos",
660
- [
661
- "tres",
662
- new SourceNode(5, 6, "c.js", "quatro")
663
- ]
664
- ]);
665
-
666
- node.walk(function (code, loc) { console.log("WALK:", code, loc); })
667
- // WALK: uno { source: 'b.js', line: 3, column: 4, name: null }
668
- // WALK: dos { source: 'a.js', line: 1, column: 2, name: null }
669
- // WALK: tres { source: 'a.js', line: 1, column: 2, name: null }
670
- // WALK: quatro { source: 'c.js', line: 5, column: 6, name: null }
671
- ```
672
-
673
- #### SourceNode.prototype.walkSourceContents(fn)
674
-
675
- Walk over the tree of SourceNodes. The walking function is called for each
676
- source file content and is passed the filename and source content.
677
-
678
- * `fn`: The traversal function.
679
-
680
- ```js
681
- var a = new SourceNode(1, 2, "a.js", "generated from a");
682
- a.setSourceContent("a.js", "original a");
683
- var b = new SourceNode(1, 2, "b.js", "generated from b");
684
- b.setSourceContent("b.js", "original b");
685
- var c = new SourceNode(1, 2, "c.js", "generated from c");
686
- c.setSourceContent("c.js", "original c");
687
-
688
- var node = new SourceNode(null, null, null, [a, b, c]);
689
- node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); })
690
- // WALK: a.js : original a
691
- // WALK: b.js : original b
692
- // WALK: c.js : original c
693
- ```
694
-
695
- #### SourceNode.prototype.join(sep)
696
-
697
- Like `Array.prototype.join` except for SourceNodes. Inserts the separator
698
- between each of this source node's children.
699
-
700
- * `sep`: The separator.
701
-
702
- ```js
703
- var lhs = new SourceNode(1, 2, "a.rs", "my_copy");
704
- var operand = new SourceNode(3, 4, "a.rs", "=");
705
- var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()");
706
-
707
- var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]);
708
- var joinedNode = node.join(" ");
709
- ```
710
-
711
- #### SourceNode.prototype.replaceRight(pattern, replacement)
712
-
713
- Call `String.prototype.replace` on the very right-most source snippet. Useful
714
- for trimming white space from the end of a source node, etc.
715
-
716
- * `pattern`: The pattern to replace.
717
-
718
- * `replacement`: The thing to replace the pattern with.
719
-
720
- ```js
721
- // Trim trailing white space.
722
- node.replaceRight(/\s*$/, "");
723
- ```
724
-
725
- #### SourceNode.prototype.toString()
726
-
727
- Return the string representation of this source node. Walks over the tree and
728
- concatenates all the various snippets together to one string.
729
-
730
- ```js
731
- var node = new SourceNode(1, 2, "a.js", [
732
- new SourceNode(3, 4, "b.js", "uno"),
733
- "dos",
734
- [
735
- "tres",
736
- new SourceNode(5, 6, "c.js", "quatro")
737
- ]
738
- ]);
739
-
740
- node.toString()
741
- // 'unodostresquatro'
742
- ```
743
-
744
- #### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])
745
-
746
- Returns the string representation of this tree of source nodes, plus a
747
- SourceMapGenerator which contains all the mappings between the generated and
748
- original sources.
749
-
750
- The arguments are the same as those to `new SourceMapGenerator`.
751
-
752
- ```js
753
- var node = new SourceNode(1, 2, "a.js", [
754
- new SourceNode(3, 4, "b.js", "uno"),
755
- "dos",
756
- [
757
- "tres",
758
- new SourceNode(5, 6, "c.js", "quatro")
759
- ]
760
- ]);
761
-
762
- node.toStringWithSourceMap({ file: "my-output-file.js" })
763
- // { code: 'unodostresquatro',
764
- // map: [object SourceMapGenerator] }
765
- ```