1- const { raw } = require ( '@mikro-orm/core' ) ;
2- const { BitType } = require ( './bit' ) ;
3- const { HalfvecType } = require ( './halfvec' ) ;
4- const { SparsevecType } = require ( './sparsevec' ) ;
5- const { VectorType } = require ( './vector' ) ;
6- const { toSql } = require ( '../utils' ) ;
1+ import { raw } from '@mikro-orm/core' ;
2+ import { toSql } from '../utils/index.js' ;
3+
4+ export { BitType } from './bit.js' ;
5+ export { HalfvecType } from './halfvec.js' ;
6+ export { SparsevecType } from './sparsevec.js' ;
7+ export { VectorType } from './vector.js' ;
78
89function distance ( op , column , value , em , binary ) {
910 if ( raw ) {
@@ -13,39 +14,26 @@ function distance(op, column, value, em, binary) {
1314 }
1415}
1516
16- function l2Distance ( column , value , em ) {
17+ export function l2Distance ( column , value , em ) {
1718 return distance ( '<->' , column , value , em ) ;
1819}
1920
20- function maxInnerProduct ( column , value , em ) {
21+ export function maxInnerProduct ( column , value , em ) {
2122 return distance ( '<#>' , column , value , em ) ;
2223}
2324
24- function cosineDistance ( column , value , em ) {
25+ export function cosineDistance ( column , value , em ) {
2526 return distance ( '<=>' , column , value , em ) ;
2627}
2728
28- function l1Distance ( column , value , em ) {
29+ export function l1Distance ( column , value , em ) {
2930 return distance ( '<+>' , column , value , em ) ;
3031}
3132
32- function hammingDistance ( column , value , em ) {
33+ export function hammingDistance ( column , value , em ) {
3334 return distance ( '<~>' , column , value , em , true ) ;
3435}
3536
36- function jaccardDistance ( column , value , em ) {
37+ export function jaccardDistance ( column , value , em ) {
3738 return distance ( '<%>' , column , value , em , true ) ;
3839}
39-
40- module . exports = {
41- VectorType,
42- HalfvecType,
43- BitType,
44- SparsevecType,
45- l2Distance,
46- maxInnerProduct,
47- cosineDistance,
48- l1Distance,
49- hammingDistance,
50- jaccardDistance
51- } ;
0 commit comments