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

http-equiv-refresh

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-equiv-refresh - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

13

index.js
"use strict";
var pattern = /^\s*(\d+)(?:\s*;(?:\s*url\s*=)?\s*(.+)?)?$/i;
const pattern = /^\s*(\d+)(?:\s*;(?:\s*url\s*=)?\s*(.+)?)?$/i;

@@ -8,4 +8,3 @@

{
var firstChar,lastChar,url;
var result = { timeout:null, url:null };
const result = { timeout:null, url:null };
content = pattern.exec(content);

@@ -17,3 +16,3 @@

{
result.timeout = ~~content[1]; // faster than `parseInt()`
result.timeout = parseInt( content[1] );
}

@@ -23,6 +22,6 @@

{
url = content[2].trim();
let url = content[2].trim();
firstChar = url[0];
lastChar = url[ url.length-1 ];
const firstChar = url[0];
const lastChar = url[ url.length-1 ];

@@ -29,0 +28,0 @@ // Remove a single level of encapsulating quotes

{
"name": "http-equiv-refresh",
"description": "Parse an HTML meta refresh value.",
"version": "1.0.0",
"version": "2.0.0",
"license": "MIT",
"homepage": "https://github.com/stevenvachon/http-equiv-refresh",
"author": {
"name": "Steven Vachon",
"email": "contact@svachon.com",
"url": "http://www.svachon.com/"
},
"repository": {
"type": "git",
"url": "git://github.com/stevenvachon/http-equiv-refresh.git"
},
"bugs": {
"url": "https://github.com/stevenvachon/http-equiv-refresh/issues"
},
"author": "Steven Vachon <contact@svachon.com> (https://www.svachon.com/)",
"repository": "stevenvachon/http-equiv-refresh",
"devDependencies": {
"chai": "^3.5.0",
"mocha": "^2.4.5"
"mocha": "^3.3.0"
},
"engines": {
"node": ">= 0.10"
"node": ">= 6"
},
"scripts": {
"test": "mocha test.js --reporter spec --check-leaks --bail"
"test": "mocha test.js --reporter=spec --check-leaks --bail"
},
"files": [
"index.js",
"license"
],
"files": ["index.js"],
"keywords": [

@@ -34,0 +20,0 @@ "html",

# http-equiv-refresh [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]
> Parse an HTML meta refresh value.
> Parse an HTML [meta refresh value](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-http-equiv).

@@ -8,3 +8,3 @@

[Node.js](http://nodejs.org/) `>= 0.10` is required. To install, type this at the command line:
[Node.js](http://nodejs.org/) `>= 6` is required. To install, type this at the command line:
```shell

@@ -17,9 +17,9 @@ npm install http-equiv-refresh

```js
var parseMetaRefresh = require("http-equiv-refresh");
const parseMetaRefresh = require('http-equiv-refresh');
parseMetaRefresh("5; url=http://domain.com/");
//=> { timeout:5, url:"http://domain.com/" }
parseMetaRefresh('5; url=http://domain.com/');
//-> { timeout:5, url:'http://domain.com/' }
parseMetaRefresh("5");
//=> { timeout:5, url:null }
parseMetaRefresh('5');
//-> { timeout:5, url:null }
```

@@ -26,0 +26,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