Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stopstop

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stopstop - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

87

lib/index.js
// Generated by LiveScript 1.4.0
(function(){
var request, util, stop, slice$ = [].slice;
var request, util, extend, curry, stoptions, slice$ = [].slice;
request = require('request');
util = require('util');
stop = curry$(function(token, chat_id, options){
var ref$;
request.post({
uri: "https://api.telegram.org/bot" + token + "/sendMessage",
form: (ref$ = import$({}, options), ref$.chat_id = chat_id, ref$)
}, function(){});
return stop(token, chat_id);
extend = require('extend');
module.exports = function(it){
switch (typeof it) {
case 'string':
return curry.apply(this, arguments);
case 'object':
return stoptions.apply(this, arguments);
default:
throw new Error('First parameter must be options or a token');
}
};
curry = curry$(function(token, chat_id){
return stoptions.apply(null, [{
token: token,
params: {
chat_id: chat_id
}
}].concat(slice$.call(slice$.call(arguments, 2, -1 + 1 || 9e9))));
});
module.exports = curry$(function(token, chat_id, output){
var that;
if (token == null) {
return module.exports;
stoptions = function(it){
var options, that, chat_id, x$, stopit;
options = extend(true, {}, it);
if (options.token == null) {
throw new Error("Missing 'token' option");
}
token = token.trim();
if (that = /^(?:(?:.*\/)?bot)?([^\/]*)(?:\/.*)?$/.exec(token)) {
token = that[1];
if (that = /(?:bot)?(\d+:[-\w]+)/.exec(options.token)) {
options.token = that[1];
} else {
throw new Error("Invalid token: " + options.token);
}
if (chat_id == null) {
return module.exports(token);
if (options.params == null) {
throw new Error("Missing 'params' option");
}
if (output === module.exports) {
return stop.apply(null, [token, chat_id].concat(slice$.call(slice$.call(arguments, 3, -1 + 1 || 9e9))));
if (options.params.chat_id == null) {
throw new Error("Missing 'chat_id' parameter");
}
stop(token, chat_id, {
text: util.format.apply(util, slice$.call(arguments, 2, -1 + 1 || 9e9))
if (!isNaN(chat_id = parseInt(options.params.chat_id))) {
options.params.chat_id = chat_id;
} else {
throw new Error("Invalid chat_id: " + options.params.chat_id);
}
x$ = stopit = function(it){
return it;
}(
function(){
request.post({
url: "https://api.telegram.org/bot" + options.token + "/sendMessage",
form: extend(true, {}, options.params, {
text: bind$(util, 'format').apply(this, arguments)
})
}, function(){});
return stopit;
});
return module.exports(token, chat_id);
});
function import$(obj, src){
var own = {}.hasOwnProperty;
for (var key in src) if (own.call(src, key)) obj[key] = src[key];
return obj;
}
x$.now = function(it){
return stoptions.apply(null, [extend(true, {}, options, it)].concat(slice$.call(slice$.call(arguments, 1, -1 + 1 || 9e9))));
};
if (arguments.length > 1) {
x$.apply(null, slice$.call(arguments, 1, -1 + 1 || 9e9));
}
return x$;
};
function curry$(f, bound){

@@ -52,2 +80,5 @@ var context,

}
function bind$(obj, key, target){
return function(){ return (target || obj)[key].apply(obj, arguments) };
}
}).call(this);
{
"name": "stopstop",
"version": "2.0.0",
"version": "3.0.0",
"description": "simple telegram output passer",

@@ -12,3 +12,3 @@ "main": "lib/index.js",

"postpublish": "npm run clean",
"test": "lsc test/~"
"test": "lsc test"
},

@@ -40,2 +40,3 @@ "repository": {

"dependencies": {
"extend": "^3.0.0",
"request": "^2.69.0"

@@ -42,0 +43,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc