@membrane/membrane-sdk-js
Advanced tools
Comparing version 0.2.5 to 0.2.6
@@ -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.2.6", | ||
"description": "Helpers for working with Membrane", | ||
@@ -17,6 +17,8 @@ "license": "MIT", | ||
"dependencies": { | ||
"assert": "^2.1.0", | ||
"deep-equal": "^1.0.1", | ||
"immutable": "^4.3.0", | ||
"lodash.debounce": "^4.0.8", | ||
"promise-timeout": "1.1.1" | ||
"promise-timeout": "1.1.1", | ||
"util": "^0.12.5" | ||
}, | ||
@@ -23,0 +25,0 @@ "devDependencies": { |
@@ -1,14 +0,3 @@ | ||
# 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 | ||
Membrane gref parser and schema utils using immutable.js | ||
# Modules | ||
- 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
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
2962
0
112583
6
4
+ Addedassert@^2.1.0
+ Addedutil@^0.12.5
+ Addedassert@2.1.0(transitive)
+ Addedavailable-typed-arrays@1.0.7(transitive)
+ Addedfor-each@0.3.3(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-callable@1.2.7(transitive)
+ Addedis-generator-function@1.0.10(transitive)
+ Addedis-nan@1.3.2(transitive)
+ Addedis-typed-array@1.1.13(transitive)
+ Addedobject.assign@4.1.5(transitive)
+ Addedpossible-typed-array-names@1.0.0(transitive)
+ Addedutil@0.12.5(transitive)
+ Addedwhich-typed-array@1.1.15(transitive)