Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aqb

Package Overview
Dependencies
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aqb - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

2

package.json
{
"name": "aqb",
"version": "2.0.1",
"version": "2.0.2",
"description": "ArangoDB AQL query builder.",

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

@@ -562,5 +562,5 @@ # ArangoDB Query Builder

Creates a function call for the given name and arguments.
Creates a functon call for the given name and arguments.
`qb.fn(name)(args…)`
`qb.fn(name)(...args)`

@@ -685,9 +685,9 @@ If the values are not already AQL values, they will be converted automatically.

##### … KEEP
##### … KEEP ...vars
`CollectExpression::keep() : CollectExpression`
`CollectExpression::keep(...vars) : CollectExpression`
**Examples**
* `_.into('z').keep()` => `INTO z KEEP`
* `_.into('z').keep('a', 'b')` => `INTO z KEEP a, b`

@@ -710,5 +710,5 @@ #### … INTO varname = expression

### … SORT args…
### … SORT ...args
`PartialStatement::sort(args…) : PartialStatement`
`PartialStatement::sort(...args) : PartialStatement`

@@ -715,0 +715,0 @@ **Examples**

@@ -664,3 +664,3 @@ /*jshint browserify: true */

function CollectExpression(prev, dfns, varname, intoExpr, keep, options) {
function CollectExpression(prev, dfns, varname, intoExpr, keepNames, options) {
this._prev = prev;

@@ -675,7 +675,18 @@ this._dfns = new Definitions(dfns);

this._varname = new Identifier(varname);
if (!keep) {
if (!keepNames) {
this.keep = function () {
return new CollectExpression(prev, dfns, varname, undefined, true, options);
var newKeepNames = Array.prototype.slice.call(arguments);
return new CollectExpression(prev, dfns, varname, undefined, newKeepNames, options);
};
} else this._keep = true;
} else {
if (!Array.isArray(keepNames)) {
throw new AqlError('Expected keep list to be an array: ' + keepNames);
}
if (!keepNames.length) {
throw new AqlError('Expected keep list not to be empty: ' + keepNames);
}
this._keep = keepNames.map(function (keepVar) {
return new Identifier(keepVar);
});
}
}

@@ -688,6 +699,6 @@ } else if (varname) {

this.options = function (newOpts) {
return new CollectExpression(prev, dfns, varname, intoExpr, keep, newOpts);
return new CollectExpression(prev, dfns, varname, intoExpr, keepNames, newOpts);
};
} else this._options = new ObjectLiteral(options);
if (!varname && !intoExpr && !keep) {
if (!varname && !intoExpr && !keepNames) {
this.withCountInto = function (newVarname) {

@@ -706,3 +717,5 @@ return new CollectWithCountIntoExpression(prev, dfns, newVarname, options);

this._intoExpr ? ' = ' + wrapAQL(this._intoExpr) :
(this._keep ? ' KEEP' : '')
(this._keep ? ' KEEP ' + this._keep.map(function (keep) {
return keep.toAQL();
}).join(', ') : '')
) : '') +

@@ -709,0 +722,0 @@ (this._options ? ' OPTIONS ' + wrapAQL(this._options) : '')

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc