/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at . */
/**
* Tells if a given Source Actor is registered in the redux store
*
* @param {Object} state
* @param {String} sourceActorId
* Source Actor ID
* @return {Boolean}
*/
export function hasSourceActor(state, sourceActorId) {
return state.sourceActors.mutableSourceActors.has(sourceActorId);
}
/**
* Get the Source Actor object. See create.js:createSourceActor()
*
* @param {Object} state
* @param {String} sourceActorId
* Source Actor ID
* @return {Object}
* The Source Actor object (if registered)
*/
export function getSourceActor(state, sourceActorId) {
return state.sourceActors.mutableSourceActors.get(sourceActorId);
}
/**
* Reports if the Source Actor relates to a valid source map / original source.
*
* @param {Object} state
* @param {String} sourceActorId
* Source Actor ID
* @return {Boolean}
* True if it has a valid source map/original object.
*/
export function isSourceActorWithSourceMap(state, sourceActorId) {
return state.sourceActors.mutableSourceActorsWithSourceMap.has(sourceActorId);
}
export function getSourceMapErrorForSourceActor(state, sourceActorId) {
return state.sourceActors.mutableSourceMapErrors.get(sourceActorId);
}
export function getSourceMapResolvedURL(state, sourceActorId) {
return state.sourceActors.mutableResolvedSourceMapURL.get(sourceActorId);
}
// Used by threads selectors
/**
* Get all Source Actor objects for a given thread. See create.js:createSourceActor()
*
* @param {Object} state
* @param {Array} threadActorIDs
* List of Thread IDs
* @return {Array