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

input-number

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

input-number - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

20

index.js

@@ -12,3 +12,3 @@ /**

};
const numRE = /[\.0-9]/;
const numRE = /[\-\.0-9]/;

@@ -24,2 +24,4 @@ module.exports = numerify;

var focused = false;
input.addEventListener('keydown', e => {

@@ -35,3 +37,2 @@ let key = keys[e.which];

//parse left side

@@ -72,3 +73,18 @@ let left = pos.start;

caret.set(input, left, result.length - rightStr.length);
//resurrect suppressed event
let inputEvent = new Event('input');
input.dispatchEvent(inputEvent);
//emulate change event
if (!focused) {
focused = true;
input.addEventListener('blur', function change () {
input.removeEventListener('blur', change);
let changeEvent = new Event('change');
input.dispatchEvent(changeEvent);
focused = false;
});
}
});
}

2

package.json
{
"name": "input-number",
"version": "1.0.3",
"version": "1.0.4",
"description": "Make input recognize numbers",

@@ -5,0 +5,0 @@ "main": "index.js",

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