This file contains hidden or 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
| 'use strict'; | |
| /** | |
| * Provides extensions to the built-in `Set`. | |
| * @class | |
| */ | |
| module.exports = class Set extends Set { | |
| /** | |
| * Returns a `Set` composed of the elements in the | |
| * current `Set` and a given `set`. |
This file contains hidden or 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
| var hyperquest = require('hyperquest'); | |
| var hr = hyperquest('INSERT_SLACK_WEBHOOK_URL', { method: 'POST' }); | |
| hr.setHeader('content-type', 'application/json'); | |
| hr.pipe(process.stdout); | |
| hr.end(JSON.stringify({ text: 'Test 123' })); |
This file contains hidden or 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
| module.exports = function (hook) { | |
| var hr = hook.open(hook.env.slack, { method: 'POST' }); | |
| hr.setHeader('content-type', 'application/json'); | |
| hr.end(JSON.stringify({ text: hook.params.message || 'test' })); | |
| hr.pipe(hook.res); | |
| }; | |
| module.exports.schema = { | |
| alert_type_causes: 'string' | |
| , alert_type_description: 'string' |
This file contains hidden or 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
| if (!String.toRegExp) | |
| String.toRegExp = function String_toRegExp(pattern, flags) { | |
| return new RegExp(pattern.replace(/[\[\]\\{}()+*?.$^|]/g, function (match) { return '\\' + match; }), flags); | |
| }; |
This file contains hidden or 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
| if (!String.format) | |
| String.format = function String_format(value) { | |
| if (arguments.length === 0) | |
| return null; | |
| for (var i = 1, l = arguments.length; i !== l; ++i) | |
| value = value.replace(RegExp('\\{' + (i - 1) + '\\}','gm'), arguments[i]); | |
| return value; | |
| }; |