-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated index.js Properly evaluate actions, currently supporting 'log' Included actions/*
- Loading branch information
Dustyn Blackmore
committed
Apr 24, 2018
1 parent
6444da5
commit 378ade5
Showing
6 changed files
with
87 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
function write (fs, content) { | ||
return new Promise((resolve, reject) => { | ||
fs.appendFile('./logs/test.js', content + '\n', (error) => { | ||
if (error) { | ||
reject(error) | ||
} else { | ||
resolve() | ||
} | ||
}) | ||
}) | ||
} | ||
|
||
const filesystem = (fs) => ({ | ||
log: (content) => { | ||
return write(fs, content); | ||
} | ||
}) | ||
|
||
module.exports = filesystem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const filesystem = require('./filesystem'); | ||
|
||
const actions = (dependencies) => { | ||
if (Object.keys(dependencies).includes('fs')) { | ||
return Object.assign( | ||
{}, | ||
actions, | ||
filesystem(dependencies.fs) | ||
) | ||
} | ||
|
||
return false; | ||
} | ||
|
||
module.exports = actions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ | |
"zone": "untrusted" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ const protocols = { | |
PC_IGMP: 2, | ||
PC_TCP: 6, | ||
PC_UDP: 17, | ||
} | ||
} |