@architect/parser
Advanced tools
Comparing version 1.1.3 to 1.1.4
66
_json.js
@@ -37,2 +37,34 @@ /** | ||
if (section === 'http') { | ||
result.http = json[section].map(route=> { | ||
let method = Object.keys(route)[0] | ||
let path = route[method] | ||
return [method, path] | ||
}) | ||
} | ||
if (section === 'events') | ||
result.events = json[section] | ||
if (section === 'queues') | ||
result.queues = json[section] | ||
if (section === 'tables') | ||
result.tables = json[section] | ||
if (section === 'indexes') | ||
result.indexes= json[section] | ||
if (section === 'scheduled') { | ||
result.scheduled = [] | ||
Object.keys(json[section]).forEach(name=> { | ||
let val = json[section][name] | ||
result.scheduled.push([name, val]) | ||
}) | ||
} | ||
if (section === 'slack') | ||
result.slack = json[section] | ||
// TODO START OF DEPRECATED METHODS | ||
if (section === 'html') { | ||
@@ -70,26 +102,5 @@ result.html = json[section].map(route=> { | ||
} | ||
// TODO END DEPRECATED | ||
if (section === 'events') | ||
result.events = json[section] | ||
if (section === 'queues') | ||
result.queues = json[section] | ||
if (section === 'tables') | ||
result.tables = json[section] | ||
if (section === 'indexes') | ||
result.indexes= json[section] | ||
if (section === 'scheduled') { | ||
result.scheduled = [] | ||
Object.keys(json[section]).forEach(name=> { | ||
let val = json[section][name] | ||
result.scheduled.push([name, val]) | ||
}) | ||
} | ||
if (section === 'slack') | ||
result.slack = json[section] | ||
}) | ||
@@ -116,2 +127,12 @@ return result | ||
} | ||
if (raw.http) { | ||
result += `@http\n` | ||
raw.http.forEach(route=> { | ||
let verb = Object.keys(route)[0] | ||
let path = route[verb] | ||
result += `${verb} ${path}\n` | ||
}) | ||
result += '\n' | ||
} | ||
// TODO START DEPREC | ||
if (raw.html) { | ||
@@ -165,2 +186,3 @@ result += `@html\n` | ||
} | ||
// TODO END DEPREC | ||
if (raw.events) { | ||
@@ -167,0 +189,0 @@ result += `@events\n` |
{ | ||
"name": "@architect/parser", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "function that accepts .arc text and returns a plain JavaScript Object", | ||
@@ -8,3 +8,3 @@ "main": "index.js", | ||
"test": "tape test/**/*-test.js | tap-spec", | ||
"t": "node test/04-scheduled.js | tap-spec" | ||
"t": "node test/05-arc-json-test.js | tap-spec" | ||
}, | ||
@@ -11,0 +11,0 @@ "author": "Brian LeRoux", |
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
67858
570