Socket
Socket
Sign inDemoInstall

arangolize

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arangolize - npm Package Compare versions

Comparing version 0.9.3 to 0.9.4

yarn.lock

46

dist/index.js

@@ -96,3 +96,19 @@ "use strict";

} else {
query(` return MERGE(instance, { @includeAs: DOCUMENT(instance[@includeAs]) }) \n), \n`);
query(`let doc = MERGE(instance, { @includeAs: DOCUMENT(instance[@includeAs]) })`);
if (include.where) {
Object.keys(include.where).map((key, index) => {
const variable = `${key}${index}`;
const value = `${variable}value`;
bindVars({
[variable]: key
});
bindVars({
[value]: include.where[key]
});
query(`\n filter doc.@includeAs.@${variable} == @${value}`);
});
}
query(`\n return doc)\n`);
}

@@ -149,16 +165,3 @@ }

query` return instance ) \n`; // ends data = (...)
query` return {
data: (
for instance in data
limit @skip, @limit
`;
if (attributes && !include) {
bindVars({
attributes: attributes
});
query` return KEEP(instance, @attributes) \n ), \n`;
} else if (attributes && include) {
if (attributes && include) {
query`let atts = KEEP(instance, @attributes)`;

@@ -169,8 +172,13 @@

_this.handleInclude();
} else {
query` return instance ), \n`;
}
query` meta: { count: LENGTH(data) }`;
query` \n }`;
query` return {
data: (
for instance in data
limit @skip, @limit
return instance
),
meta: { count: LENGTH(data) }
}
`;
return {

@@ -177,0 +185,0 @@ query: _this._query,

@@ -76,3 +76,15 @@ import { autobind } from 'core-decorators'

} else {
query(` return MERGE(instance, { @includeAs: DOCUMENT(instance[@includeAs]) }) \n), \n`)
query(`let doc = MERGE(instance, { @includeAs: DOCUMENT(instance[@includeAs]) })`)
if (include.where) {
Object.keys(include.where).map((key, index) => {
const variable = `${key}${index}`
const value = `${variable}value`
bindVars({[variable]: key})
bindVars({[value]: include.where[key]})
query(`\n filter doc.@includeAs.@${variable} == @${value}`)
})
}
query(`\n return doc)\n`)
}

@@ -82,3 +94,3 @@ }

async build () {
let { where, attributes, sort, include } = this.props
let { where, attributes, sort, include} = this.props
const { query, bindVars } = this

@@ -110,13 +122,3 @@

query` return instance ) \n` // ends data = (...)
query` return {
data: (
for instance in data
limit @skip, @limit
`
if (attributes && !include) {
bindVars({ attributes: attributes })
query` return KEEP(instance, @attributes) \n ), \n`
} else if (attributes && include) {
if (attributes && include) {
query`let atts = KEEP(instance, @attributes)`

@@ -126,10 +128,14 @@ this.handleInclude()

this.handleInclude()
} else {
query` return instance ), \n`
}
query` meta: { count: LENGTH(data) }`
query` return {
data: (
for instance in data
limit @skip, @limit
return instance
),
meta: { count: LENGTH(data) }
}
`
query` \n }`
return { query: this._query, bindVars: this._bindVars }

@@ -136,0 +142,0 @@ }

@@ -17,1 +17,16 @@ import test from 'tape'

})
/**/
test('should return query and bindVars', async (t) => {
const { bindVars, query } = await arangolize({
collection: 'test',
include: {
as: 'user',
where: { name: 'Noah', createdAt: "2017-09-05T12:05:30.166Z" }
}
})
t.ok(bindVars, 'should have bindVars')
t.ok(query, 'should have query')
t.end()
})
{
"name": "arangolize",
"version": "0.9.3",
"version": "0.9.4",
"description": "Sequelize-like query-builder for ArangoDB",

@@ -11,3 +11,4 @@ "main": "dist/index.js",

"scripts": {
"prepublish": "./node_modules/.bin/babel index.js -d ./dist --ignore node_modules/ --ignore dist/"
"prepublish": "./node_modules/.bin/babel index.js -d ./dist --ignore node_modules/ --ignore dist/",
"test": "./node_modules/.bin/tape -r @babel/register index.test.js"
},

@@ -19,4 +20,10 @@ "devDependencies": {

"@babel/preset-env": "^7.0.0-beta.37",
"@babel/preset-stage-0": "^7.0.0-beta.37"
"@babel/preset-stage-0": "^7.0.0-beta.37",
"@babel/register": "^7.0.0-beta.39",
"tape": "^4.8.0"
},
"dependencies": {
"@babel/register": "^7.0.0-beta.39",
"core-decorators": "^0.20.0"
}
}
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