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

@hypermode/models-as

Package Overview
Dependencies
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hypermode/models-as - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

19

index.ts

@@ -16,11 +16,8 @@ import { JSON } from "json-as";

export abstract class Model<
TInput extends object = object,
TOutput extends object = object,
> {
protected constructor(
public readonly info: ModelInfo,
protected invoker: ModelInvoker,
) {}
export abstract class Model<TInput = unknown, TOutput = unknown> {
static invoker: ModelInvoker | null = null;
protected constructor(public info: ModelInfo) {}
foo: string = "bar";
debug: boolean = false;

@@ -34,2 +31,6 @@

invoke(input: TInput): TOutput {
if (!Model.invoker) {
throw new Error("Model invoker is not set.");
}
const modelName = this.info.name;

@@ -41,3 +42,3 @@ const inputJson = JSON.stringify(input);

const outputJson = this.invoker(modelName, inputJson);
const outputJson = Model.invoker(modelName, inputJson);
if (!outputJson) {

@@ -44,0 +45,0 @@ throw new Error(`Failed to invoke ${modelName} model.`);

{
"name": "@hypermode/models-as",
"version": "0.1.3",
"version": "0.1.4",
"description": "Hypermode Model Interface Library for AssemblyScript",

@@ -20,3 +20,3 @@ "author": "Hypermode, Inc.",

"devDependencies": {
"@types/node": "^20.14.4",
"@types/node": "^20.14.5",
"@typescript-eslint/eslint-plugin": "^7.13.1",

@@ -23,0 +23,0 @@ "@typescript-eslint/parser": "^7.13.1",

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