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

filevalidator

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filevalidator - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

10

filevalidator.js

@@ -14,3 +14,11 @@ define([

// MP3 file with an ID3v2 container
[0x49, 0x44, 0x33]
[0x49, 0x44, 0x33],
// Other MP3 files (FF Fx and FF Ex – they may cause false-positives)
// Headers taken from https://www.garykessler.net/library/file_sigs.html
[0xFF, 0xE0], [0xFF, 0xE1], [0xFF, 0xE2], [0xFF, 0xE3], [0xFF, 0xE4],
[0xFF, 0xE5], [0xFF, 0xE6], [0xFF, 0xE7], [0xFF, 0xE8], [0xFF, 0xE9],
[0xFF, 0xEA], [0xFF, 0xEB], [0xFF, 0xEC], [0xFF, 0xED], [0xFF, 0xEE], [0xFF, 0xEF],
[0xFF, 0xF0], [0xFF, 0xF1], [0xFF, 0xF2], [0xFF, 0xF3], [0xFF, 0xF4],
[0xFF, 0xF5], [0xFF, 0xF6], [0xFF, 0xF7], [0xFF, 0xF8], [0xFF, 0xF9],
[0xFF, 0xFA], [0xFF, 0xFB], [0xFF, 0xFC], [0xFF, 0xFD], [0xFF, 0xFE], [0xFF, 0xFF]
],

@@ -17,0 +25,0 @@ 'wav': [

5

package.json
{
"name": "filevalidator",
"version": "1.0.0",
"version": "1.0.1",
"description": "File signature validation in JavaScript",
"main": "filevalidator.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Phil Freo <phil@philfreo.com> (http://philfreo.com/)",
"license": "MIT"
}

@@ -21,3 +21,3 @@ # filevalidator.js

var file = e.currentTarget.files[0];
FileDetector.verifyFileType(file, ['mp3', 'wav'], function(valid) {
filevalidator.verifyFileType(file, ['mp3', 'wav'], function(valid) {
alert('Valid mp3 or wave file: ' + !!valid);

@@ -24,0 +24,0 @@ });

Sorry, the diff of this file is not supported yet

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