Skip to content
This repository was archived by the owner on Jan 31, 2022. It is now read-only.

Update dependencies and add format/stringify options #3

Merged
merged 2 commits into from
Jun 17, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
"homepage": "https://github.com/jkenlooper/stripmq",
"dependencies": {
"nopt": "^2.2.1",
"css-parse": "^1.7.0",
"css-mediaquery": "^0.1.2",
"css-stringify": "^1.4.1"
"css": "^1.6.0",
"css-mediaquery": "^0.1.2"
}
}
13 changes: 8 additions & 5 deletions stripmq.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

var parse = require('css-parse'),
stringify = require('css-stringify'),
var css = require('css'),
mediaQuery = require('css-mediaquery');


Expand All @@ -23,9 +22,13 @@ function stripMediaQueries (ast, options) {
/**
* strip media queries
* @param {string} input
* @param {object} options
* @param {object} formatOptions
* @returns {string} output
*/
function StripMQ(input, options) {
function StripMQ(input, options, formatOptions) {
options || (options = {});
formatOptions || (formatOptions = {});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sure we have an object for each of these…


options = {
type: options.type || 'screen',
Expand All @@ -39,9 +42,9 @@ function StripMQ(input, options) {
color: options.color || 3
};

var tree = parse(input);
var tree = css.parse(input);
tree = stripMediaQueries(tree, options);
return stringify(tree);
return css.stringify(tree, formatOptions);
}

module.exports = StripMQ;