@amazon/vinyl-tsx 4.0.0 → 4.0.1-next.20261016220320

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.
@@ -22,7 +22,7 @@ var now;if(typeof window!=="undefined"&&typeof window.performance!=="undefined"&
22
22
  var nextTestTimeoutOverridden=false;function setTestTimeout(timeout){var originalTimeout=null;beforeEach(function(){originalTimeout=jasmine.DEFAULT_TIMEOUT_INTERVAL;if(!nextTestTimeoutOverridden)jasmine.DEFAULT_TIMEOUT_INTERVAL=timeout*1e3});afterEach(function(){if(originalTimeout)jasmine.DEFAULT_TIMEOUT_INTERVAL=originalTimeout;if(nextTestTimeoutOverridden)nextTestTimeoutOverridden=false})}// ../vinyl-util/test/browserTestUtil/expect/expectNothing.ts
23
23
  function expectNothing(){expect(true).toBeTruthy()}// ../vinyl-util/test/browserTestUtil/mock/createSpyFactory.ts
24
24
  var createSpy=jasmine.createSpy;function createSpy2(key){return createSpy(String(key))}// ../vinyl-util/test/browserTestUtil/mock/dom/lib.dom.ts
25
- var MockAbortSignal=/*#__PURE__*/_createClass(function MockAbortSignal(){_classCallCheck(this,MockAbortSignal);__publicField(this,"aborted",false);__publicField(this,"onabort",null);__publicField(this,"reason");__publicField(this,"throwIfAborted",createSpy2("throwIfAborted"));__publicField(this,"addEventListener",createSpy2("addEventListener"));__publicField(this,"removeEventListener",createSpy2("removeEventListener"));__publicField(this,"dispatchEvent",createSpy2("dispatchEvent"))});var MockMediaSource=/*#__PURE__*/_createClass(function MockMediaSource(){_classCallCheck(this,MockMediaSource);__publicField(this,"activeSourceBuffers");__publicField(this,"duration",0);__publicField(this,"onsourceclose",null);__publicField(this,"onsourceended",null);__publicField(this,"onsourceopen",null);__publicField(this,"readyState","closed");__publicField(this,"sourceBuffers");__publicField(this,"addSourceBuffer",createSpy2("addSourceBuffer"));__publicField(this,"clearLiveSeekableRange",createSpy2("clearLiveSeekableRange"));__publicField(this,"endOfStream",createSpy2("endOfStream"));__publicField(this,"removeSourceBuffer",createSpy2("removeSourceBuffer"));__publicField(this,"setLiveSeekableRange",createSpy2("setLiveSeekableRange"));__publicField(this,"addEventListener",createSpy2("addEventListener"));__publicField(this,"removeEventListener",createSpy2("removeEventListener"));__publicField(this,"dispatchEvent",createSpy2("dispatchEvent"))});// ../vinyl-util/test/browserTestUtil/mock/dom/globals.ts
25
+ var MockAbortSignal=/*#__PURE__*/_createClass(function MockAbortSignal(){_classCallCheck(this,MockAbortSignal);__publicField(this,"aborted",false);__publicField(this,"onabort",null);__publicField(this,"reason");__publicField(this,"throwIfAborted",createSpy2("throwIfAborted"));__publicField(this,"addEventListener",createSpy2("addEventListener"));__publicField(this,"removeEventListener",createSpy2("removeEventListener"));__publicField(this,"dispatchEvent",createSpy2("dispatchEvent"))});var MockMediaSource=/*#__PURE__*/_createClass(function MockMediaSource(){_classCallCheck(this,MockMediaSource);__publicField(this,"activeSourceBuffers");__publicField(this,"duration",0);__publicField(this,"onsourceclose",null);__publicField(this,"onsourceended",null);__publicField(this,"onsourceopen",null);__publicField(this,"readyState","closed");__publicField(this,"sourceBuffers",[]);__publicField(this,"addSourceBuffer",createSpy2("addSourceBuffer"));__publicField(this,"clearLiveSeekableRange",createSpy2("clearLiveSeekableRange"));__publicField(this,"endOfStream",createSpy2("endOfStream"));__publicField(this,"removeSourceBuffer",createSpy2("removeSourceBuffer"));__publicField(this,"setLiveSeekableRange",createSpy2("setLiveSeekableRange"));__publicField(this,"addEventListener",createSpy2("addEventListener"));__publicField(this,"removeEventListener",createSpy2("removeEventListener"));__publicField(this,"dispatchEvent",createSpy2("dispatchEvent"))});// ../vinyl-util/test/browserTestUtil/mock/dom/globals.ts
26
26
  var MockMediaSourceGlobal=/*#__PURE__*/function(_MockMediaSource){function MockMediaSourceGlobal(){_classCallCheck(this,MockMediaSourceGlobal);return _callSuper(this,MockMediaSourceGlobal,arguments)}_inherits(MockMediaSourceGlobal,_MockMediaSource);return _createClass(MockMediaSourceGlobal)}(MockMediaSource);__publicField(MockMediaSourceGlobal,"canConstructInDedicatedWorker",false);__publicField(MockMediaSourceGlobal,"isTypeSupported",createSpy2("isTypeSupported"));var MockAbortSignalGlobal=/*#__PURE__*/function(_MockAbortSignal){function MockAbortSignalGlobal(){_classCallCheck(this,MockAbortSignalGlobal);return _callSuper(this,MockAbortSignalGlobal,arguments)}_inherits(MockAbortSignalGlobal,_MockAbortSignal);return _createClass(MockAbortSignalGlobal)}(MockAbortSignal);__publicField(MockAbortSignalGlobal,"abort",createSpy2("abort"));__publicField(MockAbortSignalGlobal,"any",createSpy2("any"));__publicField(MockAbortSignalGlobal,"timeout",createSpy2("timeout"));// src/domUtil.ts
27
27
  function walkDomDepthFirst(node,callback){if(!node)return;var next=node.firstChild;while(next){var after=next.nextSibling;walkDomDepthFirst(next,callback);next=after}callback(node)}// src/extensions/connectedObserver.ts
28
28
  var CONNECTION_CALLBACKS=/* @__PURE__ */Symbol["for"]("@amazon/vinyl-tsx/connectionCallbacks");function callbacksOf(node){var observed=node;var callbacks=observed[CONNECTION_CALLBACKS];if(!callbacks){callbacks={connect:/* @__PURE__ */new Set,disconnect:/* @__PURE__ */new Set};observed[CONNECTION_CALLBACKS]=callbacks}return callbacks}function notify(node,type){var _a;var callbacks=(_a=node[CONNECTION_CALLBACKS])==null?void 0:_a[type];if(callbacks==null?void 0:callbacks.size)for(var _i=0,_arr=_toConsumableArray(callbacks);_i<_arr.length;_i++){var callback=_arr[_i];callback()}}function initializeConnectedObserver(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var _a;var events=(_a=options.events)!=null?_a:true;var observer=new MutationObserver(function(mutations){var removed=/* @__PURE__ */new Set;var added=/* @__PURE__ */new Set;var _iterator3=_createForOfIteratorHelper(mutations),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var mutation=_step3.value;mutation.removedNodes.forEach(function(node){return removed.add(node)});mutation.addedNodes.forEach(function(node){return added.add(node)})}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}var _iterator4=_createForOfIteratorHelper(mutations),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _mutation=_step4.value;var _iterator5=_createForOfIteratorHelper(_mutation.addedNodes),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var node=_step5.value;if(removed.has(node))continue;walkDomDepthFirst(node,function(iNode){notify(iNode,"connect");if(events){iNode.dispatchEvent(new CustomEvent("connect",{bubbles:false}))}})}}catch(err){_iterator5.e(err)}finally{_iterator5.f()}var _iterator6=_createForOfIteratorHelper(_mutation.removedNodes),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _node=_step6.value;if(added.has(_node))continue;walkDomDepthFirst(_node,function(iNode){notify(iNode,"disconnect");if(events){iNode.dispatchEvent(new CustomEvent("disconnect",{bubbles:false}))}})}}catch(err){_iterator6.e(err)}finally{_iterator6.f()}}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}});observer.observe(document,{childList:true,subtree:true});return function(){observer.disconnect()}}function onConnect(target,callback){var sub=null;var connected=false;var onConnect2=function onConnect2(){if(connected)return;connected=true;sub=callback(target)};var onDisconnect=function onDisconnect(){connected=false;sub==null?void 0:sub();sub=null};var callbacks=callbacksOf(target);callbacks.connect.add(onConnect2);callbacks.disconnect.add(onDisconnect);target.addEventListener("connect",onConnect2);target.addEventListener("disconnect",onDisconnect);if(target.isConnected)onConnect2();return function(){callbacks.connect["delete"](onConnect2);callbacks.disconnect["delete"](onDisconnect);target.removeEventListener("connect",onConnect2);target.removeEventListener("disconnect",onDisconnect);onDisconnect()}}// test/benchmark/setup.ts
@@ -280,7 +280,7 @@
280
280
  __publicField(this, "onsourceended", null);
281
281
  __publicField(this, "onsourceopen", null);
282
282
  __publicField(this, "readyState", "closed");
283
- __publicField(this, "sourceBuffers");
283
+ __publicField(this, "sourceBuffers", []);
284
284
  __publicField(this, "addSourceBuffer", createSpy2("addSourceBuffer"));
285
285
  __publicField(this, "clearLiveSeekableRange", createSpy2(
286
286
  "clearLiveSeekableRange"