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

valid-data-url

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

valid-data-url - npm Package Compare versions

Comparing version 0.1.6 to 1.0.0

3

bower.json
{
"name": "valid-data-url",
"version": "0.1.5",
"version": "1.0.0",
"description": "Detect if a string is a data URL",

@@ -29,5 +29,4 @@ "main": "index.js",

"node_modules",
"Gruntfile.js",
"test.js"
]
}

@@ -0,1 +1,8 @@

<a name="1.0.0"></a>
### 1.0.0 (2018-09-12)
* drops support for Node less than 4.
* bump deps
<a name="0.1.6"></a>

@@ -2,0 +9,0 @@ ### 0.1.6 (2018-03-09)

{
"name": "valid-data-url",
"version": "0.1.6",
"version": "1.0.0",
"description": "Detect if a string is a data URL",
"main": "index.js",
"scripts": {
"lint": "grunt",
"test": "mocha",
"coverage": "istanbul cover _mocha",
"coveralls": "npm run coverage && coveralls < coverage/lcov.info"
"engines": {
"node": ">=4"
},
"pre-commit": [
"lint",
"test"
],
"license": "MIT",
"author": {
"name": "Alexey Kucherenko",
"url": "https://github.com/killmenot"
},
"homepage": "https://github.com/killmenot/valid-data-url",
"repository": {

@@ -20,2 +19,5 @@ "type": "git",

},
"bugs": {
"url": "https://github.com/killmenot/valid-data-url/issues"
},
"keywords": [

@@ -31,21 +33,28 @@ "valid",

],
"author": {
"name": "Alexey Kucherenko",
"url": "https://github.com/killmenot"
"scripts": {
"lint": "jshint index.js test.js",
"test": "mocha",
"coverage": "nyc --reporter=html --reporter=text mocha",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/killmenot/valid-data-url/issues"
"pre-commit": [
"lint",
"test"
],
"nyc": {
"all": true,
"include": [
"index.js"
],
"exclude": [
"test.js"
]
},
"homepage": "https://github.com/killmenot/valid-data-url",
"devDependencies": {
"chai": "^4.1.2",
"coveralls": "^3.0.0",
"grunt": "^1.0.1",
"grunt-contrib-jshint": "^1.1.0",
"istanbul": "^0.4.5",
"load-grunt-tasks": "^3.5.2",
"mocha": "^3.5.3",
"mocha": "^5.2.0",
"nyc": "^13.0.1",
"pre-commit": "^1.2.2"
}
}
# Detect if a string is a data URL
[![Build Status](https://travis-ci.org/killmenot/valid-data-url.svg?branch=master)](https://travis-ci.org/killmenot/valid-data-url) [![Coverage Status](https://coveralls.io/repos/github/killmenot/valid-data-url/badge.svg?branch=master)](https://coveralls.io/github/killmenot/valid-data-url?branch=master) [![Dependency Status](https://gemnasium.com/badges/github.com/killmenot/valid-data-url.svg)](https://gemnasium.com/github.com/killmenot/valid-data-url) [![npm version](https://badge.fury.io/js/valid-data-url.svg)](https://badge.fury.io/js/valid-data-url) [![npm](https://img.shields.io/npm/dm/valid-data-url.svg)](https://www.npmjs.com/package/valid-data-url)
[![Build Status](https://travis-ci.org/killmenot/valid-data-url.svg?branch=master)](https://travis-ci.org/killmenot/valid-data-url) [![Coverage Status](https://coveralls.io/repos/github/killmenot/valid-data-url/badge.svg?branch=master)](https://coveralls.io/github/killmenot/valid-data-url?branch=master) [![Dependency Status](https://david-dm.org/killmenot/valid-data-url.svg)](https://david-dm.org/killmenot/valid-data-url.svg) [![npm version](https://badge.fury.io/js/valid-data-url.svg)](https://badge.fury.io/js/valid-data-url) [![npm](https://img.shields.io/npm/dm/valid-data-url.svg)](https://www.npmjs.com/package/valid-data-url)

@@ -60,20 +60,18 @@ Based on [Brian Grinstead](https://github.com/bgrins)'s solution https://gist.github.com/bgrins/6194623. Special thanks to [Jamie Davis](https://github.com/davisjam) for helping to fix [ReDoS](https://www.regular-expressions.info/redos.html) exploit.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

@@ -1,9 +0,6 @@

/* globals describe, it */
/* jshint expr:true */
'use strict';
var validDataUrl = require('./');
var expect = require('chai').expect;
var valid = [
const validDataUrl = require('./');
const expect = require('chai').expect;
const valid = [
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC',

@@ -27,3 +24,3 @@ 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIBAMAAAA2IaO4AAAAFVBMVEXk5OTn5+ft7e319fX29vb5+fn///++GUmVAAAALUlEQVQIHWNICnYLZnALTgpmMGYIFWYIZTA2ZFAzTTFlSDFVMwVyQhmAwsYMAKDaBy0axX/iAAAAAElFTkSuQmCC',

var invalid = [
const invalid = [
'dataxbase64',

@@ -41,22 +38,22 @@ 'data:HelloWorld',

describe('valid-data-url', function () {
it('should be a function', function () {
expect(validDataUrl).to.be.a('function');
describe('valid-data-url', () => {
it('should be a function', () => {
expect(validDataUrl).be.a('function');
});
it('valid', function () {
valid.forEach(function (value) {
expect(validDataUrl(value), value).to.be.true;
it('valid', () => {
valid.forEach((value) => {
expect(validDataUrl(value), value).equal(true);
});
});
it('invalid', function () {
invalid.forEach(function (value) {
expect(validDataUrl(value), value).to.be.false;
it('invalid', () => {
invalid.forEach((value) => {
expect(validDataUrl(value), value).equal(false);
});
});
it('undefined', function () {
expect(validDataUrl()).to.be.false;
it('undefined', () => {
expect(validDataUrl()).equal(false);
});
});

Sorry, the diff of this file is not supported yet

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