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

style-data

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

style-data - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

.eslintrc.json

19

index.js
'use strict';
var mediaQueryText = require('mediaquery-text'),
cheerio = require('cheerio');
cheerio = require('cheerio'),
extend = require('extend'),
pick = require('object-pick');
module.exports = function (html, options, callback) {
var results = {},
$ = cheerio.load(html, {
$ = cheerio.load(html, extend({
decodeEntities: false
}),
}, pick(options, [
'xmlMode',
'decodeEntities',
'lowerCaseTags',
'lowerCaseAttributeNames',
'recognizeCDATA',
'recognizeSelfClosing'
]))),
styleDataList,

@@ -17,2 +26,4 @@ styleData;

$('style').each(function (index, element) {
var mediaQueries;
styleDataList = element.childNodes;

@@ -29,3 +40,3 @@ if (styleDataList.length !== 1) {

if (options.preserveMediaQueries) {
var mediaQueries = mediaQueryText(element.childNodes[0].nodeValue);
mediaQueries = mediaQueryText(element.childNodes[0].nodeValue);
element.childNodes[0].nodeValue = mediaQueries;

@@ -32,0 +43,0 @@ } else {

{
"name": "style-data",
"version": "1.0.3",
"version": "1.1.0",
"description": "Get the content of style tags.",
"main": "index.js",
"scripts": {
"test": "gulp test"
"test": "mocha",
"coverage": "nyc npm test && nyc report",
"coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls"
},

@@ -27,12 +29,16 @@ "repository": {

"cheerio": "^0.19.0",
"mediaquery-text": "^1.0.0"
"extend": "^3.0.0",
"mediaquery-text": "^1.0.0",
"object-pick": "^0.1.2"
},
"devDependencies": {
"coveralls": "^2.11.6",
"gulp": "^3.8.10",
"gulp-jshint": "^1.9.0",
"gulp-eslint": "^1.1.1",
"gulp-mocha": "^2.0.0",
"gulp-util": "^3.0.2",
"mocha": "^2.1.0",
"nyc": "^5.5.0",
"should": "^5.2.0"
}
}

@@ -1,3 +0,5 @@

# style-data
# style-data [![Build Status](https://travis-ci.org/jonkemp/style-data.svg?branch=master)](https://travis-ci.org/jonkemp/style-data) [![Coverage Status](https://coveralls.io/repos/jonkemp/style-data/badge.svg?branch=master&service=github)](https://coveralls.io/github/jonkemp/style-data?branch=master)
[![NPM](https://nodei.co/npm/style-data.png?downloads=true)](https://nodei.co/npm/style-data/)
> Get the content of style tags.

@@ -49,3 +51,6 @@

### cheerio options
Options to passed to [cheerio](https://github.com/cheeriojs/cheerio).
## Credit

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