Skip to content

Commit

Permalink
refactor: Update variable names in nested loops
Browse files Browse the repository at this point in the history
Issues: Related #3
  • Loading branch information
rowanu committed Dec 26, 2019
1 parent fd0e99d commit 3fc5bc5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/effective.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ export default function(policy) {
const isValid = validate(policy)
let report = {}
if (isValid) {
const resources = []
policy.Statement.forEach(s => {
// FIXME: This variable naming is confusing
const resource = arrayify(s.Resource)
resource.forEach(r => {
const actions = arrayify(s.Action)
resources.push({ name: r, actions })
const resourceSummary = []
policy.Statement.forEach(statement => {
const resourcesArray = arrayify(statement.Resource)
resourcesArray.forEach(resource => {
const actions = arrayify(statement.Action)
resourceSummary.push({ name: resource, actions })
})
})
// TODO: Sort, uniq
report = { resources }
// TODO: Sort, uniq resources
report = { resources: resourceSummary }
}

return {
Expand Down
1 change: 1 addition & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Vue from 'vue'
import App from './App.vue'

Vue.config.productionTip = false
console.log('ohai')

new Vue({
render: h => h(App),
Expand Down

0 comments on commit 3fc5bc5

Please sign in to comment.