Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spotlight

A recreation of the MacOS Spotlight search feature using functional principles.

API

import { spotlight } from "spotlight"
import { string } from "spotlight/middlewares"

const middleware = [string]
const context = ["apple", "orange", "melon", "watermelon"]
const getResults = spotlight(middleware, context)

console.log(getResults("melon OR apple")) // ["melon", "watermelon", "apple"]
type Middleware = (context: any[]) => (query: string) => Result[]
type GetResultFn = (query: string) => Result[]

interface Result {
    score: number
    value: any
}

function spotlight(middleware: Middleware[], context: string): GetResultFn {}

About

A recreation of MacOS Spotlight using functional principles

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages