Socket
Socket
Sign inDemoInstall

@zeit/cosmosdb-query

Package Overview
Dependencies
Maintainers
15
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zeit/cosmosdb-query - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

lib/builtin-functions.js

3

lib/executor.js
//
const builtinFunctions = require("./builtin-functions");

@@ -19,3 +20,3 @@ module.exports = (

// $FlowFixMe
return execute(collection, params);
return execute(builtinFunctions, collection, params);
};

@@ -19,2 +19,9 @@ //

const definitions = {
array_constant(ctx, { elements }) {
return {
type: "ArrayExpression",
elements: elements.map(v => transform(ctx, v))
};
},
boolean_constant(ctx, { value }) {

@@ -164,2 +171,13 @@ return {

object_constant(ctx, { properties }) {
return {
type: 'ObjectExpression',
properties: properties.map(({ key, value }) => ({
type: 'ObjectProperty',
key: transform(ctx, key),
value: transform(ctx, value)
}))
}
},
object_property_list(ctx, { properties }) {

@@ -195,6 +213,6 @@ return {

scalar_array_expression(ctx, { values }) {
scalar_array_expression(ctx, { elements }) {
return {
type: "ArrayExpression",
elements: values.map(v => transform(ctx, v))
elements: elements.map(v => transform(ctx, v))
};

@@ -235,2 +253,17 @@ },

scalar_function_expression(ctx, { name, arguments: args, udf }) {
return {
type: 'CallExpression',
callee: {
type: "MemberExpression",
object: {
type: "Identifier",
name: udf ? "udf" : "$b"
},
property: transform(ctx, name)
},
arguments: args.map((a) => transform(ctx, a))
}
},
scalar_member_expression(ctx, { object, property, computed }) {

@@ -302,6 +335,13 @@ return {

params: [
// built-int functions
{
type: "Identifier",
name: "$b"
},
// document array (collection)
{
type: "Identifier",
name
},
// parameters
{

@@ -316,3 +356,3 @@ type: "Identifier",

select_specification(ctx, { "*": all, properties }) {
select_specification(ctx, { "*": all, properties, value }) {
if (all) {

@@ -322,3 +362,3 @@ return ctx.ast;

if (properties) {
if (properties || value) {
return {

@@ -338,3 +378,3 @@ type: "CallExpression",

params: ctx.document ? [ctx.document] : [],
body: transform(ctx, properties)
body: transform(ctx, properties || value)
}

@@ -341,0 +381,0 @@ ]

{
"name": "@zeit/cosmosdb-query",
"version": "0.0.3",
"version": "0.0.4",
"license": "UNLICENSED",

@@ -20,4 +20,4 @@ "main": "lib/index.js",

"dependencies": {
"@babel/generator": "7.0.0-rc.3",
"@babel/traverse": "7.0.0-rc.3"
"@babel/generator": "7.0.0",
"@babel/traverse": "7.0.0"
},

@@ -27,4 +27,4 @@ "devDependencies": {

"@zeit/git-hooks": "0.1.4",
"babel-eslint": "8.2.6",
"eslint": "5.4.0",
"babel-eslint": "9.0.0",
"eslint": "5.5.0",
"eslint-config-airbnb": "17.1.0",

@@ -36,3 +36,3 @@ "eslint-config-prettier": "3.0.1",

"eslint-plugin-react": "7.11.1",
"flow-bin": "0.79.1",
"flow-bin": "0.80.0",
"flow-remove-types": "1.2.3",

@@ -39,0 +39,0 @@ "pegjs": "0.10.0",

@@ -30,9 +30,6 @@ # cosmosdb-query

- TOP operator
- VALUE keyword
- JOIN keyword
- IN keyword
- Built-in functions
- Object constant
- Array constant
- Some Built-in functions (See [src/builtin-functions.js](https://github.com/zeit/cosmosdb-query/blob/master/src/builtin-functions.js) for supported functions)
- Coalesce operator
- User-defined functions

Sorry, the diff of this file is too big to display

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