Skip to content

Commit

Permalink
fix: 修复getCurrentInstance方法类型声明#6904,修复taro update project报错#6850 (#6909
Browse files Browse the repository at this point in the history
)

* fix: 修复getCurrentInstance方法类型声明#6904

* fix: 修复taro update project报错#6850

Co-authored-by: chenjiajian <[email protected]>
  • Loading branch information
spencer17x and Chen-jj authored Jul 8, 2020
1 parent f84b684 commit ec17056
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/taro-cli/src/presets/commands/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default (ctx: IPluginContext) => {
const nervJSVersion = `^${await getLatestVersion('nervjs')}`

// 更新 @tarojs/* 版本和 NervJS 版本
Object.keys(packageMap.dependencies).forEach((key) => {
Object.keys(packageMap.dependencies || {}).forEach((key) => {
if (UPDATE_PACKAGE_LIST.indexOf(key) !== -1) {
if (key.includes('nerv')) {
packageMap.dependencies[key] = nervJSVersion
Expand All @@ -102,7 +102,7 @@ export default (ctx: IPluginContext) => {
}
}
})
Object.keys(packageMap.devDependencies).forEach((key) => {
Object.keys(packageMap.devDependencies || {}).forEach((key) => {
if (UPDATE_PACKAGE_LIST.indexOf(key) !== -1) {
if (key.includes('nerv')) {
packageMap.devDependencies[key] = nervJSVersion
Expand Down
6 changes: 5 additions & 1 deletion packages/taro/types/taro.extend.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,16 @@ declare namespace Taro {

function setIsUsingDiff (flag: boolean)

const Current: {
interface Current {
app: AppInstance | null,
router: RouterInfo | null,
page: PageInstance | null,
onReady: string,
onHide: string,
onShow: string
}

const Current: Current

function getCurrentInstance(): Current
}

0 comments on commit ec17056

Please sign in to comment.