Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webrtc-mock

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webrtc-mock - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

58

dist/devicesMock.d.ts

@@ -19,53 +19,13 @@ export declare const VIDEO_KIND: "videoinput";

constructor(kind: MediaDeviceKind, index?: number);
toJSON(): void;
toJSON(): string;
}
export declare const hasUserNotAccessDevice: (deviceId: string) => boolean;
export declare const parseDevice: (device: DeviceMock) => {
deviceId: string;
groupId: string;
kind: MediaDeviceKind;
label: string;
};
export declare const getDeviceVideo: (index?: number | undefined) => {
deviceId: string;
groupId: string;
kind: MediaDeviceKind;
label: string;
};
export declare const getDeviceAudioIn: (index?: number | undefined) => {
deviceId: string;
groupId: string;
kind: MediaDeviceKind;
label: string;
};
export declare const getDeviceAudioOut: (index?: number | undefined) => {
deviceId: string;
groupId: string;
kind: MediaDeviceKind;
label: string;
};
export declare const getDevicesVideo: () => {
deviceId: string;
groupId: string;
kind: MediaDeviceKind;
label: string;
}[];
export declare const getDevicesAudioIn: () => {
deviceId: string;
groupId: string;
kind: MediaDeviceKind;
label: string;
}[];
export declare const getDevicesAudioOut: () => {
deviceId: string;
groupId: string;
kind: MediaDeviceKind;
label: string;
}[];
export declare const getAvailableDevices: () => {
deviceId: string;
groupId: string;
kind: MediaDeviceKind;
label: string;
}[];
export declare const parseDevice: (device: DeviceMock) => DeviceMock;
export declare const getDeviceVideo: (index?: number) => MediaDeviceInfo;
export declare const getDeviceAudioIn: (index?: number) => MediaDeviceInfo;
export declare const getDeviceAudioOut: (index?: number) => MediaDeviceInfo;
export declare const getDevicesVideo: () => MediaDeviceInfo[];
export declare const getDevicesAudioIn: () => MediaDeviceInfo[];
export declare const getDevicesAudioOut: () => MediaDeviceInfo[];
export declare const getAvailableDevices: () => MediaDeviceInfo[];
export declare const setUserNotAccessVideo: (notAccess: boolean) => void;

@@ -72,0 +32,0 @@ export declare const setUserNotAccessAudioIn: (notAccess: boolean) => void;

3

dist/devicesMock.js

@@ -71,5 +71,4 @@ "use strict";

}
// eslint-disable-next-line class-methods-use-this
toJSON() {
throw new Error('Method not implemented.');
return JSON.stringify(this);
}

@@ -76,0 +75,0 @@ }

