linear-gradient(to right, #06bfff 50%, #2b74ff 100%);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import diff from "../diff"; | |
import * as React from 'react' | |
import cvt from "../cvt"; | |
describe('diff 算法', () => { | |
test('when 没有变化时 => 返回空对象', () => { | |
const createJsx = () => | |
<div> | |
<div style={{margin: 10}}>123</div> | |
<div hidden>456</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function defineProperty(proto:any, key:string, descriptor:PropertyDescriptor) { | |
descriptor = bindMethod(proto, key, descriptor) | |
Object.defineProperty(proto, key, descriptor) | |
} | |
function bindClass(target:Function) { | |
const exKeys = ['constructor', 'render'] | |
const proto = target.prototype | |
const descriptors = Object.getOwnPropertyDescriptors(proto) | |
for(let [ key, descriptor ] of Object.entries(descriptors)) |