@mikezimm/fps-core-v7
Version:
Library of reusable core interfaces, types and constants migrated from fps-library-v2
28 lines (27 loc) • 1.1 kB
JavaScript
/**
* CodeAnalizerComment: Updated 1 imports on 2024-09-21 23:07:24
* Update:: import { check4This } to '@mikezimm/fps-core-v7/lib/logic/Links/CheckSearch;'
*/
import { ReplaceWpId } from "./IMinTeachBubble";
import { check4This } from "../../../logic/Links/CheckSearch";
/**
*
* @param AllTeachBubbles
* @param wpId
* @param teach - Beginning of Ids ( LESS # symbol which is automatically added )
* @returns
*/
export function getTeachBubbles(AllTeachBubbles, wpId, teach) {
let theseBubbles = AllTeachBubbles.filter(bubble => { return bubble.target.indexOf(`#${teach}`) === 0; });
theseBubbles = theseBubbles.map(bubble => {
// const newBubble = bubble;
// newBubble.target = newBubble.target.replace( ReplaceWpId, wpId );
// return newBubble;
bubble.target = bubble.target.replace(ReplaceWpId, wpId);
return bubble;
});
if (check4This(`showBubbles`) === true)
console.log(console.log('showBubbles getTeachBubbles', theseBubbles));
return theseBubbles;
}
//# sourceMappingURL=getTeacher.js.map