-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DONE: Migrate the westore project to TypeScript #127
base: master
Are you sure you want to change the base?
Conversation
后续任务: |
@dntzhang 抽空 review 一下 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: traverse error
当前 diff 与 原代码只差格式问题
packages/westore/src/westore.ts
Outdated
if (current === previous) return | ||
|
||
const rootCurrentType: DataTypes = getType(current) | ||
const rootPreType: DataTypes = getType(previous) | ||
|
||
if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) { | ||
for (const key in previous) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
主要问题在于 eslint 由于类型系统读取不到 auto fix 的时候优化成了常量
packages/westore/src/westore.ts
Outdated
path: string, | ||
result: any | ||
) { | ||
function _diff(current: any, previous: any, path: string, result: any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
先暂时用 any 类型后面进行优化
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
与 master 最新更改同步
common.js 产物已可在 example 小程序上运行