Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

json-api-query

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-api-query - npm Package Compare versions

Comparing version
2.0.0-next.3
to
2.0.0-next.4
+1
-1
package.json
{
"name": "json-api-query",
"version": "2.0.0-next.3",
"version": "2.0.0-next.4",
"description": "A query builder for JSONAPIDotNetCore",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -29,2 +29,7 @@ import { FindOptionsWhere } from './FindOptionsWhere'

order?: FindOptionsOrder<Entity>
/**
* Any extra params to append to the end of the qs
*/
extraParams?: string[]
}

@@ -491,4 +491,8 @@ import {

if(this._findOptions.extraParams){
final += this.hasQuery(final) ? `&${this._findOptions.extraParams.join('&')}` : `?${this._findOptions.extraParams.join('&')}`
}
return final
}
}

@@ -21,4 +21,2 @@ import { SparseField } from './SparseField'

case 'desc':
this.fields.push(`-${field}`)
break
case 'DESC':

@@ -25,0 +23,0 @@ this.fields.push(`-${field}`)

@@ -1,2 +0,2 @@

import { SortField } from './SortField'
import {SortField} from './SortField'

@@ -15,4 +15,6 @@ export class Sorts {

if (find !== null && find.length > 0) {
field.fields.forEach((x) => find[0].addField(x, 'desc'))
// find[0].addFields(field.fields);
field.fields.forEach((x) =>
find[0].addField(x, 'desc')
)
return this

@@ -19,0 +21,0 @@ }

@@ -233,2 +233,29 @@ import { suite, test, should, expect, chai, timeout } from './utility'

@test 'extra params - works 1'() {
let result = this.sut
.find({
extraParams:[
'test[1]=true',
]
})
.build()
expect(result).to.equal("?test[1]=true")
}
@test 'extra params - works 2'() {
let result = this.sut
.find({
extraParams:[
'test[1]=true',
'test[2]=false',
]
})
.build()
expect(result).to.equal("?test[1]=true&test[2]=false")
}
@test 'find - or implicit'() {

@@ -235,0 +262,0 @@ let result = this.sut