@hypermode/modus-sdk-as
Advanced tools
Comparing version 0.14.2 to 0.15.0-alpha.1
@@ -33,1 +33,9 @@ /* | ||
export { auth }; | ||
import * as neo4j from "./neo4j"; | ||
export { neo4j }; | ||
import * as utils from "./utils"; | ||
export { utils }; | ||
export * from "./dynamicmap"; |
@@ -240,5 +240,5 @@ /* | ||
*/ | ||
export function magnitude<T extends number>(a: T[]): f64 { | ||
export function magnitude<T extends number>(a: T[]): T { | ||
checkValidArray(a); | ||
return sqrt<f64>(dot(a, a)); | ||
return sqrt<f64>(dot(a, a)) as T; | ||
} | ||
@@ -252,8 +252,8 @@ | ||
*/ | ||
export function normalize<T extends number>(a: T[]): f64[] { | ||
export function normalize<T extends number>(a: T[]): T[] { | ||
checkValidArray(a); | ||
const magnitudeValue = magnitude(a); | ||
const result: f64[] = new Array<f64>(a.length); | ||
const result: T[] = new Array<T>(a.length); | ||
for (let i = 0; i < a.length; i++) { | ||
result[i] = (a[i] as f64) / magnitudeValue; | ||
result[i] = ((a[i] as T) / magnitudeValue) as T; | ||
} | ||
@@ -299,5 +299,5 @@ return result; | ||
*/ | ||
export function mean<T extends number>(a: T[]): f64 { | ||
export function mean<T extends number>(a: T[]): T { | ||
checkValidArray(a); | ||
return f64(sum(a)) / f64(a.length); | ||
return (sum(a) / a.length) as T; | ||
} | ||
@@ -377,5 +377,5 @@ | ||
for (let i = 0; i < a.length; i++) { | ||
sum += f64(a[i] - b[i]) ** 2; | ||
sum += (a[i] - b[i]) ** 2; | ||
} | ||
return sqrt<f64>(sum); | ||
} |
{ | ||
"name": "@hypermode/modus-sdk-as", | ||
"version": "0.14.2", | ||
"version": "0.15.0-alpha.1", | ||
"repository": "github:hypermodeinc/modus", | ||
@@ -29,12 +29,12 @@ "description": "Modus SDK for AssemblyScript", | ||
"devDependencies": { | ||
"@eslint/js": "^9.15.0", | ||
"@eslint/js": "^9.16.0", | ||
"@types/eslint__js": "^8.42.3", | ||
"@types/node": "^22.10.0", | ||
"@types/node": "^22.10.1", | ||
"as-test": "^0.3.5", | ||
"assemblyscript": "^0.27.31", | ||
"assemblyscript-prettier": "^3.0.1", | ||
"eslint": "^9.15.0", | ||
"prettier": "^3.4.1", | ||
"eslint": "^9.16.0", | ||
"prettier": "^3.4.2", | ||
"typescript": "^5.7.2", | ||
"typescript-eslint": "^8.16.0", | ||
"typescript-eslint": "^8.17.0", | ||
"visitor-as": "^0.11.4" | ||
@@ -41,0 +41,0 @@ }, |
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
160696
34
5131