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

tmi.js

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tmi.js - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

21

lib/utils.js

@@ -1,2 +0,5 @@

// Generate a random justinfan username..
var toNumber = require("underscore.string/toNumber"),
ltrim = require("underscore.string/ltrim");
// Generate a random justinfan username
function generateJustinfan() {

@@ -6,17 +9,17 @@ return "justinfan" + Math.floor((Math.random() * 80000) + 1000);

// Value is an integer..
// Determine if value is a valid integer
function isInteger(value) {
var n = ~~Number(value);
return String(n) === value;
//0 decimal places
var maybeNumber = toNumber(value, 0);
return isNaN(maybeNumber);
}
// Normalize channel name..
// Normalize channel name by including the hash
function normalizeChannel(name) {
if (name.indexOf("#") !== 0) { name = "#" + name; }
return name.toLowerCase();
return "#" + ltrim(name, "#");
}
// Normalize username..
// Normalize username by removing the hash
function normalizeUsername(username) {
return username.replace("#", "").toLowerCase();
return ltrim(username, "#");
}

@@ -23,0 +26,0 @@

{
"name": "tmi.js",
"version": "0.0.8",
"version": "0.0.9",
"description": "Javascript library for the Twitch Messaging Interface.",

@@ -18,3 +18,4 @@ "main": "index.js",

"vow": "^0.4.10",
"ws": "^0.7.2"
"ws": "^0.7.2",
"underscore.string": "^3.1.1"
},

@@ -21,0 +22,0 @@ "devDependencies": {

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