@javish/lib 0.2.0 → 0.2.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.
Files changed (3) hide show
  1. package/changes.md +6 -1
  2. package/index.js +13 -1
  3. package/package.json +4 -1
package/changes.md CHANGED
@@ -1,6 +1,11 @@
1
1
  ## 28 jan 2026
2
2
 
3
- ### version 0.2.0
3
+ ### version 0.2.2
4
+
5
+ - enable single-argument mode where only implementation is passed without base
6
+ class in which case a dedicated proto is created.
7
+
8
+ ### version 0.2.0-0.2.1
4
9
 
5
10
  - export `FnImplFactory` from runtimes to consume to emulate functional
6
11
  interfaces.
package/index.js CHANGED
@@ -18,6 +18,15 @@
18
18
  * @param {Record<string,Function>} methods
19
19
  */
20
20
  var ImplFactory = function (Base, methods) {
21
+ if(methods == undefined) { // [...arguments.length] == 1
22
+ return function() {
23
+ var proto = Object.create(null)
24
+ var obj = Object.create(proto)
25
+ for (var k in Base) proto[k] = Base[k] // those can be passed to the proxy when creating
26
+ return obj
27
+ }
28
+ }
29
+
21
30
  return function () {
22
31
  var obj = new Base
23
32
  var proto = Object.getPrototypeOf(obj)
@@ -77,6 +86,9 @@ module.exports.FnImplFactory = (Base, Impl) => {
77
86
  if(typeof Target.prototype.const=='function') {
78
87
  Target.prototype.const.call(STATE)
79
88
  }
89
+ else if(typeof Target.prototype.конструктор=='function') {
90
+ Target.prototype.конструктор.call(STATE)
91
+ }
80
92
  // else if(typeof Target.prototype.constr=='function') {
81
93
  // Target.prototype.constr.call(STATE)
82
94
  // }
@@ -89,7 +101,7 @@ module.exports.FnImplFactory = (Base, Impl) => {
89
101
  },
90
102
  }
91
103
 
92
- console.log('created new functional', Base)
104
+ // console.log('created new functional', Base)
93
105
  return new Proxy(target, handler)
94
106
  }
95
107
 
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@javish/lib",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "author": {
5
5
  "name": "British Software",
6
6
  "email": "packages+javish@british.software"
7
+ },
8
+ "scripts": {
9
+ "t": "git tag @javish/base-v$(node -p \"require('./package.json').version\") && git push --tags"
7
10
  }
8
11
  }