@membrane/membrane-sdk-js
Advanced tools
Comparing version 0.2.5 to 0.3.0
@@ -27,6 +27,6 @@ "use strict"; | ||
} | ||
return "[".concat(value, "]"); | ||
return "(".concat(value, ")"); | ||
} | ||
else if (typeof value === "string") { | ||
return "\"".concat(value, "\""); | ||
else if (typeof value === "string" || typeof value === "object") { | ||
return JSON.stringify(value); | ||
} | ||
@@ -33,0 +33,0 @@ return "".concat(value); |
@@ -84,9 +84,9 @@ "use strict"; | ||
RefParser.prototype.parseInnerRef = function () { | ||
if (this.char !== "[") { | ||
throw this.syntaxError("Expected '['"); | ||
if (this.char !== "(") { | ||
throw this.syntaxError("Expected '('"); | ||
} | ||
this.advance(1); | ||
var result = this.parseRef(); | ||
if (this.char !== "]") { | ||
throw this.syntaxError("Expected ']'"); | ||
if (this.char !== ")") { | ||
throw this.syntaxError("Expected ')'"); | ||
} | ||
@@ -117,3 +117,6 @@ this.advance(1); | ||
var name; | ||
if (isLowerCase(this.code) || isDigit(this.code) || this.code === _POUND || this.code === _AT) { | ||
if (isLowerCase(this.code) || | ||
isDigit(this.code) || | ||
this.code === _POUND || | ||
this.code === _AT) { | ||
name = this.parseProgramIdentifier(); | ||
@@ -149,4 +152,3 @@ } | ||
!isDigit(this.code) && | ||
!this.code === _POUND && | ||
!this.code === _AT) { | ||
this.code !== _POUND) { | ||
throw this.syntaxError("Expected program identifier"); | ||
@@ -163,3 +165,7 @@ } | ||
var minus = false; | ||
while (isIdentifierChar(this.code) || this.code === _MINUS) { | ||
var at = false; | ||
while (isIdentifierChar(this.code) || | ||
this.code === _MINUS || | ||
this.code === _AT) { | ||
// Only one dash in a row | ||
if (this.code === _MINUS && minus) { | ||
@@ -169,2 +175,9 @@ throw this.syntaxError("Root names cannot have two \"-\" in sequence"); | ||
minus = this.code === _MINUS; | ||
// Only one @ in the program identifier | ||
if (this.code === _AT) { | ||
if (at) { | ||
throw this.syntaxError("Ref root cannot have more than one \"@\""); | ||
} | ||
at = true; | ||
} | ||
this.advance(1); | ||
@@ -181,3 +194,3 @@ } | ||
RefParser.prototype.isEndOfRef = function () { | ||
return this.position >= this.str.length || this.code === _BRACKETCLOSE; | ||
return this.position >= this.str.length || this.code === _PARENCLOSE; | ||
}; | ||
@@ -246,3 +259,3 @@ RefParser.prototype.parsePath = function () { | ||
var type; | ||
if (this.code === _BRACKETOPEN) { | ||
if (this.code === _PARENOPEN) { | ||
type = "ref"; | ||
@@ -408,4 +421,4 @@ value = this.parseInnerRef(); | ||
var _AT = "@".charCodeAt(0); | ||
var _BRACKETOPEN = "[".charCodeAt(0); | ||
var _BRACKETCLOSE = "]".charCodeAt(0); | ||
var _PARENOPEN = "(".charCodeAt(0); | ||
var _PARENCLOSE = ")".charCodeAt(0); | ||
var _E = "E".charCodeAt(0); | ||
@@ -412,0 +425,0 @@ var _e = "e".charCodeAt(0); |
{ | ||
"name": "@membrane/membrane-sdk-js", | ||
"version": "0.2.5", | ||
"version": "0.3.0", | ||
"description": "Helpers for working with Membrane", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -1,14 +0,5 @@ | ||
# Goals | ||
- Shared between client and server (and thus not in avya-common) | ||
- Write a fully immutable version of Ref (should I use immutable.js?) | ||
- Write a consistent version of SchemaTraversal. And RefTraversal? | ||
- Use flow on all files. Export types | ||
- Test as much as possible so that I can work on a solid foundation | ||
# Deprecated | ||
# Modules | ||
Use `@membrane/sdk` instead | ||
- Ref. Use Immutable.js so that we don't need a RefBuilder | ||
- SchemaTraversal. Same as old one but with a consistent interface | ||
- RefTraversal. Traverses a ref through a schema. | ||
- Ref normalization/denormalization? Possibly |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2962
112521
6
1