@hylid/call
Advanced tools
Comparing version 3.3.0-alpha.0 to 3.3.0-alpha.1
@@ -9,4 +9,5 @@ /// <reference types="miniprogram" /> | ||
export declare function call<T extends keyof MPApi>(name: T | ({} & string), options?: PickMPArgs<T> | Common | Callback<PickMpReturns<T>>, config?: Config): any; | ||
export declare function createWebviewSrc(url: string): string; | ||
export { WebViewBridge } from './webviewBridge'; | ||
export { mpCall, mpWebCall, webCall, notFound }; | ||
export { promisify } from './promisify'; |
@@ -15,4 +15,17 @@ var _a; | ||
} | ||
export function createWebviewSrc(url) { | ||
var app = my.getSystemInfoSync().app; | ||
var hashIndex = url.indexOf('#'); | ||
var hash = ''; | ||
if (hashIndex !== -1) { | ||
hash = url.slice(hashIndex); | ||
url = url.slice(0, hashIndex); | ||
} | ||
var separator = url.includes('?') ? '&' : '?'; | ||
var newUrl = url + separator + '__app__=' + app + hash; | ||
return newUrl; | ||
} | ||
; | ||
export { WebViewBridge } from "./webviewBridge"; | ||
export { mpCall, mpWebCall, webCall, notFound }; | ||
export { promisify } from "./promisify"; |
@@ -22,2 +22,6 @@ export function mpCall(apiName, options, config) { | ||
} | ||
if (type === 'attribute') { | ||
// @ts-ignore | ||
return my[apiName]; | ||
} | ||
} |
@@ -106,3 +106,3 @@ var __assign = this && this.__assign || function () { | ||
} else { | ||
console.info("[hylid-call]: context \u5728\u5C0F\u7A0B\u5E8F\u4FA7\u672A\u4F20\u5165\uFF0Cbroadcast \u529F\u80FD\u3001\u9875\u9762\u76D1\u542C\u5C06\u65E0\u6CD5\u4F7F\u7528"); | ||
console.info("[hylid-call]: context is null, broadcast and pageEvent cannot be used"); | ||
} | ||
@@ -109,0 +109,0 @@ } |
@@ -1,1 +0,3 @@ | ||
export declare function _getCurrentPages(): any[]; | ||
export declare function _getCurrentPages(): { | ||
route: any; | ||
}[]; |
export function _getCurrentPages() { | ||
return getCurrentPages(); | ||
var pages = getCurrentPages(); | ||
return pages.map(function (page) { | ||
return { | ||
route: page.route | ||
}; | ||
}); | ||
} |
{ | ||
"name": "@hylid/call", | ||
"version": "3.3.0-alpha.0", | ||
"version": "3.3.0-alpha.1", | ||
"main": "lib/index.js", | ||
@@ -9,4 +9,4 @@ "files": [ | ||
"dependencies": { | ||
"@hylid/env": "^3.3.0-alpha.0", | ||
"@hylid/types": "^3.3.0-alpha.0" | ||
"@hylid/env": "^3.3.0-alpha.1", | ||
"@hylid/types": "^3.3.0-alpha.1" | ||
}, | ||
@@ -13,0 +13,0 @@ "publishConfig": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
33425
36
1049
1
Updated@hylid/env@^3.3.0-alpha.1
Updated@hylid/types@^3.3.0-alpha.1