File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 11# fast-copy CHANGELOG
22
3+ ## 4.0.0
4+
5+ ### BREAKING CHANGES
6+
7+ - Legacy environment support has been removed; ` Symbol ` , ` WeakMap ` , and ` RegExp.prototype.flags ` are now expected to be present.
8+ - ` createCopier ` now receives an object of options. The methods passed previously are namespaced under the ` methods ` key in that options object.
9+ - ` createStrictCopier ` has been removed; please use the ` strict ` option passed to ` createCopier `
10+
311## 3.0.2
412
513- [ #95 ] ( https://github.com/planttheidea/fast-copy/pull/95 ) - Add support for objects that have a prototype with no constructor
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ export interface Cache {
44 get : ( key : any ) => any ;
55}
66
7- const { create } = Object ;
87const toStringFunction = Function . prototype . toString ;
98const toStringObject = Object . prototype . toString ;
109
@@ -13,15 +12,15 @@ const toStringObject = Object.prototype.toString;
1312 */
1413export function getCleanClone ( prototype : any ) : any {
1514 if ( ! prototype ) {
16- return create ( null ) ;
15+ return Object . create ( null ) ;
1716 }
1817
1918 const Constructor = prototype . constructor ;
2019
2120 if ( Constructor === Object ) {
2221 return prototype === Object . prototype
2322 ? { }
24- : create ( prototype as object | null ) ;
23+ : Object . create ( prototype as object | null ) ;
2524 }
2625
2726 if (
@@ -38,7 +37,7 @@ export function getCleanClone(prototype: any): any {
3837 }
3938 }
4039
41- return create ( prototype as object | null ) ;
40+ return Object . create ( prototype as object | null ) ;
4241}
4342
4443/**
You can’t perform that action at this time.
0 commit comments