@@ -8,2 +8,3 @@ declare const getAvailableDevicesWithResolutions: ({ hasAccessDeviceAudioOutput }?: {

label: string;
toJSON(): any;
resolutions: {

@@ -21,2 +22,3 @@ id: string;

label: string;
toJSON(): any;
hasAccess: boolean;

@@ -28,4 +30,5 @@ } | {

label: string;
toJSON(): any;
})[];
export default getAvailableDevicesWithResolutions;
//# sourceMappingURL=getAvailableDevicesWithResolutions.d.ts.map

@@ -1,2 +0,2 @@

import t from"events-constructor";import i from"lodash/flow";import e from"lodash/curryRight";import s from"lodash/map";import n from"lodash/sortBy";import o from"lodash/property";const d="ended",r=[d,"mute","unmute","isolationchange","overconstrained"];class a{constructor(i,{id:e="identifier",constraints:s={}}={}){this.contentHint="",this.readyState="live",this.isolated=!1,this.label="",this.muted=!1,this.onended=null,this.onisolationchange=null,this.onmute=null,this.onunmute=null,this.getConstraints=()=>this.constraints,this.stop=()=>{const t=Object.assign({},new Event(d));this._events.trigger(d,t),this.readyState=d,this.onended&&this.onended(t)},this.addEventListener=(t,i)=>{this._events.on(t,i)},this.removeEventListener=(t,i)=>{this._events.off(t,i)},this.id=`${e}-${i}-track`,this.kind=i,this.enabled=!0,this.constraints=Object.assign({},s),this._events=new t(r)}clone(){return Object.assign({},this)}getCapabilities(){return{width:{min:352,max:4096},height:{min:288,max:2160}}}getSettings(){var t,i,e,s,n,o,d,r,a,c,h,l,u,v,g,E;let p=0,_=0;return"object"==typeof(null===(t=this.constraints)||void 0===t?void 0:t.width)&&(null===(e=null===(i=this.constraints)||void 0===i?void 0:i.width)||void 0===e?void 0:e.ideal)?p=this.constraints.width.ideal:"object"==typeof(null===(s=this.constraints)||void 0===s?void 0:s.width)&&(null===(o=null===(n=this.constraints)||void 0===n?void 0:n.width)||void 0===o?void 0:o.exact)?p=this.constraints.width.exact:"number"==typeof(null===(d=this.constraints)||void 0===d?void 0:d.width)&&(null===(r=this.constraints)||void 0===r?void 0:r.width)&&(p=this.constraints.width),"object"==typeof(null===(a=this.constraints)||void 0===a?void 0:a.height)&&(null===(h=null===(c=this.constraints)||void 0===c?void 0:c.height)||void 0===h?void 0:h.ideal)?_=this.constraints.height.ideal:"object"==typeof(null===(l=this.constraints)||void 0===l?void 0:l.height)&&(null===(v=null===(u=this.constraints)||void 0===u?void 0:u.height)||void 0===v?void 0:v.exact)?_=this.constraints.height.exact:"number"==typeof(null===(g=this.constraints)||void 0===g?void 0:g.height)&&(null===(E=this.constraints)||void 0===E?void 0:E.height)&&(_=this.constraints.height),{width:p,height:_}}applyConstraints(t){return this.constraints=Object.assign({},t),Promise.resolve()}dispatchEvent(t){const i=t.type;return this._events.trigger(i,t),!0}}const c=t=>new a("audio",t),h=t=>new a("video",t),l=()=>c({id:"fromAudioContext",constraints:{}}),u=()=>h({id:"fromCanvas",constraints:{}}),v=[{id:"CIF",width:352,height:288,aspectRatio:4/3},{id:"360p",width:640,height:360,aspectRatio:16/9},{id:"720p",width:1280,height:720,aspectRatio:16/9},{id:"1080p",width:1920,height:1080,aspectRatio:16/9}],g="videoinput",E=({prefix:t,postfix:i="DeviceId",index:e})=>`${t}${i}${void 0===e?"":e}`;class p{constructor(t,i){this.kind=t,this.deviceId=E({index:i,prefix:t}),this.groupId=E({index:i,prefix:"groupId",postfix:t}),this.label=E({index:i,prefix:"label ",postfix:t})}toJSON(){throw new Error("Method not implemented.")}}const _=t=>{const i=t.toLowerCase();let e=!1;return i.includes(g)?e=!0===global.DEVICES_USER_NOT_ACCESS.videoinput:i.includes("audioinput")?e=!0===global.DEVICES_USER_NOT_ACCESS.audioinput:i.includes("audiooutput")&&(e=!0===global.DEVICES_USER_NOT_ACCESS.audiooutput),e},S=t=>Object.assign({},t),I=t=>S(new p(g,t)),b=t=>S(new p("audioinput",t)),f=t=>S(new p("audiooutput",t)),m=()=>{switch(global.COUNT_DEVICES_AVAILABLE.videoinput){case 0:return[];case 1:return[I()];case 2:return[I(),I(2)];case 3:return[I(),I(2),I(3)];default:return[I()]}},D=()=>{switch(global.COUNT_DEVICES_AVAILABLE.audioinput){case 0:return[];case 1:return[b()];case 2:return[b(),b(2)];case 3:return[b(),b(2),b(3)];default:return[b()]}},C=()=>{switch(global.COUNT_DEVICES_AVAILABLE.audiooutput){case 0:return[];case 1:return[f()];case 2:return[f(),f(2)];case 3:return[f(),f(2),f(3)];default:return[f()]}},O=()=>[...m(),...D(),...C()],w=t=>{global.DEVICES_USER_NOT_ACCESS.videoinput=t},y=t=>{global.DEVICES_USER_NOT_ACCESS.audioinput=t},A=t=>{y(t),w(t)},N=v.filter((({id:t})=>"1080p"!==t)),V={[E({prefix:g})]:v,[E({prefix:g,index:1})]:v,[E({prefix:g,index:2})]:N},k=[d,"mute","unmute","isolationchange","overconstrained"];class x{constructor(i,{id:e="identifier",constraints:s={}}={}){this.contentHint="",this.readyState="live",this.isolated=!1,this.label="",this.muted=!1,this.onended=null,this.onisolationchange=null,this.onmute=null,this.onunmute=null,this.getConstraints=()=>this.constraints,this.stop=()=>{const t=Object.assign({},new Event(d));this._events.trigger(d,t),this.readyState=d,this.onended&&this.onended(t)},this.addEventListener=(t,i)=>{this._events.on(t,i)},this.removeEventListener=(t,i)=>{this._events.off(t,i)},this.id=`${e}-${i}-track`,this.kind=i,this.enabled=!0,this.constraints=Object.assign({},s),this._events=new t(k)}clone(){return Object.assign({},this)}getCapabilities(){return{width:{min:352,max:4096},height:{min:288,max:2160}}}getSettings(){var t,i,e,s,n,o,d,r,a,c,h,l,u,v,g,E;let p=0,_=0;return"object"==typeof(null===(t=this.constraints)||void 0===t?void 0:t.width)&&(null===(e=null===(i=this.constraints)||void 0===i?void 0:i.width)||void 0===e?void 0:e.ideal)?p=this.constraints.width.ideal:"object"==typeof(null===(s=this.constraints)||void 0===s?void 0:s.width)&&(null===(o=null===(n=this.constraints)||void 0===n?void 0:n.width)||void 0===o?void 0:o.exact)?p=this.constraints.width.exact:"number"==typeof(null===(d=this.constraints)||void 0===d?void 0:d.width)&&(null===(r=this.constraints)||void 0===r?void 0:r.width)&&(p=this.constraints.width),"object"==typeof(null===(a=this.constraints)||void 0===a?void 0:a.height)&&(null===(h=null===(c=this.constraints)||void 0===c?void 0:c.height)||void 0===h?void 0:h.ideal)?_=this.constraints.height.ideal:"object"==typeof(null===(l=this.constraints)||void 0===l?void 0:l.height)&&(null===(v=null===(u=this.constraints)||void 0===u?void 0:u.height)||void 0===v?void 0:v.exact)?_=this.constraints.height.exact:"number"==typeof(null===(g=this.constraints)||void 0===g?void 0:g.height)&&(null===(E=this.constraints)||void 0===E?void 0:E.height)&&(_=this.constraints.height),{width:p,height:_}}applyConstraints(t){return this.constraints=Object.assign({},t),Promise.resolve()}dispatchEvent(t){const i=t.type;return this._events.trigger(i,t),!0}}const j=["addtrack","removetrack"];let T=0;class U{constructor(i=[]){this.active=!0,this.getTracks=()=>this.tracks,this.getAudioTracks=()=>this.tracks.filter((({kind:t})=>"audio"===t)),this.getVideoTracks=()=>this.tracks.filter((({kind:t})=>"video"===t)),this.addTrack=t=>{this.tracks=[...this.tracks,t];const i=Object.assign(Object.assign({},new Event("addtrack")),{track:t});return this._events.trigger("addtrack",i),this.onaddtrack&&this.onaddtrack(i),this},this.addEventListener=(t,i)=>{this._events.on(t,i)},this.removeEventListener=(t,i)=>{this._events.off(t,i)},this.id=(T+=1,`identifier-${T}`),this.tracks=i,this._events=new t(j),this.onaddtrack=null,this.onremovetrack=null}removeTrack(t){this.tracks=this.tracks.filter((i=>i.id!==t.id));const i=Object.assign(Object.assign({},new Event("removetrack")),{track:t});return this._events.trigger("removetrack",i),this.onremovetrack&&this.onremovetrack(i),this}dispatchEvent(t){const i=t.type;return this._events.trigger(i,t),!0}clone(){return Object.assign({},this)}getTrackById(t){return this.tracks.find((i=>i.id===t))||null}}const B=()=>Promise.resolve(new U([l()])),L=()=>Promise.resolve(new U([u()])),P=(t,i={})=>{const{fromCanvas:e,fromAudioContext:s}=i,n=[];t.audio&&!s&&n.push(c({id:t.audio.deviceId.exact,deviceId:t.audio.deviceId,constraints:t.audio})),t.video&&!e&&n.push(h({id:t.video.deviceId.exact,deviceId:t.video.deviceId,constraints:t.video}));let o=new U(n);return e&&s?o=new U([u(),l()]):e?o.addTrack(u()):s&&o.addTrack(l()),o},R=t=>JSON.parse(JSON.stringify(t)),Y=t=>i(R,(i=>n(i,o(t))),e(s)(R)),M=Y("id"),F=t=>R(Object.assign(Object.assign({},t),{tracks:M(t.getTracks())})),$=t=>{const i=F(t);return delete i.id,i},H=({hasAccessDeviceAudioOutput:t=!1}={})=>O().map((i=>{let e;var s;return e="videoinput"===i.kind?Object.assign({resolutions:_(i.deviceId)?[]:(s=i.deviceId,V[s]),hasAccess:!_(i.deviceId)},i):"audioinput"===i.kind?Object.assign({hasAccess:!_(i.deviceId)},i):t?Object.assign({hasAccess:!0},i):Object.assign({},i),e})),J=["devicechange"];class q{constructor(){this.getUserMedia=t=>{var i,e;let s,n;if(t&&t.video&&"object"==typeof t.video&&"object"==typeof t.video.deviceId&&!Array.isArray(t.video.deviceId)?s=t.video.deviceId.exact:t&&!0===t.video&&O().find((({kind:t})=>t===g))?(s=null===(i=O().find((({kind:t})=>t===g)))||void 0===i?void 0:i.deviceId,t.video={deviceId:{exact:s}}):t&&!0===t.video&&(t.video={deviceId:{exact:"notAvailableDevice"}}),t&&t.audio&&"object"==typeof t.audio&&"object"==typeof t.audio.deviceId&&!Array.isArray(t.audio.deviceId)?n=t.audio.deviceId.exact:t&&!0===t.audio&&O().find((({kind:t})=>"audioinput"===t))?(n=null===(e=O().find((({kind:t})=>"audioinput"===t)))||void 0===e?void 0:e.deviceId,t.audio={deviceId:{exact:n}}):t&&!0===t.audio&&(t.audio={deviceId:{exact:"notAvailableDevice"}}),s&&"string"==typeof s&&(o=s,global.DEVICES_BUSY.videoinput.includes(o))){const t=(()=>{const t=new Error("Could not start video source");return t.name="NotReadableError",t})();return Promise.reject(t)}var o;if(s&&"string"==typeof s&&(t=>global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput.includes(t))(s)){const t=new Error("Permission denied by system");return Promise.reject(t)}if(s&&"string"==typeof s&&(t=>global.DEVICES_NOT_FOUND.videoinput.includes(t))(s)){const t=(()=>{const t=new Error;return t.name="NotFoundError",t})();return Promise.reject(t)}if(s&&"string"==typeof s&&_(s)||n&&"string"==typeof n&&_(n)){const t=new Error("Permission denied");return Promise.reject(t)}return s&&"string"==typeof s&&"object"==typeof t.video&&"object"==typeof t.video.height&&"object"==typeof t.video.height&&t.video.height&&t.video.height.exact&&!(({deviceId:t,exactHeight:i})=>{const e=V[t];return!e||0!==e.filter((({height:t})=>t===i)).length})({deviceId:s,exactHeight:t.video.height.exact})?Promise.reject(new Error(`Resolution height:${t.video.height.exact} is not available: ${s}`)):Promise.resolve(P(t))},this.enumerateDevices=()=>new Promise((t=>setTimeout((()=>t(O())),100))),this.addEventListener=(t,i)=>{this._events.on(t,i)},this.removeEventListener=(t,i)=>{this._events.off(t,i)},this.setCountVideoDevicesAvailable=t=>{((t=1)=>{global.COUNT_DEVICES_AVAILABLE.videoinput=t})(t),this._events.trigger("devicechange",void 0)},this.setCountAudioInDevicesAvailable=t=>{((t=1)=>{global.COUNT_DEVICES_AVAILABLE.audioinput=t})(t),this._events.trigger("devicechange",void 0)},this.setCountAudioOutDevicesAvailable=t=>{((t=1)=>{global.COUNT_DEVICES_AVAILABLE.audiooutput=t})(t),this._events.trigger("devicechange",void 0)},this.setBusyVideoDevice=t=>{(t=>{global.DEVICES_BUSY.videoinput.includes(t)||global.DEVICES_BUSY.videoinput.push(t)})(t)},this.setNotFoundVideoDevice=t=>{(t=>{global.DEVICES_NOT_FOUND.videoinput.includes(t)||global.DEVICES_NOT_FOUND.videoinput.push(t)})(t)},this.setPermissionDeniedBySystem=t=>{(t=>{global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput.includes(t)||global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput.push(t)})(t)},this.setUserNotAccessVideo=(t=!0)=>{w(t)},this.setUserNotAccessAudioIn=(t=!0)=>{y(t)},this.setUserNotAccessAll=(t=!0)=>{A(t)},this.unsetAllRestrictions=()=>{global.DEVICES_BUSY.videoinput=[],global.DEVICES_NOT_FOUND.videoinput=[],global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput=[],A(!1)},this.unsetBusyVideoDevice=t=>{(t=>{global.DEVICES_BUSY.videoinput=global.DEVICES_BUSY.videoinput.filter((i=>i!==t))})(t)},this.unsetNotFoundVideoDevice=t=>{(t=>{global.DEVICES_NOT_FOUND.videoinput=global.DEVICES_NOT_FOUND.videoinput.filter((i=>i!==t))})(t)},this.unsetPermissionDeniedBySystem=t=>{(t=>{global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput=global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput.filter((i=>i!==t))})(t)},this._events=new t(J),this.getDisplayMedia=this.getUserMedia}}const z=()=>{global.MediaStream=U,global.navigator.mediaDevices=new q,global.COUNT_DEVICES_AVAILABLE={[g]:1,audioinput:1,audiooutput:1},global.DEVICES_USER_NOT_ACCESS={[g]:!1,audioinput:!1,audiooutput:!1},global.DEVICES_BUSY={[g]:[]},global.DEVICES_NOT_FOUND={[g]:[]},global.DEVICES_PERMISSION_DENIED_BY_SYSTEM={[g]:[]}};export{U as MediaStreamMock,x as MediaStreamTrackMock,l as createAudioContextAudioMediaStreamTrackMock,c as createAudioMediaStreamTrackMock,u as createCanvasVideoMediaStreamTrackMock,P as createMediaStreamMock,h as createVideoMediaStreamTrackMock,z as doMock,B as getAudioContextMediaStreamMock,O as getAvailableDevices,H as getAvailableDevicesWithResolutions,L as getCanvasMediaStreamMock,F as parseMediaStream,$ as parseMediaStreamWithoutId,R as parseObject,M as parseTracks,v as resolutionsList,Y as resolveParseArray};
import t from"events-constructor";import i from"lodash/flow";import e from"lodash/curryRight";import s from"lodash/map";import n from"lodash/sortBy";import o from"lodash/property";const d="ended",r=[d,"mute","unmute","isolationchange","overconstrained"];class a{constructor(i,{id:e="identifier",constraints:s={}}={}){this.contentHint="",this.readyState="live",this.isolated=!1,this.label="",this.muted=!1,this.onended=null,this.onisolationchange=null,this.onmute=null,this.onunmute=null,this.getConstraints=()=>this.constraints,this.stop=()=>{const t=Object.assign({},new Event(d));this._events.trigger(d,t),this.readyState=d,this.onended&&this.onended(t)},this.addEventListener=(t,i)=>{this._events.on(t,i)},this.removeEventListener=(t,i)=>{this._events.off(t,i)},this.id=`${e}-${i}-track`,this.kind=i,this.enabled=!0,this.constraints=Object.assign({},s),this._events=new t(r)}clone(){return Object.assign({},this)}getCapabilities(){return{width:{min:352,max:4096},height:{min:288,max:2160}}}getSettings(){var t,i,e,s,n,o,d,r,a,c,h,l,u,v,g,E;let p=0,_=0;return"object"==typeof(null===(t=this.constraints)||void 0===t?void 0:t.width)&&(null===(e=null===(i=this.constraints)||void 0===i?void 0:i.width)||void 0===e?void 0:e.ideal)?p=this.constraints.width.ideal:"object"==typeof(null===(s=this.constraints)||void 0===s?void 0:s.width)&&(null===(o=null===(n=this.constraints)||void 0===n?void 0:n.width)||void 0===o?void 0:o.exact)?p=this.constraints.width.exact:"number"==typeof(null===(d=this.constraints)||void 0===d?void 0:d.width)&&(null===(r=this.constraints)||void 0===r?void 0:r.width)&&(p=this.constraints.width),"object"==typeof(null===(a=this.constraints)||void 0===a?void 0:a.height)&&(null===(h=null===(c=this.constraints)||void 0===c?void 0:c.height)||void 0===h?void 0:h.ideal)?_=this.constraints.height.ideal:"object"==typeof(null===(l=this.constraints)||void 0===l?void 0:l.height)&&(null===(v=null===(u=this.constraints)||void 0===u?void 0:u.height)||void 0===v?void 0:v.exact)?_=this.constraints.height.exact:"number"==typeof(null===(g=this.constraints)||void 0===g?void 0:g.height)&&(null===(E=this.constraints)||void 0===E?void 0:E.height)&&(_=this.constraints.height),{width:p,height:_}}applyConstraints(t){return this.constraints=Object.assign({},t),Promise.resolve()}dispatchEvent(t){const i=t.type;return this._events.trigger(i,t),!0}}const c=t=>new a("audio",t),h=t=>new a("video",t),l=()=>c({id:"fromAudioContext",constraints:{}}),u=()=>h({id:"fromCanvas",constraints:{}}),v=[{id:"CIF",width:352,height:288,aspectRatio:4/3},{id:"360p",width:640,height:360,aspectRatio:16/9},{id:"720p",width:1280,height:720,aspectRatio:16/9},{id:"1080p",width:1920,height:1080,aspectRatio:16/9}],g="videoinput",E=({prefix:t,postfix:i="DeviceId",index:e})=>`${t}${i}${void 0===e?"":e}`;class p{constructor(t,i){this.kind=t,this.deviceId=E({index:i,prefix:t}),this.groupId=E({index:i,prefix:"groupId",postfix:t}),this.label=E({index:i,prefix:"label ",postfix:t})}toJSON(){return JSON.stringify(this)}}const _=t=>{const i=t.toLowerCase();let e=!1;return i.includes(g)?e=!0===global.DEVICES_USER_NOT_ACCESS.videoinput:i.includes("audioinput")?e=!0===global.DEVICES_USER_NOT_ACCESS.audioinput:i.includes("audiooutput")&&(e=!0===global.DEVICES_USER_NOT_ACCESS.audiooutput),e},S=t=>Object.assign({},t),I=t=>S(new p(g,t)),b=t=>S(new p("audioinput",t)),f=t=>S(new p("audiooutput",t)),m=()=>{switch(global.COUNT_DEVICES_AVAILABLE.videoinput){case 0:return[];case 1:return[I()];case 2:return[I(),I(2)];case 3:return[I(),I(2),I(3)];default:return[I()]}},D=()=>{switch(global.COUNT_DEVICES_AVAILABLE.audioinput){case 0:return[];case 1:return[b()];case 2:return[b(),b(2)];case 3:return[b(),b(2),b(3)];default:return[b()]}},C=()=>{switch(global.COUNT_DEVICES_AVAILABLE.audiooutput){case 0:return[];case 1:return[f()];case 2:return[f(),f(2)];case 3:return[f(),f(2),f(3)];default:return[f()]}},O=()=>[...m(),...D(),...C()],w=t=>{global.DEVICES_USER_NOT_ACCESS.videoinput=t},y=t=>{global.DEVICES_USER_NOT_ACCESS.audioinput=t},A=t=>{y(t),w(t)},N=v.filter((({id:t})=>"1080p"!==t)),V={[E({prefix:g})]:v,[E({prefix:g,index:1})]:v,[E({prefix:g,index:2})]:N},k=[d,"mute","unmute","isolationchange","overconstrained"];class x{constructor(i,{id:e="identifier",constraints:s={}}={}){this.contentHint="",this.readyState="live",this.isolated=!1,this.label="",this.muted=!1,this.onended=null,this.onisolationchange=null,this.onmute=null,this.onunmute=null,this.getConstraints=()=>this.constraints,this.stop=()=>{const t=Object.assign({},new Event(d));this._events.trigger(d,t),this.readyState=d,this.onended&&this.onended(t)},this.addEventListener=(t,i)=>{this._events.on(t,i)},this.removeEventListener=(t,i)=>{this._events.off(t,i)},this.id=`${e}-${i}-track`,this.kind=i,this.enabled=!0,this.constraints=Object.assign({},s),this._events=new t(k)}clone(){return Object.assign({},this)}getCapabilities(){return{width:{min:352,max:4096},height:{min:288,max:2160}}}getSettings(){var t,i,e,s,n,o,d,r,a,c,h,l,u,v,g,E;let p=0,_=0;return"object"==typeof(null===(t=this.constraints)||void 0===t?void 0:t.width)&&(null===(e=null===(i=this.constraints)||void 0===i?void 0:i.width)||void 0===e?void 0:e.ideal)?p=this.constraints.width.ideal:"object"==typeof(null===(s=this.constraints)||void 0===s?void 0:s.width)&&(null===(o=null===(n=this.constraints)||void 0===n?void 0:n.width)||void 0===o?void 0:o.exact)?p=this.constraints.width.exact:"number"==typeof(null===(d=this.constraints)||void 0===d?void 0:d.width)&&(null===(r=this.constraints)||void 0===r?void 0:r.width)&&(p=this.constraints.width),"object"==typeof(null===(a=this.constraints)||void 0===a?void 0:a.height)&&(null===(h=null===(c=this.constraints)||void 0===c?void 0:c.height)||void 0===h?void 0:h.ideal)?_=this.constraints.height.ideal:"object"==typeof(null===(l=this.constraints)||void 0===l?void 0:l.height)&&(null===(v=null===(u=this.constraints)||void 0===u?void 0:u.height)||void 0===v?void 0:v.exact)?_=this.constraints.height.exact:"number"==typeof(null===(g=this.constraints)||void 0===g?void 0:g.height)&&(null===(E=this.constraints)||void 0===E?void 0:E.height)&&(_=this.constraints.height),{width:p,height:_}}applyConstraints(t){return this.constraints=Object.assign({},t),Promise.resolve()}dispatchEvent(t){const i=t.type;return this._events.trigger(i,t),!0}}const j=["addtrack","removetrack"];let T=0;class U{constructor(i=[]){this.active=!0,this.getTracks=()=>this.tracks,this.getAudioTracks=()=>this.tracks.filter((({kind:t})=>"audio"===t)),this.getVideoTracks=()=>this.tracks.filter((({kind:t})=>"video"===t)),this.addTrack=t=>{this.tracks=[...this.tracks,t];const i=Object.assign(Object.assign({},new Event("addtrack")),{track:t});return this._events.trigger("addtrack",i),this.onaddtrack&&this.onaddtrack(i),this},this.addEventListener=(t,i)=>{this._events.on(t,i)},this.removeEventListener=(t,i)=>{this._events.off(t,i)},this.id=(T+=1,`identifier-${T}`),this.tracks=i,this._events=new t(j),this.onaddtrack=null,this.onremovetrack=null}removeTrack(t){this.tracks=this.tracks.filter((i=>i.id!==t.id));const i=Object.assign(Object.assign({},new Event("removetrack")),{track:t});return this._events.trigger("removetrack",i),this.onremovetrack&&this.onremovetrack(i),this}dispatchEvent(t){const i=t.type;return this._events.trigger(i,t),!0}clone(){return Object.assign({},this)}getTrackById(t){return this.tracks.find((i=>i.id===t))||null}}const B=()=>Promise.resolve(new U([l()])),L=()=>Promise.resolve(new U([u()])),P=(t,i={})=>{const{fromCanvas:e,fromAudioContext:s}=i,n=[];t.audio&&!s&&n.push(c({id:t.audio.deviceId.exact,deviceId:t.audio.deviceId,constraints:t.audio})),t.video&&!e&&n.push(h({id:t.video.deviceId.exact,deviceId:t.video.deviceId,constraints:t.video}));let o=new U(n);return e&&s?o=new U([u(),l()]):e?o.addTrack(u()):s&&o.addTrack(l()),o},R=t=>JSON.parse(JSON.stringify(t)),Y=t=>i(R,(i=>n(i,o(t))),e(s)(R)),M=Y("id"),F=t=>R(Object.assign(Object.assign({},t),{tracks:M(t.getTracks())})),$=t=>{const i=F(t);return delete i.id,i},H=({hasAccessDeviceAudioOutput:t=!1}={})=>O().map((i=>{let e;var s;return e="videoinput"===i.kind?Object.assign({resolutions:_(i.deviceId)?[]:(s=i.deviceId,V[s]),hasAccess:!_(i.deviceId)},i):"audioinput"===i.kind?Object.assign({hasAccess:!_(i.deviceId)},i):t?Object.assign({hasAccess:!0},i):Object.assign({},i),e})),J=["devicechange"];class q{constructor(){this.getUserMedia=t=>{var i,e;let s,n;if(t&&t.video&&"object"==typeof t.video&&"object"==typeof t.video.deviceId&&!Array.isArray(t.video.deviceId)?s=t.video.deviceId.exact:t&&!0===t.video&&O().find((({kind:t})=>t===g))?(s=null===(i=O().find((({kind:t})=>t===g)))||void 0===i?void 0:i.deviceId,t.video={deviceId:{exact:s}}):t&&!0===t.video&&(t.video={deviceId:{exact:"notAvailableDevice"}}),t&&t.audio&&"object"==typeof t.audio&&"object"==typeof t.audio.deviceId&&!Array.isArray(t.audio.deviceId)?n=t.audio.deviceId.exact:t&&!0===t.audio&&O().find((({kind:t})=>"audioinput"===t))?(n=null===(e=O().find((({kind:t})=>"audioinput"===t)))||void 0===e?void 0:e.deviceId,t.audio={deviceId:{exact:n}}):t&&!0===t.audio&&(t.audio={deviceId:{exact:"notAvailableDevice"}}),s&&"string"==typeof s&&(o=s,global.DEVICES_BUSY.videoinput.includes(o))){const t=(()=>{const t=new Error("Could not start video source");return t.name="NotReadableError",t})();return Promise.reject(t)}var o;if(s&&"string"==typeof s&&(t=>global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput.includes(t))(s)){const t=new Error("Permission denied by system");return Promise.reject(t)}if(s&&"string"==typeof s&&(t=>global.DEVICES_NOT_FOUND.videoinput.includes(t))(s)){const t=(()=>{const t=new Error;return t.name="NotFoundError",t})();return Promise.reject(t)}if(s&&"string"==typeof s&&_(s)||n&&"string"==typeof n&&_(n)){const t=new Error("Permission denied");return Promise.reject(t)}return s&&"string"==typeof s&&"object"==typeof t.video&&"object"==typeof t.video.height&&"object"==typeof t.video.height&&t.video.height&&t.video.height.exact&&!(({deviceId:t,exactHeight:i})=>{const e=V[t];return!e||0!==e.filter((({height:t})=>t===i)).length})({deviceId:s,exactHeight:t.video.height.exact})?Promise.reject(new Error(`Resolution height:${t.video.height.exact} is not available: ${s}`)):Promise.resolve(P(t))},this.enumerateDevices=()=>new Promise((t=>setTimeout((()=>{const i=O();return t(i)}),100))),this.addEventListener=(t,i)=>{this._events.on(t,i)},this.removeEventListener=(t,i)=>{this._events.off(t,i)},this.setCountVideoDevicesAvailable=t=>{((t=1)=>{global.COUNT_DEVICES_AVAILABLE.videoinput=t})(t),this._events.trigger("devicechange",void 0)},this.setCountAudioInDevicesAvailable=t=>{((t=1)=>{global.COUNT_DEVICES_AVAILABLE.audioinput=t})(t),this._events.trigger("devicechange",void 0)},this.setCountAudioOutDevicesAvailable=t=>{((t=1)=>{global.COUNT_DEVICES_AVAILABLE.audiooutput=t})(t),this._events.trigger("devicechange",void 0)},this.setBusyVideoDevice=t=>{(t=>{global.DEVICES_BUSY.videoinput.includes(t)||global.DEVICES_BUSY.videoinput.push(t)})(t)},this.setNotFoundVideoDevice=t=>{(t=>{global.DEVICES_NOT_FOUND.videoinput.includes(t)||global.DEVICES_NOT_FOUND.videoinput.push(t)})(t)},this.setPermissionDeniedBySystem=t=>{(t=>{global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput.includes(t)||global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput.push(t)})(t)},this.setUserNotAccessVideo=(t=!0)=>{w(t)},this.setUserNotAccessAudioIn=(t=!0)=>{y(t)},this.setUserNotAccessAll=(t=!0)=>{A(t)},this.unsetAllRestrictions=()=>{global.DEVICES_BUSY.videoinput=[],global.DEVICES_NOT_FOUND.videoinput=[],global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput=[],A(!1)},this.unsetBusyVideoDevice=t=>{(t=>{global.DEVICES_BUSY.videoinput=global.DEVICES_BUSY.videoinput.filter((i=>i!==t))})(t)},this.unsetNotFoundVideoDevice=t=>{(t=>{global.DEVICES_NOT_FOUND.videoinput=global.DEVICES_NOT_FOUND.videoinput.filter((i=>i!==t))})(t)},this.unsetPermissionDeniedBySystem=t=>{(t=>{global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput=global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput.filter((i=>i!==t))})(t)},this._events=new t(J),this.getDisplayMedia=this.getUserMedia}}const z=()=>{global.MediaStream=U,global.navigator.mediaDevices=new q,global.COUNT_DEVICES_AVAILABLE={[g]:1,audioinput:1,audiooutput:1},global.DEVICES_USER_NOT_ACCESS={[g]:!1,audioinput:!1,audiooutput:!1},global.DEVICES_BUSY={[g]:[]},global.DEVICES_NOT_FOUND={[g]:[]},global.DEVICES_PERMISSION_DENIED_BY_SYSTEM={[g]:[]}};export{U as MediaStreamMock,x as MediaStreamTrackMock,l as createAudioContextAudioMediaStreamTrackMock,c as createAudioMediaStreamTrackMock,u as createCanvasVideoMediaStreamTrackMock,P as createMediaStreamMock,h as createVideoMediaStreamTrackMock,z as doMock,B as getAudioContextMediaStreamMock,O as getAvailableDevices,H as getAvailableDevicesWithResolutions,L as getCanvasMediaStreamMock,F as parseMediaStream,$ as parseMediaStreamWithoutId,R as parseObject,M as parseTracks,v as resolutionsList,Y as resolveParseArray};
//# sourceMappingURL=index.es5.js.map

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("events-constructor"),require("lodash/flow"),require("lodash/curryRight"),require("lodash/map"),require("lodash/sortBy"),require("lodash/property")):"function"==typeof define&&define.amd?define(["exports","events-constructor","lodash/flow","lodash/curryRight","lodash/map","lodash/sortBy","lodash/property"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).webrtcMock={},t.Events,t.flow,t.curryRight,t.map,t.sortBy,t.property)}(this,(function(t,e,i,s,o,n,d){"use strict";function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=r(e),c=r(i),l=r(s),h=r(o),u=r(n),v=r(d);const g="ended",E="mute",p="isolationchange",S="overconstrained",_="unmute",f="devicechange",b="addtrack",I="removetrack",m=[g,E,_,p,S];class C{constructor(t,{id:e="identifier",constraints:i={}}={}){this.contentHint="",this.readyState="live",this.isolated=!1,this.label="",this.muted=!1,this.onended=null,this.onisolationchange=null,this.onmute=null,this.onunmute=null,this.getConstraints=()=>this.constraints,this.stop=()=>{const t=Object.assign({},new Event(g));this._events.trigger(g,t),this.readyState=g,this.onended&&this.onended(t)},this.addEventListener=(t,e)=>{this._events.on(t,e)},this.removeEventListener=(t,e)=>{this._events.off(t,e)},this.id=`${e}-${t}-track`,this.kind=t,this.enabled=!0,this.constraints=Object.assign({},i),this._events=new a.default(m)}clone(){return Object.assign({},this)}getCapabilities(){return{width:{min:352,max:4096},height:{min:288,max:2160}}}getSettings(){var t,e,i,s,o,n,d,r,a,c,l,h,u,v,g,E;let p=0,S=0;return"object"==typeof(null===(t=this.constraints)||void 0===t?void 0:t.width)&&(null===(i=null===(e=this.constraints)||void 0===e?void 0:e.width)||void 0===i?void 0:i.ideal)?p=this.constraints.width.ideal:"object"==typeof(null===(s=this.constraints)||void 0===s?void 0:s.width)&&(null===(n=null===(o=this.constraints)||void 0===o?void 0:o.width)||void 0===n?void 0:n.exact)?p=this.constraints.width.exact:"number"==typeof(null===(d=this.constraints)||void 0===d?void 0:d.width)&&(null===(r=this.constraints)||void 0===r?void 0:r.width)&&(p=this.constraints.width),"object"==typeof(null===(a=this.constraints)||void 0===a?void 0:a.height)&&(null===(l=null===(c=this.constraints)||void 0===c?void 0:c.height)||void 0===l?void 0:l.ideal)?S=this.constraints.height.ideal:"object"==typeof(null===(h=this.constraints)||void 0===h?void 0:h.height)&&(null===(v=null===(u=this.constraints)||void 0===u?void 0:u.height)||void 0===v?void 0:v.exact)?S=this.constraints.height.exact:"number"==typeof(null===(g=this.constraints)||void 0===g?void 0:g.height)&&(null===(E=this.constraints)||void 0===E?void 0:E.height)&&(S=this.constraints.height),{width:p,height:S}}applyConstraints(t){return this.constraints=Object.assign({},t),Promise.resolve()}dispatchEvent(t){const e=t.type;return this._events.trigger(e,t),!0}}const D=t=>new C("audio",t),y=t=>new C("video",t),O=()=>D({id:"fromAudioContext",constraints:{}}),w=()=>y({id:"fromCanvas",constraints:{}}),k=[{id:"CIF",width:352,height:288,aspectRatio:4/3},{id:"360p",width:640,height:360,aspectRatio:16/9},{id:"720p",width:1280,height:720,aspectRatio:16/9},{id:"1080p",width:1920,height:1080,aspectRatio:16/9}],A="videoinput",N="audioinput",V="audiooutput",x=({prefix:t,postfix:e="DeviceId",index:i})=>`${t}${e}${void 0===i?"":i}`;class T{constructor(t,e){this.kind=t,this.deviceId=x({index:e,prefix:t}),this.groupId=x({index:e,prefix:"groupId",postfix:t}),this.label=x({index:e,prefix:"label ",postfix:t})}toJSON(){throw new Error("Method not implemented.")}}const j=t=>{const e=t.toLowerCase();let i=!1;return e.includes(A)?i=!0===global.DEVICES_USER_NOT_ACCESS.videoinput:e.includes(N)?i=!0===global.DEVICES_USER_NOT_ACCESS.audioinput:e.includes(V)&&(i=!0===global.DEVICES_USER_NOT_ACCESS.audiooutput),i},M=t=>Object.assign({},t),U=t=>M(new T(A,t)),B=t=>M(new T(N,t)),L=t=>M(new T(V,t)),P=()=>{switch(global.COUNT_DEVICES_AVAILABLE.videoinput){case 0:return[];case 1:return[U()];case 2:return[U(),U(2)];case 3:return[U(),U(2),U(3)];default:return[U()]}},R=()=>{switch(global.COUNT_DEVICES_AVAILABLE.audioinput){case 0:return[];case 1:return[B()];case 2:return[B(),B(2)];case 3:return[B(),B(2),B(3)];default:return[B()]}},Y=()=>{switch(global.COUNT_DEVICES_AVAILABLE.audiooutput){case 0:return[];case 1:return[L()];case 2:return[L(),L(2)];case 3:return[L(),L(2),L(3)];default:return[L()]}},F=()=>[...P(),...R(),...Y()],$=t=>{global.DEVICES_USER_NOT_ACCESS.videoinput=t},q=t=>{global.DEVICES_USER_NOT_ACCESS.audioinput=t},H=t=>{q(t),$(t)},J=k.filter((({id:t})=>"1080p"!==t)),W={[x({prefix:A})]:k,[x({prefix:A,index:1})]:k,[x({prefix:A,index:2})]:J},z=[g,E,_,p,S];const G=[b,I];let K=0;class Q{constructor(t=[]){this.active=!0,this.getTracks=()=>this.tracks,this.getAudioTracks=()=>this.tracks.filter((({kind:t})=>"audio"===t)),this.getVideoTracks=()=>this.tracks.filter((({kind:t})=>"video"===t)),this.addTrack=t=>{this.tracks=[...this.tracks,t];const e=Object.assign(Object.assign({},new Event(b)),{track:t});return this._events.trigger(b,e),this.onaddtrack&&this.onaddtrack(e),this},this.addEventListener=(t,e)=>{this._events.on(t,e)},this.removeEventListener=(t,e)=>{this._events.off(t,e)},this.id=(K+=1,`identifier-${K}`),this.tracks=t,this._events=new a.default(G),this.onaddtrack=null,this.onremovetrack=null}removeTrack(t){this.tracks=this.tracks.filter((e=>e.id!==t.id));const e=Object.assign(Object.assign({},new Event(I)),{track:t});return this._events.trigger(I,e),this.onremovetrack&&this.onremovetrack(e),this}dispatchEvent(t){const e=t.type;return this._events.trigger(e,t),!0}clone(){return Object.assign({},this)}getTrackById(t){return this.tracks.find((e=>e.id===t))||null}}const X=(t,e={})=>{const{fromCanvas:i,fromAudioContext:s}=e,o=[];t.audio&&!s&&o.push(D({id:t.audio.deviceId.exact,deviceId:t.audio.deviceId,constraints:t.audio})),t.video&&!i&&o.push(y({id:t.video.deviceId.exact,deviceId:t.video.deviceId,constraints:t.video}));let n=new Q(o);return i&&s?n=new Q([w(),O()]):i?n.addTrack(w()):s&&n.addTrack(O()),n},Z=t=>JSON.parse(JSON.stringify(t)),tt=t=>c.default(Z,(e=>u.default(e,v.default(t))),l.default(h.default)(Z)),et=tt("id"),it=t=>Z(Object.assign(Object.assign({},t),{tracks:et(t.getTracks())})),st=[f];class ot{constructor(){this.getUserMedia=t=>{var e,i;let s,o;if(t&&t.video&&"object"==typeof t.video&&"object"==typeof t.video.deviceId&&!Array.isArray(t.video.deviceId)?s=t.video.deviceId.exact:t&&!0===t.video&&F().find((({kind:t})=>t===A))?(s=null===(e=F().find((({kind:t})=>t===A)))||void 0===e?void 0:e.deviceId,t.video={deviceId:{exact:s}}):t&&!0===t.video&&(t.video={deviceId:{exact:"notAvailableDevice"}}),t&&t.audio&&"object"==typeof t.audio&&"object"==typeof t.audio.deviceId&&!Array.isArray(t.audio.deviceId)?o=t.audio.deviceId.exact:t&&!0===t.audio&&F().find((({kind:t})=>t===N))?(o=null===(i=F().find((({kind:t})=>t===N)))||void 0===i?void 0:i.deviceId,t.audio={deviceId:{exact:o}}):t&&!0===t.audio&&(t.audio={deviceId:{exact:"notAvailableDevice"}}),s&&"string"==typeof s&&(n=s,global.DEVICES_BUSY.videoinput.includes(n))){const t=(()=>{const t=new Error("Could not start video source");return t.name="NotReadableError",t})();return Promise.reject(t)}var n;if(s&&"string"==typeof s&&(t=>global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput.includes(t))(s)){const t=new Error("Permission denied by system");return Promise.reject(t)}if(s&&"string"==typeof s&&(t=>global.DEVICES_NOT_FOUND.videoinput.includes(t))(s)){const t=(()=>{const t=new Error;return t.name="NotFoundError",t})();return Promise.reject(t)}if(s&&"string"==typeof s&&j(s)||o&&"string"==typeof o&&j(o)){const t=new Error("Permission denied");return Promise.reject(t)}return s&&"string"==typeof s&&"object"==typeof t.video&&"object"==typeof t.video.height&&"object"==typeof t.video.height&&t.video.height&&t.video.height.exact&&!(({deviceId:t,exactHeight:e})=>{const i=W[t];return!i||0!==i.filter((({height:t})=>t===e)).length})({deviceId:s,exactHeight:t.video.height.exact})?Promise.reject(new Error(`Resolution height:${t.video.height.exact} is not available: ${s}`)):Promise.resolve(X(t))},this.enumerateDevices=()=>new Promise((t=>setTimeout((()=>t(F())),100))),this.addEventListener=(t,e)=>{this._events.on(t,e)},this.removeEventListener=(t,e)=>{this._events.off(t,e)},this.setCountVideoDevicesAvailable=t=>{((t=1)=>{global.COUNT_DEVICES_AVAILABLE.videoinput=t})(t),this._events.trigger(f,void 0)},this.setCountAudioInDevicesAvailable=t=>{((t=1)=>{global.COUNT_DEVICES_AVAILABLE.audioinput=t})(t),this._events.trigger(f,void 0)},this.setCountAudioOutDevicesAvailable=t=>{((t=1)=>{global.COUNT_DEVICES_AVAILABLE.audiooutput=t})(t),this._events.trigger(f,void 0)},this.setBusyVideoDevice=t=>{(t=>{global.DEVICES_BUSY.videoinput.includes(t)||global.DEVICES_BUSY.videoinput.push(t)})(t)},this.setNotFoundVideoDevice=t=>{(t=>{global.DEVICES_NOT_FOUND.videoinput.includes(t)||global.DEVICES_NOT_FOUND.videoinput.push(t)})(t)},this.setPermissionDeniedBySystem=t=>{(t=>{global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput.includes(t)||global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput.push(t)})(t)},this.setUserNotAccessVideo=(t=!0)=>{$(t)},this.setUserNotAccessAudioIn=(t=!0)=>{q(t)},this.setUserNotAccessAll=(t=!0)=>{H(t)},this.unsetAllRestrictions=()=>{global.DEVICES_BUSY.videoinput=[],global.DEVICES_NOT_FOUND.videoinput=[],global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput=[],H(!1)},this.unsetBusyVideoDevice=t=>{(t=>{global.DEVICES_BUSY.videoinput=global.DEVICES_BUSY.videoinput.filter((e=>e!==t))})(t)},this.unsetNotFoundVideoDevice=t=>{(t=>{global.DEVICES_NOT_FOUND.videoinput=global.DEVICES_NOT_FOUND.videoinput.filter((e=>e!==t))})(t)},this.unsetPermissionDeniedBySystem=t=>{(t=>{global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput=global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput.filter((e=>e!==t))})(t)},this._events=new a.default(st),this.getDisplayMedia=this.getUserMedia}}t.MediaStreamMock=Q,t.MediaStreamTrackMock=class{constructor(t,{id:e="identifier",constraints:i={}}={}){this.contentHint="",this.readyState="live",this.isolated=!1,this.label="",this.muted=!1,this.onended=null,this.onisolationchange=null,this.onmute=null,this.onunmute=null,this.getConstraints=()=>this.constraints,this.stop=()=>{const t=Object.assign({},new Event(g));this._events.trigger(g,t),this.readyState=g,this.onended&&this.onended(t)},this.addEventListener=(t,e)=>{this._events.on(t,e)},this.removeEventListener=(t,e)=>{this._events.off(t,e)},this.id=`${e}-${t}-track`,this.kind=t,this.enabled=!0,this.constraints=Object.assign({},i),this._events=new a.default(z)}clone(){return Object.assign({},this)}getCapabilities(){return{width:{min:352,max:4096},height:{min:288,max:2160}}}getSettings(){var t,e,i,s,o,n,d,r,a,c,l,h,u,v,g,E;let p=0,S=0;return"object"==typeof(null===(t=this.constraints)||void 0===t?void 0:t.width)&&(null===(i=null===(e=this.constraints)||void 0===e?void 0:e.width)||void 0===i?void 0:i.ideal)?p=this.constraints.width.ideal:"object"==typeof(null===(s=this.constraints)||void 0===s?void 0:s.width)&&(null===(n=null===(o=this.constraints)||void 0===o?void 0:o.width)||void 0===n?void 0:n.exact)?p=this.constraints.width.exact:"number"==typeof(null===(d=this.constraints)||void 0===d?void 0:d.width)&&(null===(r=this.constraints)||void 0===r?void 0:r.width)&&(p=this.constraints.width),"object"==typeof(null===(a=this.constraints)||void 0===a?void 0:a.height)&&(null===(l=null===(c=this.constraints)||void 0===c?void 0:c.height)||void 0===l?void 0:l.ideal)?S=this.constraints.height.ideal:"object"==typeof(null===(h=this.constraints)||void 0===h?void 0:h.height)&&(null===(v=null===(u=this.constraints)||void 0===u?void 0:u.height)||void 0===v?void 0:v.exact)?S=this.constraints.height.exact:"number"==typeof(null===(g=this.constraints)||void 0===g?void 0:g.height)&&(null===(E=this.constraints)||void 0===E?void 0:E.height)&&(S=this.constraints.height),{width:p,height:S}}applyConstraints(t){return this.constraints=Object.assign({},t),Promise.resolve()}dispatchEvent(t){const e=t.type;return this._events.trigger(e,t),!0}},t.createAudioContextAudioMediaStreamTrackMock=O,t.createAudioMediaStreamTrackMock=D,t.createCanvasVideoMediaStreamTrackMock=w,t.createMediaStreamMock=X,t.createVideoMediaStreamTrackMock=y,t.doMock=()=>{global.MediaStream=Q,global.navigator.mediaDevices=new ot,global.COUNT_DEVICES_AVAILABLE={[A]:1,[N]:1,[V]:1},global.DEVICES_USER_NOT_ACCESS={[A]:!1,[N]:!1,[V]:!1},global.DEVICES_BUSY={[A]:[]},global.DEVICES_NOT_FOUND={[A]:[]},global.DEVICES_PERMISSION_DENIED_BY_SYSTEM={[A]:[]}},t.getAudioContextMediaStreamMock=()=>Promise.resolve(new Q([O()])),t.getAvailableDevices=F,t.getAvailableDevicesWithResolutions=({hasAccessDeviceAudioOutput:t=!1}={})=>F().map((e=>{let i;var s;return i="videoinput"===e.kind?Object.assign({resolutions:j(e.deviceId)?[]:(s=e.deviceId,W[s]),hasAccess:!j(e.deviceId)},e):"audioinput"===e.kind?Object.assign({hasAccess:!j(e.deviceId)},e):t?Object.assign({hasAccess:!0},e):Object.assign({},e),i})),t.getCanvasMediaStreamMock=()=>Promise.resolve(new Q([w()])),t.parseMediaStream=it,t.parseMediaStreamWithoutId=t=>{const e=it(t);return delete e.id,e},t.parseObject=Z,t.parseTracks=et,t.resolutionsList=k,t.resolveParseArray=tt,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("events-constructor"),require("lodash/flow"),require("lodash/curryRight"),require("lodash/map"),require("lodash/sortBy"),require("lodash/property")):"function"==typeof define&&define.amd?define(["exports","events-constructor","lodash/flow","lodash/curryRight","lodash/map","lodash/sortBy","lodash/property"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).webrtcMock={},t.Events,t.flow,t.curryRight,t.map,t.sortBy,t.property)}(this,(function(t,e,i,s,o,n,d){"use strict";function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=r(e),c=r(i),l=r(s),h=r(o),u=r(n),v=r(d);const g="ended",E="mute",p="isolationchange",S="overconstrained",_="unmute",f="devicechange",b="addtrack",I="removetrack",m=[g,E,_,p,S];class C{constructor(t,{id:e="identifier",constraints:i={}}={}){this.contentHint="",this.readyState="live",this.isolated=!1,this.label="",this.muted=!1,this.onended=null,this.onisolationchange=null,this.onmute=null,this.onunmute=null,this.getConstraints=()=>this.constraints,this.stop=()=>{const t=Object.assign({},new Event(g));this._events.trigger(g,t),this.readyState=g,this.onended&&this.onended(t)},this.addEventListener=(t,e)=>{this._events.on(t,e)},this.removeEventListener=(t,e)=>{this._events.off(t,e)},this.id=`${e}-${t}-track`,this.kind=t,this.enabled=!0,this.constraints=Object.assign({},i),this._events=new a.default(m)}clone(){return Object.assign({},this)}getCapabilities(){return{width:{min:352,max:4096},height:{min:288,max:2160}}}getSettings(){var t,e,i,s,o,n,d,r,a,c,l,h,u,v,g,E;let p=0,S=0;return"object"==typeof(null===(t=this.constraints)||void 0===t?void 0:t.width)&&(null===(i=null===(e=this.constraints)||void 0===e?void 0:e.width)||void 0===i?void 0:i.ideal)?p=this.constraints.width.ideal:"object"==typeof(null===(s=this.constraints)||void 0===s?void 0:s.width)&&(null===(n=null===(o=this.constraints)||void 0===o?void 0:o.width)||void 0===n?void 0:n.exact)?p=this.constraints.width.exact:"number"==typeof(null===(d=this.constraints)||void 0===d?void 0:d.width)&&(null===(r=this.constraints)||void 0===r?void 0:r.width)&&(p=this.constraints.width),"object"==typeof(null===(a=this.constraints)||void 0===a?void 0:a.height)&&(null===(l=null===(c=this.constraints)||void 0===c?void 0:c.height)||void 0===l?void 0:l.ideal)?S=this.constraints.height.ideal:"object"==typeof(null===(h=this.constraints)||void 0===h?void 0:h.height)&&(null===(v=null===(u=this.constraints)||void 0===u?void 0:u.height)||void 0===v?void 0:v.exact)?S=this.constraints.height.exact:"number"==typeof(null===(g=this.constraints)||void 0===g?void 0:g.height)&&(null===(E=this.constraints)||void 0===E?void 0:E.height)&&(S=this.constraints.height),{width:p,height:S}}applyConstraints(t){return this.constraints=Object.assign({},t),Promise.resolve()}dispatchEvent(t){const e=t.type;return this._events.trigger(e,t),!0}}const D=t=>new C("audio",t),y=t=>new C("video",t),O=()=>D({id:"fromAudioContext",constraints:{}}),k=()=>y({id:"fromCanvas",constraints:{}}),A=[{id:"CIF",width:352,height:288,aspectRatio:4/3},{id:"360p",width:640,height:360,aspectRatio:16/9},{id:"720p",width:1280,height:720,aspectRatio:16/9},{id:"1080p",width:1920,height:1080,aspectRatio:16/9}],w="videoinput",N="audioinput",V="audiooutput",x=({prefix:t,postfix:e="DeviceId",index:i})=>`${t}${e}${void 0===i?"":i}`;class T{constructor(t,e){this.kind=t,this.deviceId=x({index:e,prefix:t}),this.groupId=x({index:e,prefix:"groupId",postfix:t}),this.label=x({index:e,prefix:"label ",postfix:t})}toJSON(){return JSON.stringify(this)}}const j=t=>{const e=t.toLowerCase();let i=!1;return e.includes(w)?i=!0===global.DEVICES_USER_NOT_ACCESS.videoinput:e.includes(N)?i=!0===global.DEVICES_USER_NOT_ACCESS.audioinput:e.includes(V)&&(i=!0===global.DEVICES_USER_NOT_ACCESS.audiooutput),i},M=t=>Object.assign({},t),U=t=>M(new T(w,t)),B=t=>M(new T(N,t)),L=t=>M(new T(V,t)),P=()=>{switch(global.COUNT_DEVICES_AVAILABLE.videoinput){case 0:return[];case 1:return[U()];case 2:return[U(),U(2)];case 3:return[U(),U(2),U(3)];default:return[U()]}},R=()=>{switch(global.COUNT_DEVICES_AVAILABLE.audioinput){case 0:return[];case 1:return[B()];case 2:return[B(),B(2)];case 3:return[B(),B(2),B(3)];default:return[B()]}},Y=()=>{switch(global.COUNT_DEVICES_AVAILABLE.audiooutput){case 0:return[];case 1:return[L()];case 2:return[L(),L(2)];case 3:return[L(),L(2),L(3)];default:return[L()]}},F=()=>[...P(),...R(),...Y()],$=t=>{global.DEVICES_USER_NOT_ACCESS.videoinput=t},q=t=>{global.DEVICES_USER_NOT_ACCESS.audioinput=t},H=t=>{q(t),$(t)},J=A.filter((({id:t})=>"1080p"!==t)),W={[x({prefix:w})]:A,[x({prefix:w,index:1})]:A,[x({prefix:w,index:2})]:J},z=[g,E,_,p,S];const G=[b,I];let K=0;class Q{constructor(t=[]){this.active=!0,this.getTracks=()=>this.tracks,this.getAudioTracks=()=>this.tracks.filter((({kind:t})=>"audio"===t)),this.getVideoTracks=()=>this.tracks.filter((({kind:t})=>"video"===t)),this.addTrack=t=>{this.tracks=[...this.tracks,t];const e=Object.assign(Object.assign({},new Event(b)),{track:t});return this._events.trigger(b,e),this.onaddtrack&&this.onaddtrack(e),this},this.addEventListener=(t,e)=>{this._events.on(t,e)},this.removeEventListener=(t,e)=>{this._events.off(t,e)},this.id=(K+=1,`identifier-${K}`),this.tracks=t,this._events=new a.default(G),this.onaddtrack=null,this.onremovetrack=null}removeTrack(t){this.tracks=this.tracks.filter((e=>e.id!==t.id));const e=Object.assign(Object.assign({},new Event(I)),{track:t});return this._events.trigger(I,e),this.onremovetrack&&this.onremovetrack(e),this}dispatchEvent(t){const e=t.type;return this._events.trigger(e,t),!0}clone(){return Object.assign({},this)}getTrackById(t){return this.tracks.find((e=>e.id===t))||null}}const X=(t,e={})=>{const{fromCanvas:i,fromAudioContext:s}=e,o=[];t.audio&&!s&&o.push(D({id:t.audio.deviceId.exact,deviceId:t.audio.deviceId,constraints:t.audio})),t.video&&!i&&o.push(y({id:t.video.deviceId.exact,deviceId:t.video.deviceId,constraints:t.video}));let n=new Q(o);return i&&s?n=new Q([k(),O()]):i?n.addTrack(k()):s&&n.addTrack(O()),n},Z=t=>JSON.parse(JSON.stringify(t)),tt=t=>c.default(Z,(e=>u.default(e,v.default(t))),l.default(h.default)(Z)),et=tt("id"),it=t=>Z(Object.assign(Object.assign({},t),{tracks:et(t.getTracks())})),st=[f];class ot{constructor(){this.getUserMedia=t=>{var e,i;let s,o;if(t&&t.video&&"object"==typeof t.video&&"object"==typeof t.video.deviceId&&!Array.isArray(t.video.deviceId)?s=t.video.deviceId.exact:t&&!0===t.video&&F().find((({kind:t})=>t===w))?(s=null===(e=F().find((({kind:t})=>t===w)))||void 0===e?void 0:e.deviceId,t.video={deviceId:{exact:s}}):t&&!0===t.video&&(t.video={deviceId:{exact:"notAvailableDevice"}}),t&&t.audio&&"object"==typeof t.audio&&"object"==typeof t.audio.deviceId&&!Array.isArray(t.audio.deviceId)?o=t.audio.deviceId.exact:t&&!0===t.audio&&F().find((({kind:t})=>t===N))?(o=null===(i=F().find((({kind:t})=>t===N)))||void 0===i?void 0:i.deviceId,t.audio={deviceId:{exact:o}}):t&&!0===t.audio&&(t.audio={deviceId:{exact:"notAvailableDevice"}}),s&&"string"==typeof s&&(n=s,global.DEVICES_BUSY.videoinput.includes(n))){const t=(()=>{const t=new Error("Could not start video source");return t.name="NotReadableError",t})();return Promise.reject(t)}var n;if(s&&"string"==typeof s&&(t=>global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput.includes(t))(s)){const t=new Error("Permission denied by system");return Promise.reject(t)}if(s&&"string"==typeof s&&(t=>global.DEVICES_NOT_FOUND.videoinput.includes(t))(s)){const t=(()=>{const t=new Error;return t.name="NotFoundError",t})();return Promise.reject(t)}if(s&&"string"==typeof s&&j(s)||o&&"string"==typeof o&&j(o)){const t=new Error("Permission denied");return Promise.reject(t)}return s&&"string"==typeof s&&"object"==typeof t.video&&"object"==typeof t.video.height&&"object"==typeof t.video.height&&t.video.height&&t.video.height.exact&&!(({deviceId:t,exactHeight:e})=>{const i=W[t];return!i||0!==i.filter((({height:t})=>t===e)).length})({deviceId:s,exactHeight:t.video.height.exact})?Promise.reject(new Error(`Resolution height:${t.video.height.exact} is not available: ${s}`)):Promise.resolve(X(t))},this.enumerateDevices=()=>new Promise((t=>setTimeout((()=>{const e=F();return t(e)}),100))),this.addEventListener=(t,e)=>{this._events.on(t,e)},this.removeEventListener=(t,e)=>{this._events.off(t,e)},this.setCountVideoDevicesAvailable=t=>{((t=1)=>{global.COUNT_DEVICES_AVAILABLE.videoinput=t})(t),this._events.trigger(f,void 0)},this.setCountAudioInDevicesAvailable=t=>{((t=1)=>{global.COUNT_DEVICES_AVAILABLE.audioinput=t})(t),this._events.trigger(f,void 0)},this.setCountAudioOutDevicesAvailable=t=>{((t=1)=>{global.COUNT_DEVICES_AVAILABLE.audiooutput=t})(t),this._events.trigger(f,void 0)},this.setBusyVideoDevice=t=>{(t=>{global.DEVICES_BUSY.videoinput.includes(t)||global.DEVICES_BUSY.videoinput.push(t)})(t)},this.setNotFoundVideoDevice=t=>{(t=>{global.DEVICES_NOT_FOUND.videoinput.includes(t)||global.DEVICES_NOT_FOUND.videoinput.push(t)})(t)},this.setPermissionDeniedBySystem=t=>{(t=>{global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput.includes(t)||global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput.push(t)})(t)},this.setUserNotAccessVideo=(t=!0)=>{$(t)},this.setUserNotAccessAudioIn=(t=!0)=>{q(t)},this.setUserNotAccessAll=(t=!0)=>{H(t)},this.unsetAllRestrictions=()=>{global.DEVICES_BUSY.videoinput=[],global.DEVICES_NOT_FOUND.videoinput=[],global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput=[],H(!1)},this.unsetBusyVideoDevice=t=>{(t=>{global.DEVICES_BUSY.videoinput=global.DEVICES_BUSY.videoinput.filter((e=>e!==t))})(t)},this.unsetNotFoundVideoDevice=t=>{(t=>{global.DEVICES_NOT_FOUND.videoinput=global.DEVICES_NOT_FOUND.videoinput.filter((e=>e!==t))})(t)},this.unsetPermissionDeniedBySystem=t=>{(t=>{global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput=global.DEVICES_PERMISSION_DENIED_BY_SYSTEM.videoinput.filter((e=>e!==t))})(t)},this._events=new a.default(st),this.getDisplayMedia=this.getUserMedia}}t.MediaStreamMock=Q,t.MediaStreamTrackMock=class{constructor(t,{id:e="identifier",constraints:i={}}={}){this.contentHint="",this.readyState="live",this.isolated=!1,this.label="",this.muted=!1,this.onended=null,this.onisolationchange=null,this.onmute=null,this.onunmute=null,this.getConstraints=()=>this.constraints,this.stop=()=>{const t=Object.assign({},new Event(g));this._events.trigger(g,t),this.readyState=g,this.onended&&this.onended(t)},this.addEventListener=(t,e)=>{this._events.on(t,e)},this.removeEventListener=(t,e)=>{this._events.off(t,e)},this.id=`${e}-${t}-track`,this.kind=t,this.enabled=!0,this.constraints=Object.assign({},i),this._events=new a.default(z)}clone(){return Object.assign({},this)}getCapabilities(){return{width:{min:352,max:4096},height:{min:288,max:2160}}}getSettings(){var t,e,i,s,o,n,d,r,a,c,l,h,u,v,g,E;let p=0,S=0;return"object"==typeof(null===(t=this.constraints)||void 0===t?void 0:t.width)&&(null===(i=null===(e=this.constraints)||void 0===e?void 0:e.width)||void 0===i?void 0:i.ideal)?p=this.constraints.width.ideal:"object"==typeof(null===(s=this.constraints)||void 0===s?void 0:s.width)&&(null===(n=null===(o=this.constraints)||void 0===o?void 0:o.width)||void 0===n?void 0:n.exact)?p=this.constraints.width.exact:"number"==typeof(null===(d=this.constraints)||void 0===d?void 0:d.width)&&(null===(r=this.constraints)||void 0===r?void 0:r.width)&&(p=this.constraints.width),"object"==typeof(null===(a=this.constraints)||void 0===a?void 0:a.height)&&(null===(l=null===(c=this.constraints)||void 0===c?void 0:c.height)||void 0===l?void 0:l.ideal)?S=this.constraints.height.ideal:"object"==typeof(null===(h=this.constraints)||void 0===h?void 0:h.height)&&(null===(v=null===(u=this.constraints)||void 0===u?void 0:u.height)||void 0===v?void 0:v.exact)?S=this.constraints.height.exact:"number"==typeof(null===(g=this.constraints)||void 0===g?void 0:g.height)&&(null===(E=this.constraints)||void 0===E?void 0:E.height)&&(S=this.constraints.height),{width:p,height:S}}applyConstraints(t){return this.constraints=Object.assign({},t),Promise.resolve()}dispatchEvent(t){const e=t.type;return this._events.trigger(e,t),!0}},t.createAudioContextAudioMediaStreamTrackMock=O,t.createAudioMediaStreamTrackMock=D,t.createCanvasVideoMediaStreamTrackMock=k,t.createMediaStreamMock=X,t.createVideoMediaStreamTrackMock=y,t.doMock=()=>{global.MediaStream=Q,global.navigator.mediaDevices=new ot,global.COUNT_DEVICES_AVAILABLE={[w]:1,[N]:1,[V]:1},global.DEVICES_USER_NOT_ACCESS={[w]:!1,[N]:!1,[V]:!1},global.DEVICES_BUSY={[w]:[]},global.DEVICES_NOT_FOUND={[w]:[]},global.DEVICES_PERMISSION_DENIED_BY_SYSTEM={[w]:[]}},t.getAudioContextMediaStreamMock=()=>Promise.resolve(new Q([O()])),t.getAvailableDevices=F,t.getAvailableDevicesWithResolutions=({hasAccessDeviceAudioOutput:t=!1}={})=>F().map((e=>{let i;var s;return i="videoinput"===e.kind?Object.assign({resolutions:j(e.deviceId)?[]:(s=e.deviceId,W[s]),hasAccess:!j(e.deviceId)},e):"audioinput"===e.kind?Object.assign({hasAccess:!j(e.deviceId)},e):t?Object.assign({hasAccess:!0},e):Object.assign({},e),i})),t.getCanvasMediaStreamMock=()=>Promise.resolve(new Q([k()])),t.parseMediaStream=it,t.parseMediaStreamWithoutId=t=>{const e=it(t);return delete e.id,e},t.parseObject=Z,t.parseTracks=et,t.resolutionsList=A,t.resolveParseArray=tt,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.umd.js.map

@@ -10,3 +10,3 @@ declare type TEventNames = typeof eventsNames;

getUserMedia: (constraints: MediaStreamConstraints) => Promise<import("./MediaStreamMock").default>;
enumerateDevices: () => Promise<unknown>;
enumerateDevices: () => Promise<MediaDeviceInfo[]>;
addEventListener: (eventName: TEventName, handler: THandler) => void;

@@ -13,0 +13,0 @@ removeEventListener: (eventName: TEventName, handler: THandler) => void;

@@ -116,3 +116,4 @@ "use strict";

return setTimeout(() => {
return resolve((0, devicesMock_1.getAvailableDevices)());
const availableDevices = (0, devicesMock_1.getAvailableDevices)();
return resolve(availableDevices);
}, 100);

@@ -119,0 +120,0 @@ });

{
"name": "webrtc-mock",
"version": "0.0.10",
"version": "0.0.11",
"description": "Classes and functions mock webrtc api for tests",

@@ -44,29 +44,29 @@ "keywords": [

"lodash": "^4.17.21",
"events-constructor": "^1.1.4"
"events-constructor": "^1.2.0"
},
"devDependencies": {
"@commitlint/cli": "^16.2.3",
"@commitlint/config-conventional": "^16.2.1",
"@rollup/plugin-commonjs": "^21.0.3",
"@rollup/plugin-node-resolve": "^13.1.3",
"@types/jest": "^27.4.1",
"@types/lodash": "^4.14.181",
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.18.0",
"eslint": "^8.12.0",
"@commitlint/cli": "^17.0.2",
"@commitlint/config-conventional": "^17.0.2",
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-node-resolve": "^13.3.0",
"@types/jest": "^28.1.2",
"@types/lodash": "^4.14.182",
"@typescript-eslint/eslint-plugin": "^5.28.0",
"@typescript-eslint/parser": "^5.28.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.1.4",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.4",
"jest": "27.5.1",
"lint-staged": "^12.3.7",
"prettier": "^2.6.2",
"husky": "^8.0.1",
"jest": "28.1.1",
"lint-staged": "^13.0.2",
"prettier": "^2.7.1",
"promise-delay": "^2.1.0",
"rollup": "^2.70.1",
"rollup": "^2.75.7",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "0.31.2",
"standard-version": "^9.3.2",
"ts-jest": "^27.1.4",
"typescript": "^4.6.3"
"rollup-plugin-typescript2": "0.32.1",
"standard-version": "^9.5.0",
"ts-jest": "^28.0.5",
"typescript": "^4.7.4"
},

@@ -73,0 +73,0 @@ "main:src": "src/index.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc