@kizmann/pico-js 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kizmann/pico-js",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "private": false,
@@ -570,14 +570,14 @@ export class PicoMixed
570
570
  static extend(target : any, value : any, exclude : string[] = ['constructor'])
571
571
  {
572
572
  if ( value == null ) {
573
- return {};
573
+ return target;
574
574
  }
575
575
 
576
576
  let proto = Object.getPrototypeOf(value);
577
577
 
578
578
  for ( const key of Object.getOwnPropertyNames(value) ) {
579
579
 
580
- if ( !exclude.length || Arr.has(exclude, key) ) {
580
+ if ( exclude.length && Arr.has(exclude, key) ) {
581
581
  continue;
582
582
  }
583
583
 
@@ -587,7 +587,7 @@ export class PicoMixed
587
587
  desc = Object.getOwnPropertyDescriptor(value, key);
588
588
  }
589
589
 
590
- if ( !desc && (!desc.get && !desc.set) ) {
590
+ if ( !desc || (!desc.get && !desc.set) ) {
591
591
  target[key] = value[key];
592
592
  }
593
593