@aire-ux/aire-condensation
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -29,6 +29,7 @@ import { Condensation } from "./condensation"; | ||
const original = descriptor.value; | ||
descriptor.value = (...args) => { | ||
descriptor.value = function (...args) { | ||
const formals = ctx.formalParams(target.constructor, 'method', ...args); | ||
return original.apply(target, formals); | ||
return original.apply(this, formals); | ||
// return original.bind(target).apply(target, ...formals); | ||
}; | ||
} |
{ | ||
"name": "@aire-ux/aire-condensation", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Client-side serialization library for Aire-UX", | ||
@@ -81,3 +81,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "0c1b19d431a55887c4257cad60ce8775c8ff985f" | ||
"gitHead": "4626c9ac00cd24cf7f7e7c8767acc7c4508336a7" | ||
} |
@@ -39,6 +39,7 @@ import {Class} from "@condensation/types"; | ||
const original = descriptor.value; | ||
descriptor.value = (...args: any[]) => { | ||
descriptor.value = function(...args: any[]) { | ||
const formals = ctx.formalParams(target.constructor, 'method', ...args); | ||
return original.apply(target, formals); | ||
return original.apply(this, formals); | ||
// return original.bind(target).apply(target, ...formals); | ||
} | ||
} |
@@ -269,1 +269,57 @@ import {Receive, Remotable, Remote} from "@condensation/remotable"; | ||
}); | ||
test('canvas scenario should work', () => { | ||
@RootElement | ||
class Vertex { | ||
@Property(Number) | ||
private x: number | undefined; | ||
@Property(Number) | ||
private y: number | undefined; | ||
@Property(Number) | ||
private width: number | undefined; | ||
@Property(Number) | ||
private height : number | undefined; | ||
@Property(String) | ||
label: string | undefined; | ||
} | ||
@Remotable | ||
@customElement('aire-canvas') | ||
class Canvas extends LitElement { | ||
readonly vertices: Vertex[]; | ||
constructor() { | ||
super(); | ||
this.vertices = []; | ||
} | ||
@Remote | ||
public addVertex(@Receive(Vertex) vertex: Vertex) { | ||
this.vertices.push(vertex); | ||
// this.graph?.addNode(vertex as any); | ||
} | ||
} | ||
const canvas = new Canvas(); | ||
expect(canvas.vertices).toBeTruthy(); | ||
// @ts-ignore | ||
canvas.addVertex(` | ||
{ | ||
"x": null, | ||
"y": null, | ||
"label": "hello", | ||
"width": null, | ||
"height": null | ||
} | ||
`); | ||
expect(canvas.vertices.length).toBe(1); | ||
const vertex = canvas.vertices[0]; | ||
expect(vertex.label).toBe("hello"); | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108451
2991