UNPKG
@nsmp/js-api
Version:
latest (3.2.2)
3.2.2
3.2.1
3.2.0
3.1.0
3.0.0
2.0.0
1.0.1
1.0.0
Types for jsApi
@nsmp/js-api
/
src
/
lib
/
proxy
/
getJsApiContext.js
12 lines
(9 loc)
•
257 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
export
const
getJsApiContext
= (
environment, getContext
) => {
if
(environment ===
'ui'
&& getContext) {
return
getContext
() ||
window
.
uiFrameApiContext
; }
if
(environment ===
'uiFrame'
) {
return
window
.
parent
.
uiFrameApiContext
; }
return
null
; };