GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — lowcode-engine/packages/utils/test/src/clone-deep.test.ts at main · vanestone/lowcode-engine Expand file tree/ Copy pathclone-deep.test.tsMore file actions 30 lines (25 loc) · 775 Bytes / Copy pathclone-deep.test.tsFile metadata and controls30 lines (25 loc) · 775 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 import { cloneDeep } from '../../src/clone-deep'; describe('cloneDeep', () => { it('should clone null', () => { const src = null; expect(cloneDeep(src)).toBeNull(); }); it('should clone undefined', () => { const src = undefined; expect(cloneDeep(src)).toBeUndefined(); }); it('should clone an array', () => { const src = [1, 2, 3, 4]; expect(cloneDeep(src)).toEqual(src); }); it('should clone an object', () => { const src = { name: 'John', age: 25 }; expect(cloneDeep(src)).toEqual(src); }); it('should deep clone nested objects', () => { const src = { person: { name: 'John', age: 25 } }; const cloned = cloneDeep(src); expect(cloned).toEqual(src); expect(cloned.person).not.toBe(src.person); }); }); |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |