@javish/lib 0.2.1 → 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 -2
  2. package/index.js +9 -0
  3. package/package.json +4 -1
package/changes.md CHANGED
@@ -1,7 +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.
7
- s
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)
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@javish/lib",
3
- "version": "0.2.1",
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
  }