forked from TryGhost/node-sqlite3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading node environment & functions from a file.
This has many problems which are discussed in TryGhost#448.
- Loading branch information
Showing
4 changed files
with
88 additions
and
50 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
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
exports.MY_UPPERCASE = function(value) { | ||
return value.toUpperCase(); | ||
}; | ||
|
||
exports.MY_STRING_JOIN = function(value1, value2) { | ||
return [value1, value2].join(' '); | ||
}; | ||
|
||
exports.MY_Add = function(value1, value2) { | ||
return value1 + value2; | ||
}; | ||
|
||
exports.MY_REGEX = function(regex, value) { | ||
return !!value.match(new RegExp(regex)); | ||
}; | ||
|
||
exports.MY_REGEX_VALUE = function(regex, value) { | ||
return /match things/i; | ||
}; | ||
|
||
exports.MY_ERROR = function(value) { | ||
throw new Error('This function always throws'); | ||
}; | ||
|
||
exports.MY_UNHANDLED_TYPE = function(value) { | ||
return {}; | ||
}; | ||
|
||
exports.MY_NOTHING = function(value) { | ||
|
||
}; | ||
|
||
exports.MY_INVALID_SCOPING = function(value) { | ||
return db; // not accessible | ||
}; | ||
|
||
exports.MY_REQUIRE = function(value) { | ||
require('./helper'); | ||
}; |
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