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

@hypermode/functions-as

Package Overview
Dependencies
Maintainers
4
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hypermode/functions-as - npm Package Compare versions

Comparing version 0.12.0-alpha2 to 0.12.0-alpha3

35

assembly/collections.ts

@@ -74,2 +74,3 @@ import * as utils from "./utils";

text: string;
labels: string[];
distance: f64;

@@ -82,2 +83,3 @@ score: f64;

text: string,
labels: string[],
distance: f64,

@@ -89,2 +91,3 @@ score: f64,

this.text = text;
this.labels = labels;
this.distance = distance;

@@ -224,2 +227,10 @@ this.score = score;

// @ts-expect-error: decorator
@external("hypermode", "getLabels")
declare function hostGetLabels(
collection: string,
namespace: string,
key: string,
): string[];
// @ts-expect-error: decorator
@external("hypermode", "searchCollectionByVector")

@@ -555,15 +566,15 @@ declare function hostSearchCollectionByVector(

console.error("Collection is empty.");
return new CollectionSearchResultObject("", "", "", 0.0, 0.0);
return new CollectionSearchResultObject("", "", "", [], 0.0, 0.0);
}
if (searchMethod.length == 0) {
console.error("Search method is empty.");
return new CollectionSearchResultObject("", "", "", 0.0, 0.0);
return new CollectionSearchResultObject("", "", "", [], 0.0, 0.0);
}
if (key1.length == 0) {
console.error("Key1 is empty.");
return new CollectionSearchResultObject("", "", "", 0.0, 0.0);
return new CollectionSearchResultObject("", "", "", [], 0.0, 0.0);
}
if (key2.length == 0) {
console.error("Key2 is empty.");
return new CollectionSearchResultObject("", "", "", 0.0, 0.0);
return new CollectionSearchResultObject("", "", "", [], 0.0, 0.0);
}

@@ -628,1 +639,17 @@ return hostComputeDistance(collection, namespace, searchMethod, key1, key2);

}
export function getLabels(
collection: string,
key: string,
namespace: string = "",
): string[] {
if (collection.length == 0) {
console.error("Collection is empty.");
return [];
}
if (key.length == 0) {
console.error("Key is empty.");
return [];
}
return hostGetLabels(collection, namespace, key);
}

2

package.json
{
"name": "@hypermode/functions-as",
"version": "0.12.0-alpha2",
"version": "0.12.0-alpha3",
"description": "Hypermode library for AssemblyScript functions",

@@ -5,0 +5,0 @@ "author": "Hypermode, Inc.",

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