Socket
Socket
Sign inDemoInstall

link-types

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.1.0

35

index.js

@@ -14,3 +14,3 @@ "use strict";

{
return attrValue.trim().toLowerCase().split(" ").filter(isNotEmpty);
return split(attrValue).filter(isNotEmpty);
}

@@ -20,2 +20,35 @@

function map(attrValue)
{
var i,numValues,value,result;
attrValue = split(attrValue);
numValues = attrValue.length;
result = {};
for (i=0; i<numValues; i++)
{
value = attrValue[i];
if (value !== "")
{
result[value] = true;
}
}
return result;
}
function split(attrValue)
{
return attrValue.trim().toLowerCase().split(" ");
}
linkTypes.map = map;
module.exports = linkTypes;

2

package.json
{
"name": "link-types",
"description": "Parse an HTML attribute value containing link types.",
"version": "1.0.0",
"version": "1.1.0",
"license": "MIT",

@@ -6,0 +6,0 @@ "homepage": "https://github.com/stevenvachon/link-types",

@@ -20,5 +20,11 @@ # link-types [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]

var linkTypes = require("link-types");
linkTypes("nofollow");
//=> ["nofollow"]
linkTypes(" tag NOFOLLOW ");
//=> ["tag", "nofollow"]
linkTypes.map(" tag NOFOLLOW ");
//=> { tag:true, nofollow:true }
```

@@ -25,0 +31,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc