ziko 0.38.0 → 0.38.1

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/dist/ziko.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  Project: ziko.js
4
4
  Author: Zakaria Elalaoui
5
- Date : Fri Aug 15 2025 21:37:17 GMT+0100 (UTC+01:00)
5
+ Date : Sun Aug 17 2025 21:52:49 GMT+0100 (UTC+01:00)
6
6
  Git-Repo : https://github.com/zakarialaoui10/ziko.js
7
7
  Git-Wiki : https://github.com/zakarialaoui10/ziko.js/wiki
8
8
  Released under MIT License
@@ -945,21 +945,6 @@ const preload=(url)=>{
945
945
  }
946
946
  };
947
947
 
948
- async function fetchdom(url='https://github.com/zakarialaoui10'){
949
- const data=await fetch(url);
950
- const html=await data.text();
951
- const dom= new DOMParser().parseFromString(html,'text/xml');
952
- return dom.documentElement
953
- }
954
- function fetchdomSync(url='https://github.com/zakarialaoui10'){
955
- const data=preload(url);
956
- const dom= new DOMParser().parseFromString(data,'text/xml');
957
- return dom.documentElement;
958
- }
959
-
960
- globalThis.fetchdom=fetchdom;
961
- globalThis.fetchdomSync=fetchdomSync;
962
-
963
948
  const csv2arr = (csv, delimiter = ",")=>csv.trim().trimEnd().split("\n").map(n=>n.split(delimiter));
964
949
  const csv2matrix = (csv, delimiter = ",")=>new Matrix(csv2arr(csv,delimiter));
965
950
  const csv2object = (csv, delimiter = ",") => {
@@ -1074,36 +1059,27 @@ class ZikoUINode {
1074
1059
 
1075
1060
  globalThis.node = (node) => new ZikoUINode(node);
1076
1061
 
1077
- function composeClass(Class, mixin) {
1062
+ function register_to_class(target, ...mixins){
1063
+ mixins.forEach(n => _register_to_class_(target, n));
1064
+ }
1065
+ function _register_to_class_(target, mixin) {
1078
1066
  const descriptors = Object.getOwnPropertyDescriptors(mixin);
1079
-
1080
- class Composed extends Class {
1081
- constructor(...args) {
1082
- super(...args);
1083
- for (const key of Reflect.ownKeys(descriptors)) {
1084
- const desc = descriptors[key];
1085
-
1086
- if (typeof desc.value === 'function') {
1087
- this[key] = desc.value.bind(this);
1088
- }
1089
- }
1090
- }
1091
- }
1092
-
1093
1067
  for (const key of Reflect.ownKeys(descriptors)) {
1094
1068
  const desc = descriptors[key];
1095
-
1096
- if ('get' in desc || 'set' in desc) {
1097
- Object.defineProperty(Composed.prototype, key, desc);
1098
- } else if (typeof desc.value !== 'function') {
1099
- Object.defineProperty(Composed.prototype, key, desc);
1069
+ if ('get' in desc || 'set' in desc || typeof desc.value !== 'function') {
1070
+ Object.defineProperty(Object.getPrototypeOf(target), key, desc);
1071
+ } else if (typeof desc.value === 'function') {
1072
+ if (!Object.getPrototypeOf(target).hasOwnProperty(key)) {
1073
+ Object.defineProperty(Object.getPrototypeOf(target), key, desc);
1074
+ }
1100
1075
  }
1101
1076
  }
1102
-
1103
- return Composed;
1104
1077
  }
1105
1078
 
1106
- function composeInstance(instance, mixin) {
1079
+ function register_to_instance(target, ...mixins){
1080
+ mixins.forEach(n => _register_to_instance_(target, n));
1081
+ }
1082
+ function _register_to_instance_(instance, mixin) {
1107
1083
  const descriptors = Object.getOwnPropertyDescriptors(mixin);
1108
1084
 
1109
1085
  for (const key of Reflect.ownKeys(descriptors)) {
@@ -1119,15 +1095,10 @@ function composeInstance(instance, mixin) {
1119
1095
  }
1120
1096
  }
1121
1097
 
1122
- function compose(target, ...mixin) {
1123
- if (typeof target === 'function') {
1124
- return mixin.forEach(item =>composeClass(target, item));
1125
- } else if (typeof target === 'object') {
1126
- mixin.forEach(item =>composeInstance(target, item));
1127
- } else {
1128
- throw new TypeError("compose: target must be a class or instance");
1129
- }
1130
- }
1098
+ const register = (target, ...mixins) => {
1099
+ if(typeof target === 'function') register_to_class(target, ...mixins);
1100
+ else register_to_instance(target, ...mixins);
1101
+ };
1131
1102
 
1132
1103
  class ZikoUIText extends ZikoUINode {
1133
1104
  constructor(...value) {
@@ -1248,22 +1219,6 @@ function __addItem__(adder, pusher, ...ele) {
1248
1219
  return this;
1249
1220
  }
1250
1221
 
1251
- const IndexingMethods = {
1252
- at(index) {
1253
- return this.items.at(index);
1254
- },
1255
- forEach(callback) {
1256
- this.items.forEach(callback);
1257
- return this;
1258
- },
1259
- map(callback) {
1260
- return this.items.map(callback);
1261
- },
1262
- find(condition) {
1263
- return this.items.filter(condition);
1264
- },
1265
- };
1266
-
1267
1222
  const Events = {
1268
1223
  'Click' : [
1269
1224
  'Click',
@@ -1675,6 +1630,22 @@ Object.entries(Events).forEach(([name, eventList]) => {
1675
1630
  });
1676
1631
  });
1677
1632
 
1633
+ const IndexingMethods = {
1634
+ at(index) {
1635
+ return this.items.at(index);
1636
+ },
1637
+ forEach(callback) {
1638
+ this.items.forEach(callback);
1639
+ return this;
1640
+ },
1641
+ map(callback) {
1642
+ return this.items.map(callback);
1643
+ },
1644
+ find(condition) {
1645
+ return this.items.filter(condition);
1646
+ },
1647
+ };
1648
+
1678
1649
  class ZikoUseStyle {
1679
1650
  constructor(style = {}, use = style.hasOwnProperty("default")? "default" : Object.keys(style)[0], id = 0) {
1680
1651
  this.id = "Ziko-Style-" + id;
@@ -3282,23 +3253,26 @@ const __CACHE__ = {
3282
3253
  }
3283
3254
  };
3284
3255
 
3285
- if ( !globalThis?.__Ziko__ ){
3286
- globalThis.__Ziko__ = {
3287
- __UI__,
3288
- __HYDRATION__,
3289
- __HYDRATION_MAP__,
3290
- __Config__,
3291
- __CACHE__,
3292
- };
3293
- defineParamsGetter$1(__Ziko__);
3256
+ function __init__global__(){
3257
+ if ( !globalThis?.__Ziko__ ){
3258
+ globalThis.__Ziko__ = {
3259
+ __UI__,
3260
+ __HYDRATION__,
3261
+ __HYDRATION_MAP__,
3262
+ __Config__,
3263
+ __CACHE__,
3264
+ };
3265
+ defineParamsGetter$1(__Ziko__);
3266
+ }
3294
3267
  }
3295
3268
 
3269
+ __init__global__();
3296
3270
  class ZikoUIElement extends ZikoUINode{
3297
- constructor(element, name="", {el_type="html", useDefaultStyle=false}={}){
3271
+ constructor(element, name="", {type="html", useDefaultStyle=false}={}){
3298
3272
  super();
3299
3273
  this.target = globalThis.__Ziko__.__Config__.default.target||globalThis?.document?.body;
3300
3274
  if(typeof element === "string") {
3301
- switch(el_type){
3275
+ switch(type){
3302
3276
  case "html" : element = globalThis?.document?.createElement(element); break;
3303
3277
  case "svg" : element = globalThis?.document?.createElementNS("http://www.w3.org/2000/svg", element);
3304
3278
  default : throw Error("Not supported")
@@ -3307,18 +3281,7 @@ class ZikoUIElement extends ZikoUINode{
3307
3281
  else {
3308
3282
  this.target = element.parentElement;
3309
3283
  }
3310
- // if(element)this.__ele__ = element;
3311
- compose(
3312
- this,
3313
- DomMethods,
3314
- IndexingMethods,
3315
- EventsMethodes
3316
- );
3317
- // if(false){
3318
- // import("../methods/tree.js").then(({ default: ExternalMethods }) => {
3319
- // compose(this, ExternalMethods);
3320
- // });
3321
- // }
3284
+ register(this, DomMethods, IndexingMethods, EventsMethodes);
3322
3285
  Object.assign(this.cache, {
3323
3286
  name,
3324
3287
  isInteractive : [true, false][Math.floor(2*Math.random())],
@@ -3386,10 +3349,6 @@ class ZikoUIElement extends ZikoUINode{
3386
3349
  isZikoUIElement(){
3387
3350
  return true;
3388
3351
  }
3389
- register(){
3390
-
3391
- return this;
3392
- }
3393
3352
  get st(){
3394
3353
  return this.cache.style;
3395
3354
  }
@@ -3706,27 +3665,40 @@ const SVGTags = [
3706
3665
  "desc", "title", "metadata", "foreignObject"
3707
3666
  ];
3708
3667
 
3668
+ const isStateGetter = (arg) => {
3669
+ return typeof(arg) === 'function' && arg?.()?.isStateGetter?.()
3670
+ };
3671
+
3709
3672
  const tags = new Proxy({}, {
3710
3673
  get(target, prop) {
3711
3674
  if (typeof prop !== 'string') return undefined;
3712
3675
  let tag = prop.replaceAll("_","-").toLowerCase();
3676
+ let type ;
3677
+ if(HTMLTags.includes(tag)) type = 'html';
3678
+ if(SVGTags.includes(tag)) type = 'svg';
3713
3679
  if(HTMLTags.includes(tag)) return (...args)=>{
3714
- if(!(args[0] instanceof ZikoUIElement) && args[0] instanceof Object){
3715
- let attributes = args.shift();
3716
- // console.log(args)
3717
- return new ZikoUIElement(tag).setAttr(attributes).append(...args)
3718
- }
3719
- return new ZikoUIElement(tag).append(...args);
3720
- }
3721
- if(SVGTags.includes(tag)) return (...args)=>new ZikoUIElement(tag,"",{el_type : "svg"}).append(...args);
3722
- return (...args)=>{
3723
- if(!(args[0] instanceof ZikoUIElement) && args[0] instanceof Object){
3724
- let attributes = args.shift();
3725
- return new ZikoUIElement(tag).setAttr(attributes).append(...args)
3726
- }
3727
- return new ZikoUIElement(tag).append(...args);
3728
- }
3729
- // switch(tag){
3680
+ console.log(isStateGetter(args[0]));
3681
+ // if(typeof args[0] === 'function') {
3682
+ // console.log(args[0], args[0]?.() instanceof StateGetter)
3683
+ // globalThis.a = args[0]
3684
+ // console.log({t : a.constructor})
3685
+ // }
3686
+ if(
3687
+ ['string', 'number'].includes(typeof args[0])
3688
+ || args[0] instanceof ZikoUIElement
3689
+ || (typeof args[0] === 'function' && args[0]().isStateGetter())
3690
+ ) return new ZikoUIElement(tag, tag, {type}).append(...args);
3691
+ return new ZikoUIElement(tag).setAttr(args.shift()).append(...args)
3692
+ }
3693
+ // if(SVGTags.includes(tag)) return (...args) => new ZikoUIElement(tag,"",{el_type : "svg"}).append(...args);
3694
+ // return (...args)=>{
3695
+ // if(!(args[0] instanceof ZikoUIElement) && args[0] instanceof Object){
3696
+ // let attributes = args.shift()
3697
+ // return new ZikoUIElement(tag).setAttr(attributes).append(...args)
3698
+ // }
3699
+ // return new ZikoUIElement(tag).append(...args);
3700
+ // }
3701
+ // // switch(tag){
3730
3702
  // case "html" : globalThis?.document?.createElement("html")
3731
3703
  // case "head" :
3732
3704
  // case "style" :
@@ -5798,8 +5770,7 @@ class ZikoTimeAnimation{
5798
5770
  const useAnimation=(callback,ease=Ease.Linear,step=50,config)=>new ZikoTimeAnimation(callback,ease=Ease.Linear,step=50,config);
5799
5771
 
5800
5772
  const debounce=(fn,delay=1000)=>{
5801
- let id;
5802
- return (...args) => id ? clearTimeout(id) : setTimeout(()=>fn(...args),delay);
5773
+ return (...args) => setTimeout(()=>fn(...args),delay);
5803
5774
  };
5804
5775
  const throttle=(fn,delay)=>{
5805
5776
  let lastTime=0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ziko",
3
- "version": "0.38.0",
3
+ "version": "0.38.1",
4
4
  "description": "A versatile JavaScript library offering a rich set of Hyperscript Based UI components, advanced mathematical utilities, interactivity ,animations, client side routing and more ...",
5
5
  "keywords": [
6
6
  "front-end",
@@ -60,6 +60,7 @@
60
60
  "./time": {},
61
61
  "./components": {}
62
62
  },
63
+ "sideEffects" : false,
63
64
  "bin": {
64
65
  "create-ziko-app": "starter/bin/index.js"
65
66
  },
@@ -0,0 +1,46 @@
1
+ export function composeClass(Class, mixin) {
2
+ const descriptors = Object.getOwnPropertyDescriptors(mixin);
3
+
4
+ class Composed extends Class {
5
+ constructor(...args) {
6
+ super(...args);
7
+ // ⚠️ Do NOT assign mixin functions to `this`
8
+ }
9
+ }
10
+
11
+ // Copy prototype properties (methods, getters/setters, non-functions)
12
+ for (const key of Reflect.ownKeys(descriptors)) {
13
+ const desc = descriptors[key];
14
+
15
+ if ('get' in desc || 'set' in desc || typeof desc.value !== 'function') {
16
+ Object.defineProperty(Composed.prototype, key, desc);
17
+ } else if (typeof desc.value === 'function') {
18
+ // Only add method if it does NOT already exist
19
+ if (!Composed.prototype.hasOwnProperty(key)) {
20
+ Object.defineProperty(Composed.prototype, key, desc);
21
+ }
22
+ }
23
+ }
24
+
25
+ return Composed;
26
+ }
27
+
28
+ // // Usage
29
+ // class UIBase {
30
+ // log() { console.log('UIBase log'); }
31
+ // }
32
+
33
+ // const mixin = {
34
+ // at() { return 0; },
35
+ // hello() { return 'hello'; }
36
+ // };
37
+
38
+ // const UIComposed = composeClass(UIBase, mixin);
39
+
40
+ // class UI2 extends UIComposed {
41
+ // at() { return 1; } // ✅ correctly overrides mixin
42
+ // }
43
+
44
+ // const ui = new UI2();
45
+ // console.log(ui.at()); // 1
46
+ // console.log(ui.hello()); // 'hello'
@@ -0,0 +1,6 @@
1
+ import { register_to_class } from "./register-to-class.js";
2
+ import { register_to_instance } from "./register-to-instance";
3
+ export const register = (target, ...mixins) => {
4
+ if(typeof target === 'function') register_to_class(target, ...mixins)
5
+ else register_to_instance(target, ...mixins)
6
+ }
@@ -0,0 +1,16 @@
1
+ export function register_to_class(target, ...mixins){
2
+ mixins.forEach(n => _register_to_class_(target, n))
3
+ }
4
+ function _register_to_class_(target, mixin) {
5
+ const descriptors = Object.getOwnPropertyDescriptors(mixin);
6
+ for (const key of Reflect.ownKeys(descriptors)) {
7
+ const desc = descriptors[key];
8
+ if ('get' in desc || 'set' in desc || typeof desc.value !== 'function') {
9
+ Object.defineProperty(Object.getPrototypeOf(target), key, desc);
10
+ } else if (typeof desc.value === 'function') {
11
+ if (!Object.getPrototypeOf(target).hasOwnProperty(key)) {
12
+ Object.defineProperty(Object.getPrototypeOf(target), key, desc);
13
+ }
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,18 @@
1
+ export function register_to_instance(target, ...mixins){
2
+ mixins.forEach(n => _register_to_instance_(target, n))
3
+ }
4
+ function _register_to_instance_(instance, mixin) {
5
+ const descriptors = Object.getOwnPropertyDescriptors(mixin);
6
+
7
+ for (const key of Reflect.ownKeys(descriptors)) {
8
+ const desc = descriptors[key];
9
+
10
+ if ('get' in desc || 'set' in desc) {
11
+ Object.defineProperty(instance, key, desc);
12
+ } else if (typeof desc.value === 'function') {
13
+ instance[key] = desc.value.bind(instance);
14
+ } else {
15
+ instance[key] = desc.value;
16
+ }
17
+ }
18
+ }
@@ -3,14 +3,15 @@ import { __UI__ } from './__ui__.js';
3
3
  import { __Config__ } from './__config__.js';
4
4
  import { __HYDRATION__, __HYDRATION_MAP__ } from './__hydration__.js';
5
5
  import { __CACHE__ } from './__cache__.js';
6
-
7
- if ( !globalThis?.__Ziko__ ){
8
- globalThis.__Ziko__ = {
9
- __UI__,
10
- __HYDRATION__,
11
- __HYDRATION_MAP__,
12
- __Config__,
13
- __CACHE__,
14
- };
15
- defineParamsGetter(__Ziko__)
16
- }
6
+ export function __init__global__(){
7
+ if ( !globalThis?.__Ziko__ ){
8
+ globalThis.__Ziko__ = {
9
+ __UI__,
10
+ __HYDRATION__,
11
+ __HYDRATION_MAP__,
12
+ __Config__,
13
+ __CACHE__,
14
+ };
15
+ defineParamsGetter(__Ziko__)
16
+ }
17
+ }
@@ -45,3 +45,8 @@ export function useState(initialValue) {
45
45
 
46
46
  return [getValue, setValue, controller];
47
47
  }
48
+
49
+ export const isStateGetter = (arg) => {
50
+ return typeof(arg) === 'function' && arg?.()?.isStateGetter?.()
51
+ }
52
+
@@ -0,0 +1,4 @@
1
+ export * from './dom.js'
2
+ export * from './events.js'
3
+ export * from './indexing.js'
4
+ // export * from './style.js'
@@ -1,10 +1,13 @@
1
1
  import ZikoUINode from "./ZikoUINode.js";
2
- import { compose } from "../../__helpers__/index.js";
3
- import { DomMethods } from "../__methods__/dom.js";
4
- import { IndexingMethods } from "../__methods__/indexing.js";
5
- import { EventsMethodes } from "../__methods__/events.js";
2
+ import { register } from "../../__helpers__/register/index.js";
3
+ import {
4
+ DomMethods,
5
+ IndexingMethods,
6
+ EventsMethodes
7
+ } from "../__methods__/index.js";
6
8
  import { ZikoUseStyle } from "../../reactivity/hooks/UI/useStyle.js";
7
9
  import { ZikoUIElementStyle } from "./style/index.js";
10
+
8
11
  import {
9
12
  useCustomEvent,
10
13
  useSwipeEvent,
@@ -15,13 +18,14 @@ import {
15
18
  } from "../../reactivity/index.js"
16
19
  import { Random } from "../../math/index.js";
17
20
  import { Str } from "../../data/index.js";
18
- import '../../__ziko__/index.js';
21
+ import {__init__global__} from '../../__ziko__/index.js';
22
+ __init__global__()
19
23
  class ZikoUIElement extends ZikoUINode{
20
- constructor(element, name="", {el_type="html", useDefaultStyle=false}={}){
24
+ constructor(element, name="", {type="html", useDefaultStyle=false}={}){
21
25
  super()
22
26
  this.target = globalThis.__Ziko__.__Config__.default.target||globalThis?.document?.body;
23
27
  if(typeof element === "string") {
24
- switch(el_type){
28
+ switch(type){
25
29
  case "html" : element = globalThis?.document?.createElement(element); break;
26
30
  case "svg" : element = globalThis?.document?.createElementNS("http://www.w3.org/2000/svg", element);
27
31
  default : throw Error("Not supported")
@@ -30,18 +34,7 @@ class ZikoUIElement extends ZikoUINode{
30
34
  else{
31
35
  this.target = element.parentElement;
32
36
  }
33
- // if(element)this.__ele__ = element;
34
- compose(
35
- this,
36
- DomMethods,
37
- IndexingMethods,
38
- EventsMethodes
39
- )
40
- // if(false){
41
- // import("../methods/tree.js").then(({ default: ExternalMethods }) => {
42
- // compose(this, ExternalMethods);
43
- // });
44
- // }
37
+ register(this, DomMethods, IndexingMethods, EventsMethodes);
45
38
  Object.assign(this.cache, {
46
39
  name,
47
40
  isInteractive : [true, false][Math.floor(2*Math.random())],
@@ -109,10 +102,6 @@ class ZikoUIElement extends ZikoUINode{
109
102
  isZikoUIElement(){
110
103
  return true;
111
104
  }
112
- register(){
113
-
114
- return this;
115
- }
116
105
  get st(){
117
106
  return this.cache.style;
118
107
  }
@@ -1,5 +1,6 @@
1
1
  import ZikoUIElement from "../constructors/ZikoUIElement.js";
2
2
  import { HTMLTags, SVGTags } from "./tags-list.js";
3
+ import { isStateGetter } from "../../hooks/use-state.js";
3
4
  const _h=(tag, type, attributes, ...children)=>{
4
5
  const { name, style, ...attrs } = attributes;
5
6
  let element = new ZikoUIElement(tag, name, type);
@@ -15,23 +16,32 @@ const tags = new Proxy({}, {
15
16
  get(target, prop) {
16
17
  if (typeof prop !== 'string') return undefined;
17
18
  let tag = prop.replaceAll("_","-").toLowerCase();
19
+ let type ;
20
+ if(HTMLTags.includes(tag)) type = 'html'
21
+ if(SVGTags.includes(tag)) type = 'svg'
18
22
  if(HTMLTags.includes(tag)) return (...args)=>{
19
- if(!(args[0] instanceof ZikoUIElement) && args[0] instanceof Object){
20
- let attributes = args.shift()
21
- // console.log(args)
22
- return new ZikoUIElement(tag).setAttr(attributes).append(...args)
23
- }
24
- return new ZikoUIElement(tag).append(...args);
23
+ console.log(isStateGetter(args[0]))
24
+ // if(typeof args[0] === 'function') {
25
+ // console.log(args[0], args[0]?.() instanceof StateGetter)
26
+ // globalThis.a = args[0]
27
+ // console.log({t : a.constructor})
28
+ // }
29
+ if(
30
+ ['string', 'number'].includes(typeof args[0])
31
+ || args[0] instanceof ZikoUIElement
32
+ || (typeof args[0] === 'function' && args[0]().isStateGetter())
33
+ ) return new ZikoUIElement(tag, tag, {type}).append(...args);
34
+ return new ZikoUIElement(tag).setAttr(args.shift()).append(...args)
25
35
  }
26
- if(SVGTags.includes(tag)) return (...args)=>new ZikoUIElement(tag,"",{el_type : "svg"}).append(...args);
27
- return (...args)=>{
28
- if(!(args[0] instanceof ZikoUIElement) && args[0] instanceof Object){
29
- let attributes = args.shift()
30
- return new ZikoUIElement(tag).setAttr(attributes).append(...args)
31
- }
32
- return new ZikoUIElement(tag).append(...args);
33
- }
34
- // switch(tag){
36
+ // if(SVGTags.includes(tag)) return (...args) => new ZikoUIElement(tag,"",{el_type : "svg"}).append(...args);
37
+ // return (...args)=>{
38
+ // if(!(args[0] instanceof ZikoUIElement) && args[0] instanceof Object){
39
+ // let attributes = args.shift()
40
+ // return new ZikoUIElement(tag).setAttr(attributes).append(...args)
41
+ // }
42
+ // return new ZikoUIElement(tag).append(...args);
43
+ // }
44
+ // // switch(tag){
35
45
  // case "html" : globalThis?.document?.createElement("html")
36
46
  // case "head" :
37
47
  // case "style" :
@@ -1,28 +0,0 @@
1
- export function composeClass(Class, mixin) {
2
- const descriptors = Object.getOwnPropertyDescriptors(mixin);
3
-
4
- class Composed extends Class {
5
- constructor(...args) {
6
- super(...args);
7
- for (const key of Reflect.ownKeys(descriptors)) {
8
- const desc = descriptors[key];
9
-
10
- if (typeof desc.value === 'function') {
11
- this[key] = desc.value.bind(this);
12
- }
13
- }
14
- }
15
- }
16
-
17
- for (const key of Reflect.ownKeys(descriptors)) {
18
- const desc = descriptors[key];
19
-
20
- if ('get' in desc || 'set' in desc) {
21
- Object.defineProperty(Composed.prototype, key, desc);
22
- } else if (typeof desc.value !== 'function') {
23
- Object.defineProperty(Composed.prototype, key, desc);
24
- }
25
- }
26
-
27
- return Composed;
28
- }