@site-o-mat/query (0.1.0)

Published 1 year ago by HerrHase

Installation

@site-o-mat:registry=https://git.node001.net/api/packages/site-o-mat/npm/
npm install @site-o-mat/query@0.1.0
"@site-o-mat/query": "0.1.0"

About this package

Site-O-Mat Query

Installation

Setup this registry in your project .npmrc file:

@site-o-mat:registry=https://gitea.node001.net/api/packages/site-o-mat/npm/

Install with npm or yarn

npm i --save-dev @site-o-mat/query
yarn add --dev @site-o-mat/query

Filter

Basic Usage:

import { Filter } from '@site-o-mat/query'

const filter = new Filter(options)
const isValid = filter.validate(result)

Options:

Name Type Description
_eq {Mixed} is equal
_neq {Mixed} is not equal
_in {Mixed} in array
_lt {Mixed} is lesser than
_lte {Mixed} is lesser or equal than
_gt {Mixed} is greater than
_gte {Mixed} is greater or equal than
_null {Boolean} is null
_nnull {Boolean} is not null

Reduce

Skip or Limit Elements from a an Array.

Basic Usage:

import { reduce } from '@site-o-mat/query'
results = reduce({
	limit: 5
}, results)

Options:

Name Type Description
limit {Number} limit elements
offset {Number} skip elements

OrderBy

Order elements in Array by name of property, default is 'asc', a '-' of the name is 'desc'.

Basic Usage:

import { orderBy } from '@site-o-mat/query'
results = orderBy([
	-published_at
], results)

Dependencies

Dependencies

ID Version
assign-deep ^1.0.1
lodash.orderby ^4.6.0

Development Dependencies

ID Version
chai ^4.3.7
mocha ^10.2.0
Details
npm
1 year ago
46
Björn Hase
latest
3.1 KiB
Assets (1)
query-0.1.0.tgz 3.1 KiB
Versions (1) View all
0.1.0 on 2023-02-12