📝Similarity Filter

This module is used to filter objects by similarity (full, 50%, any-one).

Imports

import { SimilarityFilterService } from 'niro-health';

Method of Use

To use this module, you need to inject it into the desired service.

import { Module } from '@nestjs/common';
import {
  SimilarityFilterService,
} from 'niro-health';
import { AppController } from './app.controller';
import { AppService } from './app.service';

@Module({
  controllers: [AppController],
  providers: [
    AppService,
    {
      provide: 'ISimilarityFilterService',
      useClass: SimilarityFilterService,
    },
  ],
})
export class AppModule {}

Injecting the module into our service.

import { Inject, Injectable } from '@nestjs/common';
import type { ISimilarityFilterService } from 'niro-health';

@Injectable()
export class AppService {
  constructor(
    @Inject('ISimilarityFilterService')
    private readonly similarityFilterService: ISimilarityFilterService,
  ) {}

  public async execute() {
    return this.similarityFilterService.execute(
      {
        name: 'John Doe',
      },
      {
        name: 'John Doe',
        age: 24,
        address: {
          street: 'test',
          number: 10,
        },
      },
      '50%',
    )
  }
}

Without dependencies

You won't need to connect the pieces with any other module.

Methods

Method
Scope
Description

execute

public

Filter objects by similarity (full, 50%, any-one).

Last updated