(targetObject: T, originObj: T)
| 31 | * @param originObj Original minigame environment such as `wx`, `swan` etc. |
| 32 | */ |
| 33 | export function cloneObject<T extends object = any> (targetObject: T, originObj: T): void { |
| 34 | Object.keys(originObj).forEach((key) => { |
| 35 | if (typeof originObj[key] === 'function') { |
| 36 | targetObject[key] = originObj[key].bind(originObj); |
| 37 | return; |
| 38 | } |
| 39 | targetObject[key] = originObj[key]; |
| 40 | }); |
| 41 | } |
| 42 | |
| 43 | type MiningameAudioCallbackName = 'onPlay' | 'onPause' | 'onStop' | 'onSeek'; |
| 44 | type InnerAudioContextPolyfillConfig = { |
no test coverage detected