Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aire-ux/aire-condensation

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aire-ux/aire-condensation - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

build/libs/aire-condensation-1.0.16-SNAPSHOT-javadoc.jar

2

dist/condensation.d.ts

@@ -11,3 +11,3 @@ import TypeRegistry from "./type-registry";

move<T>(address: Address, target: Region): Pointer<T> | null;
invoke<T, U>(address: Address, op: string, ...args: string[]): U | null;
invoke<T, U>(address: Address | Pointer<T>, op: string, ...args: string[]): U | null;
delete<T>(address: Address): T | null;

@@ -14,0 +14,0 @@ addressOf<T>(t: T): Address | null;

@@ -39,3 +39,3 @@ var __read = (this && this.__read) || function (o, n) {

import RemoteRegistry from "./remote-registry";
import { allocate, Region } from "./types";
import { allocate, isPointer, Region } from "./types";
import { BooleanDeserializer, NumberDeserializer, StringDeserializer, TypeRegistrationDeserializer, } from "./deserializer";

@@ -94,3 +94,9 @@ /**

}
var v = this.locate(address);
var v;
if (isPointer(address)) {
v = address;
}
else {
v = this.locate(address);
}
if (!v) {

@@ -97,0 +103,0 @@ throw new Error("Null pointer exception at ".concat(address, " while trying to invoke ").concat(op));

@@ -24,2 +24,7 @@ /**

/**
* guard allowing use of pointers as addresses
* @param t the value to check
*/
export declare function isPointer<T>(t: Pointer<T> | Address): boolean;
/**
* allocate a value into a pointer

@@ -26,0 +31,0 @@ * @param value the value to allocate

@@ -20,2 +20,9 @@ /**

/**
* guard allowing use of pointers as addresses
* @param t the value to check
*/
export function isPointer(t) {
return t.address !== undefined;
}
/**
* allocate a value into a pointer

@@ -22,0 +29,0 @@ * @param value the value to allocate

{
"name": "@aire-ux/aire-condensation",
"version": "0.0.3",
"version": "0.0.4",
"description": "Client-side serialization library for Aire-UX",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

import TypeRegistry from "@condensation/type-registry";
import RemoteRegistry, { InvocationType } from "@condensation/remote-registry";
import { Address, allocate, Class, Pointer, Region } from "@condensation/types";
import {
Address,
allocate,
Class,
isPointer,
Pointer,
Region,
} from "@condensation/types";
import {
BooleanDeserializer,

@@ -11,2 +18,3 @@ Deserializer,

} from "@condensation/deserializer";
import { add } from "husky";

@@ -24,3 +32,7 @@ export type Format = "json";

invoke<T, U>(address: Address, op: string, ...args: string[]): U | null;
invoke<T, U>(
address: Address | Pointer<T>,
op: string,
...args: string[]
): U | null;

@@ -76,4 +88,13 @@ delete<T>(address: Address): T | null;

invoke<T, U>(address: Address, op: string, ...args: string[]): U | null {
const v = this.locate(address) as Pointer<T>;
invoke<T, U>(
address: Address | Pointer<T>,
op: string,
...args: string[]
): U | null {
let v: Pointer<T>;
if (isPointer(address)) {
v = address as Pointer<T>;
} else {
v = this.locate(address as Address) as Pointer<T>;
}
if (!v) {

@@ -80,0 +101,0 @@ throw new Error(

@@ -39,2 +39,10 @@ /**

/**
* guard allowing use of pointers as addresses
* @param t the value to check
*/
export function isPointer<T>(t: Pointer<T> | Address) {
return (t as Pointer<T>).address !== undefined;
}
/**
* allocate a value into a pointer

@@ -41,0 +49,0 @@ * @param value the value to allocate

@@ -182,1 +182,33 @@ import { Receive, Remotable } from "@condensation/remotable";

});
test("pointers should be invocable", () => {
@RootElement
class Person {
@Property(String)
name: string | undefined;
}
@Remotable
class MxGraphManager {
person: Person | undefined;
public init(@Receive(Person) person: Person): void {
this.person = person;
}
}
const ctx = Condensation.newContext(),
mgr = ctx.create<MxGraphManager>(MxGraphManager);
ctx.invoke(
mgr,
"init",
`
{
"name": "Josiah"
}
`
);
expect(mgr.person?.name).toBe("Josiah");
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc