New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

blaze_compiler

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blaze_compiler - npm Package Compare versions

Comparing version 0.0.27 to 0.0.28

test/scenarios/inlinetest.yaml

2

package.json
{
"name": "blaze_compiler",
"version": "0.0.27",
"version": "0.0.28",
"description": "Transpiles extendable, schema orientated definitions into Firebase security rules",

@@ -5,0 +5,0 @@ "author": "Tom Larkworthy",

@@ -384,2 +384,5 @@ # Blaze Security Compiler for Firebase

## Changelog
- 21th April 2015:
- $ref not importing into (non)example schema fragments properly
- 10th April 2015:

@@ -386,0 +389,0 @@ - fixed erroneous substitution of parameters into member expressions

@@ -222,2 +222,8 @@ require('source-map-support').install();

node = exports.fetchRef(node.getOrThrow("$ref", "").coerceString().value, model);
if (key.indexOf("$") == 0 || key.indexOf("~$") == 0) {
parent.asObject().put(new Json.JString(key, -1, -1), node);
} else {
parent.asObject().getOrThrow("properties", "no properties defined above reference with key:" + key).asObject().put(new Json.JString(key, -1, -1), node);
}
}

@@ -229,3 +235,3 @@

node.getOrThrow("properties", "").asObject().forEach(function (name, child) {
annotation.properties[name.value] = annotate_schema(child, node, key, api, model);
annotation.properties[name.value] = annotate_schema(child, node, name.getString(), api, model);
});

@@ -241,3 +247,3 @@ }

annotation.properties[wildname] = annotate_schema(node.getOrThrow(wildname, "cant find wildchild"), node, key, api, model);
annotation.properties[wildname] = annotate_schema(node.getOrThrow(wildname, "cant find wildchild"), node, wildname, api, model);

@@ -244,0 +250,0 @@ var patternProperties = new Json.JObject();

@@ -280,6 +280,12 @@ require('source-map-support').install();

function annotate_schema(node: Json.JValue, parent: any, key: string, api: SchemaAPI, model: blaze.Rules):SchemaNode {
function annotate_schema(node: Json.JValue, parent: Json.JValue, key: string, api: SchemaAPI, model: blaze.Rules): SchemaNode {
if (node.has("$ref")) {
//we should replace this node with its definition
node = fetchRef(node.getOrThrow("$ref", "").coerceString().value, model);
if (key.indexOf("$") == 0 || key.indexOf("~$") == 0) {
parent.asObject().put(new Json.JString(key, -1, -1), node)
} else {
parent.asObject().getOrThrow("properties", "no properties defined above reference with key:" + key).asObject().put(new Json.JString(key, -1, -1), node)
}
}

@@ -293,3 +299,3 @@

function(name: Json.JString, child: Json.JValue){
annotation.properties[name.value] = annotate_schema(child, node, key, api, model);
annotation.properties[name.value] = annotate_schema(child, node, name.getString(), api, model);
});

@@ -308,3 +314,3 @@ }

node.getOrThrow(wildname, "cant find wildchild"),
node, key, api, model);
node, wildname, api, model);
//we also convert them into a pattern properties and add it to the JSON schema node so examples can pass

@@ -321,3 +327,3 @@ var patternProperties = new Json.JObject();

patternProperties.put(
new Json.JString(SchemaNode.KEY_PATTERN,0,0),
new Json.JString(SchemaNode.KEY_PATTERN, 0,0),
node.getOrThrow(wildname, "cant find wildchild"));

@@ -324,0 +330,0 @@ } else {

@@ -9,3 +9,3 @@ var fs = require("fs");

function run() {
console.log("working?", checkScenario("./test/scenarios/function6.yaml"));
console.log("working?", checkScenario("./test/scenarios/inlinetest.yaml"));
}

@@ -12,0 +12,0 @@

@@ -15,3 +15,3 @@ /// <reference path="../types/nodeunit.d.ts" />

//called if this file is run, used to enable runtime debugging
console.log("working?", checkScenario("./test/scenarios/function6.yaml"))
console.log("working?", checkScenario("./test/scenarios/inlinetest.yaml"))
}

@@ -18,0 +18,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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