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

postcss-safe-parser

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-safe-parser - npm Package Compare versions

Comparing version 3.0.1 to 4.0.0

gulpfile.js

5

CHANGELOG.md
# Change Log
This project adheres to [Semantic Versioning](http://semver.org/).
## 4.0
* Remove Node.js 9 and Node.js 4 support.
* Remove IE and “dead” browsers from Babel.
* Use PostCSS 7.0.
## 3.0.1

@@ -5,0 +10,0 @@ * Fix parsing IE filter with missed semicolon.

28

lib/safe-parse.js
'use strict';
exports.__esModule = true;
exports.default = safeParse;
var Input = require('postcss/lib/input');
var _input = require('postcss/lib/input');
var SafeParser = require('./safe-parser');
var _input2 = _interopRequireDefault(_input);
module.exports = function safeParse(css, opts) {
var input = new Input(css, opts);
var _safeParser = require('./safe-parser');
var parser = new SafeParser(input);
parser.parse();
var _safeParser2 = _interopRequireDefault(_safeParser);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function safeParse(css, opts) {
var input = new _input2.default(css, opts);
var parser = new _safeParser2.default(input);
parser.parse();
return parser.root;
}
module.exports = exports['default'];
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNhZmUtcGFyc2UuZXM2Il0sIm5hbWVzIjpbInNhZmVQYXJzZSIsImNzcyIsIm9wdHMiLCJpbnB1dCIsInBhcnNlciIsInBhcnNlIiwicm9vdCJdLCJtYXBwaW5ncyI6Ijs7O2tCQUl3QkEsUzs7QUFKeEI7Ozs7QUFFQTs7Ozs7O0FBRWUsU0FBU0EsU0FBVCxDQUFtQkMsR0FBbkIsRUFBd0JDLElBQXhCLEVBQThCO0FBQ3pDLFFBQUlDLFFBQVEsb0JBQVVGLEdBQVYsRUFBZUMsSUFBZixDQUFaOztBQUVBLFFBQUlFLFNBQ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Q0FBZU0sS0FBZixDQUFmO0FBQ0FDLFNBQU9DLEtBQVA7O0FBRUEsU0FBT0QsT0FBT0UsSUFBZDtBQUNELENBUEQiLCJmaWxlIjoic2FmZS1wYXJzZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImNvbnN0IElucHV0ID0gcmVxdWlyZSgncG9zdGNzcy9saWIvaW5wdXQnKVxuXG5jb25zdCBTYWZlUGFyc2VyID0gcmVxdWlyZSgnLi9zYWZlLXBhcnNlcicpXG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gc2FmZVBhcnNlIChjc3MsIG9wdHMpIHtcbiAgY29uc3QgaW5wdXQgPSBuZXcgSW5wdXQoY3NzLCBvcHRzKVxuXG4gIGNvbnN0IHBhcnNlciA9IG5ldyBTYWZlUGFyc2VyKGlucHV0KVxuICBwYXJzZXIucGFyc2UoKVxuXG4gIHJldHVybiBwYXJzZXIucm9vdFxufVxuIl19
'use strict';
exports.__esModule = true;
var _tokenize = require('postcss/lib/tokenize');
var _tokenize2 = _interopRequireDefault(_tokenize);
var _comment = require('postcss/lib/comment');
var _comment2 = _interopRequireDefault(_comment);
var _parser = require('postcss/lib/parser');
var _parser2 = _interopRequireDefault(_parser);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -25,96 +9,99 @@

var tokenizer = require('postcss/lib/tokenize');
var Comment = require('postcss/lib/comment');
var Parser = require('postcss/lib/parser');
var SafeParser = function (_Parser) {
_inherits(SafeParser, _Parser);
_inherits(SafeParser, _Parser);
function SafeParser() {
_classCallCheck(this, SafeParser);
function SafeParser() {
_classCallCheck(this, SafeParser);
return _possibleConstructorReturn(this, _Parser.apply(this, arguments));
}
return _possibleConstructorReturn(this, _Parser.apply(this, arguments));
}
SafeParser.prototype.createTokenizer = function createTokenizer() {
this.tokenizer = (0, _tokenize2.default)(this.input, { ignoreErrors: true });
};
SafeParser.prototype.createTokenizer = function createTokenizer() {
this.tokenizer = tokenizer(this.input, { ignoreErrors: true });
};
SafeParser.prototype.comment = function comment(token) {
var node = new _comment2.default();
this.init(node, token[2], token[3]);
node.source.end = { line: token[4], column: token[5] };
SafeParser.prototype.comment = function comment(token) {
var node = new Comment();
this.init(node, token[2], token[3]);
node.source.end = { line: token[4], column: token[5] };
var text = token[1].slice(2);
if (text.slice(-2) === '*/') text = text.slice(0, -2);
var text = token[1].slice(2);
if (text.slice(-2) === '*/') text = text.slice(0, -2);
if (/^\s*$/.test(text)) {
node.text = '';
node.raws.left = text;
node.raws.right = '';
} else {
var match = text.match(/^(\s*)([^]*[^\s])(\s*)$/);
node.text = match[2];
node.raws.left = match[1];
node.raws.right = match[3];
}
};
if (/^\s*$/.test(text)) {
node.text = '';
node.raws.left = text;
node.raws.right = '';
} else {
var match = text.match(/^(\s*)([^]*[^\s])(\s*)$/);
node.text = match[2];
node.raws.left = match[1];
node.raws.right = match[3];
}
};
SafeParser.prototype.decl = function decl(tokens) {
if (tokens.length > 1) {
_Parser.prototype.decl.call(this, tokens);
}
};
SafeParser.prototype.decl = function decl(tokens) {
if (tokens.length > 1) {
_Parser.prototype.decl.call(this, tokens);
}
};
SafeParser.prototype.unclosedBracket = function unclosedBracket() {};
SafeParser.prototype.unclosedBracket = function unclosedBracket() {};
SafeParser.prototype.unknownWord = function unknownWord(tokens) {
this.spaces += tokens.map(function (i) {
return i[1];
}).join('');
};
SafeParser.prototype.unknownWord = function unknownWord(tokens) {
this.spaces += tokens.map(function (i) {
return i[1];
}).join('');
};
SafeParser.prototype.unexpectedClose = function unexpectedClose() {
this.current.raws.after += '}';
};
SafeParser.prototype.unexpectedClose = function unexpectedClose() {
this.current.raws.after += '}';
};
SafeParser.prototype.doubleColon = function doubleColon() {};
SafeParser.prototype.doubleColon = function doubleColon() {};
SafeParser.prototype.unnamedAtrule = function unnamedAtrule(node) {
node.name = '';
};
SafeParser.prototype.unnamedAtrule = function unnamedAtrule(node) {
node.name = '';
};
SafeParser.prototype.precheckMissedSemicolon = function precheckMissedSemicolon(tokens) {
var colon = this.colon(tokens);
if (colon === false) return;
SafeParser.prototype.precheckMissedSemicolon = function precheckMissedSemicolon(tokens) {
var colon = this.colon(tokens);
if (colon === false) return;
var split = void 0;
for (split = colon - 1; split >= 0; split--) {
if (tokens[split][0] === 'word') break;
}
for (split -= 1; split >= 0; split--) {
if (tokens[split][0] !== 'space') {
split += 1;
break;
}
}
var other = tokens.splice(split, tokens.length - split);
this.decl(other);
};
var split = void 0;
for (split = colon - 1; split >= 0; split--) {
if (tokens[split][0] === 'word') break;
}
for (split -= 1; split >= 0; split--) {
if (tokens[split][0] !== 'space') {
split += 1;
break;
}
}
var other = tokens.splice(split, tokens.length - split);
this.decl(other);
};
SafeParser.prototype.checkMissedSemicolon = function checkMissedSemicolon() {};
SafeParser.prototype.checkMissedSemicolon = function checkMissedSemicolon() {};
SafeParser.prototype.endFile = function endFile() {
if (this.current.nodes && this.current.nodes.length) {
this.current.raws.semicolon = this.semicolon;
}
this.current.raws.after = (this.current.raws.after || '') + this.spaces;
SafeParser.prototype.endFile = function endFile() {
if (this.current.nodes && this.current.nodes.length) {
this.current.raws.semicolon = this.semicolon;
}
this.current.raws.after = (this.current.raws.after || '') + this.spaces;
while (this.current.parent) {
this.current = this.current.parent;
this.current.raws.after = '';
}
};
while (this.current.parent) {
this.current = this.current.parent;
this.current.raws.after = '';
}
};
return SafeParser;
}(_parser2.default);
return SafeParser;
}(Parser);
exports.default = SafeParser;
module.exports = exports['default'];
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNhZmUtcGFyc2VyLmVzNiJdLCJuYW1lcyI6WyJTYWZlUGFyc2VyIiwiY3JlYXRlVG9rZW5pemVyIiwidG9rZW5pemVyIiwiaW5wdXQiLCJpZ25vcmVFcnJvcnMiLCJjb21tZW50IiwidG9rZW4iLCJub2RlIiwiaW5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fTtcblxuICAgICAgICBsZXQgdGV4dCA9IHRva2VuWzFdLnNsaWNlKDIpO1xuICAgICAgICBpZiAoIHRleHQuc2xpY2UoLTIpID09PSAnKi8nICkgdGV4dCA9IHRleHQuc2xpY2UoMCwgLTIpO1xuXG4gICAgICAgIGlmICggL15cXHMqJC8udGVzdCh0ZXh0KSApIHtcbiAgICAgICAgICAgIG5vZGUudGV4dCAgICAgICA9ICcnO1xuICAgICAgICAgICAgbm9kZS5yYXdzLmxlZnQgID0gdGV4dDtcbiAgICAgICAgICAgIG5vZGUucmF3cy5yaWdodCA9ICcnO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IG1hdGNoID0gdGV4dC5tYXRjaCgvXihcXHMqKShbXl0qW15cXHNdKShcXHMqKSQvKTtcbiAgICAgICAgICAgIG5vZGUudGV4dCAgICAgICA9IG1hdGNoWzJdO1xuICAgICAgICAgICAgbm9kZS5yYXdzLmxlZnQgID0gbWF0Y2hbMV07XG4gICAgICAgICAgICBub2RlLnJhd3MucmlnaHQgPSBtYXRjaFszXTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGRlY2wodG9rZW5zKSB7XG4gICAgICAgIGlmICggdG9rZW5zLmxlbmd0aCA+IDEgKSB7XG4gICAgICAgICAgICBzdXBlci5kZWNsKHRva2Vucyk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB1bmNsb3NlZEJyYWNrZXQoKSB7IH1cblxuICAgIHVua25vd25Xb3JkKHRva2Vucykge1xuICAgICAgICB0aGlzLnNwYWNlcyArPSB0b2tlbnMubWFwKGkgPT4gaVsxXSkuam9pbignJyk7XG4gICAgfVxuXG4gICAgdW5leHBlY3RlZENsb3NlKCkge1xuICAgICAgICB0aGlzLmN1cnJlbnQucmF3cy5hZnRlciArPSAnfSc7XG4gICAgfVxuXG4gICAgZG91YmxlQ29sb24oKSB7IH1cblxuICAgIHVubmFtZWRBdHJ1bGUobm9kZSkge1xuICAgICAgICBub2RlLm5hbWUgPSAnJztcbiAgICB9XG5cbiAgICBwcmVjaGVja01pc3NlZFNlbWljb2xvbih0b2tlbnMpIHtcbiAgICAgICAgbGV0IGNvbG9uID0gdGhpcy5jb2xvbih0b2tlbnMpO1xuICAgICAgICBpZiAoIGNvbG9uID09PSBmYWxzZSApIHJldHVybjtcblxuICAgICAgICBsZXQgc3BsaXQ7XG4gICAgICAgIGZvciAoIHNwbGl0ID0gY29sb24gLSAxOyBzcGxpdCA+PSAwOyBzcGxpdC0tICkge1xuICAgICAgICAgICAgaWYgKCB0b2tlbnNbc3BsaXRdWzBdID09PSAnd29yZCcgKSBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBmb3IgKCBzcGxpdCAtPSAxOyBzcGxpdCA+PSAwOyBzcGxpdC0tICkge1xuICAgICAgICAgICAgaWYgKCB0b2tlbnNbc3BsaXRdWzBdICE9PSAnc3BhY2UnICkge1xuICAgICAgICAgICAgICAgIHNwbGl0ICs9IDE7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG90aGVyID0gdG9rZW5zLnNwbGljZShzcGxpdCwgdG9rZW5zLmxlbmd0aCAtIHNwbGl0KTtcbiAgICAgICAgdGhpcy5kZWNsKG90aGVyKTtcbiAgICB9XG5cbiAgICBjaGVja01pc3NlZFNlbWljb2xvbigpIHsgfVxuXG4gICAgZW5kRmlsZSgpIHtcbiAgICAgICAgaWYgKCB0aGlzLmN1cnJlbnQubm9kZXMgJiYgdGhpcy5jdXJyZW50Lm5vZGVzLmxlbmd0aCApIHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudC5yYXdzLnNlbWljb2xvbiA9IHRoaXMuc2VtaWNvbG9uO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuY3VycmVudC5yYXdzLmFmdGVyID0gKHRoaXMuY3VycmVudC5yYXdzLmFmdGVyIHx8ICcnKSArIHRoaXMuc3BhY2VzO1xuXG4gICAgICAgIHdoaWxlICggdGhpcy5jdXJyZW50LnBhcmVudCApIHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudCA9IHRoaXMuY3VycmVudC5wYXJlbnQ7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnQucmF3cy5hZnRlciA9ICcnO1xuICAgICAgICB9XG4gICAgfVxuXG59XG4iXX0=
module.exports = SafeParser;
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNhZmUtcGFyc2VyLmVzNiJdLCJuYW1lcyI6WyJ0b2tlbml6ZXIiLCJyZXF1aXJlIiwiQ29tbWVudCIsIlBhcnNlciIsIlNhZmVQYXJzZXIiLCJjcmVhdGVUb2tlbml6ZXIiLCJpbnB1dCIsImlnbm9yZUVycm9ycyIsImNvbW1lbnQiLCJ0b2tlbiIsIm5vZGUiLCJpbml0Iiwic291cmNlIiwiZW5kIiwibGluZSIsImNvbHVtbiIsInRleHQiLCJzbGljZSIsInRlc3QiLCJyYXdzIiwibGVmdCIsInJpZ2h0IiwibWF0Y2giLCJkZWNsIiwidG9rZW5zIiwibGVuZ3RoIiwidW5jbG9zZWRCcmFja2V0IiwidW5rbm93bldvcmQiLCJzcGFjZXMiLCJtYXAiLCJpIiwiam9pbiIsInVuZXhwZWN0ZWRDbG9zZSIsImN1cnJlbnQiLCJhZnRlciIsImRvdWJsZUNvbG9uIiwidW5uYW1lZEF0cnVsZSIsIm5hbWUiLCJwcmVjaGVja01pc3NlZFNlbWljb2xvbiIsImNvbG9uIiwic3BsaXQiLCJvdGhlciIsInNwbGljZSIsImNoZWNrTWlzc2VkU2VtaWNvbG9uIiwiZW5kRmlsZSIsIm5vZGVzIiwic2VtaWNvbG9uIiwicGFyZW50IiwibW9kdWxlIiwiZXhwb3J0cyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7QUFBQSxJQUFNQSxZQUFZQyxRQUFRLHNCQUFSLENBQWxCO0FBQ0EsSUFBTUMsVUFBVUQsUUFB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gfVxuXG4gIGNoZWNrTWlzc2VkU2VtaWNvbG9uICgpIHsgfVxuXG4gIGVuZEZpbGUgKCkge1xuICAgIGlmICh0aGlzLmN1cnJlbnQubm9kZXMgJiYgdGhpcy5jdXJyZW50Lm5vZGVzLmxlbmd0aCkge1xuICAgICAgdGhpcy5jdXJyZW50LnJhd3Muc2VtaWNvbG9uID0gdGhpcy5zZW1pY29sb25cbiAgICB9XG4gICAgdGhpcy5jdXJyZW50LnJhd3MuYWZ0ZXIgPSAodGhpcy5jdXJyZW50LnJhd3MuYWZ0ZXIgfHwgJycpICsgdGhpcy5zcGFjZXNcblxuICAgIHdoaWxlICh0aGlzLmN1cnJlbnQucGFyZW50KSB7XG4gICAgICB0aGlzLmN1cnJlbnQgPSB0aGlzLmN1cnJlbnQucGFyZW50XG4gICAgICB0aGlzLmN1cnJlbnQucmF3cy5hZnRlciA9ICcnXG4gICAgfVxuICB9XG59XG5cbm1vZHVsZS5leHBvcnRzID0gU2FmZVBhcnNlclxuIl19
{
"name": "postcss-safe-parser",
"version": "3.0.1",
"version": "4.0.0",
"description": "Fault-tolerant CSS parser for PostCSS",

@@ -15,25 +15,37 @@ "keywords": [

"repository": "postcss/postcss-safe-parser",
"engines": {
"node": ">=6.0.0"
},
"dependencies": {
"postcss": "^6.0.6"
"postcss": "^7.0.0"
},
"devDependencies": {
"babel-core": "^6.25.0",
"babel-eslint": "^7.2.3",
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.6",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-precompile-charcodes": "^1.1.0",
"babel-preset-env": "^1.6.0",
"babel-preset-env": "^1.7.0",
"del": "^3.0.0",
"eslint": "^4.2.0",
"eslint-config-postcss": "^2.0.2",
"eslint": "^5.1.0",
"eslint-config-logux": "^23.0.2",
"eslint-config-postcss": "^3.0.2",
"eslint-config-standard": "^11.0.0",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-jest": "^21.17.0",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.8.0",
"eslint-plugin-security": "^1.4.0",
"eslint-plugin-standard": "^3.1.0",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
"gulp-changed": "^3.1.0",
"gulp-eslint": "^4.0.0",
"gulp-jest": "^2.0.0",
"gulp-sourcemaps": "^2.6.0",
"jest": "^20.0.4",
"lint-staged": "^4.0.1",
"postcss-parser-tests": "^6.0.2",
"gulp-babel": "^7.0.1",
"gulp-changed": "^3.2.0",
"gulp-eslint": "^5.0.0",
"gulp-jest": "^4.0.2",
"gulp-sourcemaps": "^2.6.4",
"jest": "^23.4.1",
"jest-cli": "^23.4.1",
"lint-staged": "^7.2.0",
"postcss-parser-tests": "^6.3.0",
"pre-commit": "^1.1.3",
"run-sequence": "^2.0.0"
"run-sequence": "^2.2.1"
},

@@ -47,16 +59,20 @@ "scripts": {

"extends": "eslint-config-postcss",
"rules": {
"key-spacing": [
"error",
{
"align": "value"
"overrides": [
{
"files": [
"gulpfile.js"
],
"rules": {
"node/no-unpublished-require": "off",
"global-require": "off"
}
],
"complexity": "off",
"no-var": "off"
},
"env": {
"jest": true
}
}
]
},
"jest": {
"testEnvironment": "node",
"modulePathIgnorePatterns": [
"<rootDir>/build"
]
},
"babel": {

@@ -68,4 +84,9 @@ "presets": [

"targets": {
"browsers": "last 1 version",
"node": 4
"browsers": [
"last 2 version",
"not dead",
"not Explorer 11",
"not ExplorerMobile 11"
],
"node": 6
},

@@ -72,0 +93,0 @@ "loose": true

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