0.1.5 • Published 3 years ago

filtered v0.1.5

Weekly downloads
45
License
MIT
Repository
github
Last release
3 years ago

Introducing filtered

CI

Text based filter and search service for firebase cloud firestore collections and any array of objects

Install filtered via NPM

 npm i filtered --save

Get filtered over CDN as an E6 Module

import { filtered } from "https://unpkg.com/filtered/esm/index.js";

Install and import filtered in your app

import { filtered } from "filtered";

API Spec

Filtered receives an object with three required keys as shown below;

Firebase cloud firestore collection

Pass an additional firestore param for firebase cloud firestone text-based collection document search.

// Do some awesome filtering....
//...
const result = filtered({
  data,
  firestore: true,
  filter,
  query,
});

For any array of objects

// Do some awesome filtering....
//...
const result = filtered({
  data,
  filter,
  query,
});

Parameters

NameTypeRequiredDescription
dataarray of objectstrueAn array of objects or firebase cloud firestore collection documents array
firestorebooleanfalseMust be set to true if passing firebase cloud firestore collection documents
filterstringtrueThe field or key to filter against in an object or cloud firestore collection document
querystringtrueThe query string to filter with

Response

NameTypeDescription
resultarray of objectsQuery result - an array of found items, could be empty if no result

Enjoy!

0.1.5

3 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.3

3 years ago

0.0.4

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago