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

sugarss

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sugarss - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

3

CHANGELOG.md
# Change Log
## 0.1.2
* Fix rule/declaration selection in nested rules.
## 0.1.1

@@ -4,0 +7,0 @@ * Fix comment between declaration case.

2

package.json
{
"name": "sugarss",
"version": "0.1.1",
"version": "0.1.2",
"description": "Indent-based CSS syntax for PostCSS",

@@ -5,0 +5,0 @@ "keywords": [

@@ -62,6 +62,4 @@ 'use strict';

var sameIndent = next.indent.length === part.indent.length;
if (sameIndent && next.colon) {
if (sameIndent) {
this.decl(part);
} else if (sameIndent && !next.colon) {
this.rule(part);
} else if (!sameIndent && next.colon) {

@@ -346,2 +344,2 @@ this.rule(part);

module.exports = exports['default'];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBhcnNlci5lczYiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBOzs7O0FBQ0E7Ozs7QUFDQTs7OztBQUNBOzs7O0FBQ0E7Ozs7Ozs7O0lBRXFCO0FBRWpCLGFBRmlCLE1BRWpCLENBQVksS0FBWixFQUFtQjs4QkFGRixRQUVFOztBQUNmLGFBQUssS0FBTCxHQUFhLEtBQWIsQ0FEZTs7QUFHZixhQUFLLEdBQUwsR0FBZSxDQUFmLENBSGU7QUFJZixhQUFLLElBQUwsR0FBZSxvQkFBZixDQUplO0FBS2YsYUFBSyxPQUFMLEdBQWUsS0FBSyxJQUFMLENBTEE7QUFNZixhQUFLLE1BQUwsR0FBZSxFQUFmLENBTmU7O0FBUWYsYUFBSyxVQUFMLEdBQWtCLFNBQWxCLENBUmU7QUFTZixhQUFLLElBQUwsR0FBa0IsU0FBbEIsQ0FUZTs7QUFXZixhQUFLLElB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cy5yb290ICAgID0gbmV3IFJvb3QoKTtcbiAgICAgICAgdGhpcy5jdXJyZW50ID0gdGhpcy5yb290O1xuICAgICAgICB0aGlzLnNwYWNlcyAgPSAnJztcblxuICAgICAgICB0aGlzLnByZXZJbmRlbnQgPSB1bmRlZmluZWQ7XG4gICAgICAgIHRoaXMuc3RlcCAgICAgICA9IHVuZGVmaW5lZDtcblxuICAgICAgICB0aGlzLnJvb3Quc291cmNlID0geyBpbnB1dCwgc3RhcnQ6IHsgbGluZTogMSwgY29sdW1uOiAxIH0gfTtcbiAgICB9XG5cbiAgICBsb29wKCkge1xuICAgICAgICBsZXQgcGFydDtcbiAgICAgICAgd2hpbGUgKCB0aGlzLnBvcyA8IHRoaXMucGFydHMubGVuZ3RoICkge1xuICAgICAgICAgICAgcGFydCA9IHRoaXMucGFydHNbdGhpcy5wb3NdO1xuXG4gICAgICAgICAgICBpZiAoIHBhcnQuY29tbWVudCApIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNvbW1lbnQocGFydCk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBwYXJ0LmF0cnVsZSApIHtcbiAgICAgICAgICAgICAgICB0aGlzLmF0cnVsZShwYXJ0KTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHBhcnQuY29sb24gKSB7XG4gICAgICAgICAgICAgICAgbGV0IG5leHQgPSB0aGlzLm5leHROb25Db21tZW50KHRoaXMucG9zKTtcblxuICAgICAgICAgICAgICAgIGlmICggbmV4dC5lbmQgfHwgbmV4dC5hdHJ1bGUgKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZGVjbChwYXJ0KTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBsZXQgc2FtZUluZGVudCA9IG5leHQuaW5kZW50Lmxlbmd0aCA9PT0gcGFydC5pbmRlbnQubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIHNhbWVJbmRlbnQgJiYgbmV4dC5jb2xvbiApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZGVjbChwYXJ0KTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICggc2FtZUluZGVudCAmJiAhbmV4dC5jb2xvbiApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucnVsZShwYXJ0KTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICggIXNhbWVJbmRlbnQgJiYgbmV4dC5jb2xvbiApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucnVsZShwYXJ0KTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICggIXNhbWVJbmRlbnQgJiYgIW5leHQuY29sb24gKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRlY2wocGFydCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBwYXJ0LmVuZCApIHtcbiAgICAgICAgICAgICAgICB0aGlzLnJvb3QucmF3cy5hZnRlciA9IHBhcnQuYmVmb3JlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLnJ1bGUocGFydCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMucG9zICs9IDE7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBjb21tZW50KHBhcnQpIHtcbiAgICAgICAgbGV0IHRva2VuID0gcGFydC50b2tlbnNbMF07XG4gICAgICAgIGxldCBub2RlICA9IG5ldyBDb21tZW50KCk7XG4gICAgICAgIHRoaXMuaW5pdChub2RlLCBwYXJ0KTtcbiAgICAgICAgbm9kZS5zb3VyY2UuZW5kID0geyBsaW5lOiB0b2tlbls0XSwgY29sdW1uOiB0b2tlbls1XSB9O1xuXG4gICAgICAgIGxldCB0ZXh0ID0gdG9rZW5bMV07XG4gICAgICAgIGlmICggdG9rZW5bNl0gPT09ICdpbmxp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2Vucyk7XG4gICAgICAgIH1cblxuICAgICAgICBub2RlLnJhd3MuYWZ0ZXJOYW1lID0gdGhpcy5maXJzdFNwYWNlcyhwYXJhbXMpO1xuICAgICAgICB0aGlzLmtlZXBUcmFpbGluZ1NwYWNlKG5vZGUsIHBhcmFtcyk7XG4gICAgICAgIHRoaXMucmF3KG5vZGUsICdwYXJhbXMnLCBwYXJhbXMsIGF0d29yZCk7XG4gICAgfVxuXG4gICAgZGVjbChwYXJ0KSB7XG4gICAgICAgIGxldCBub2RlID0gbmV3IERlY2xhcmF0aW9uKCk7XG4gICAgICAgIHRoaXMuaW5pdChub2RlLCBwYXJ0KTtcblxuICAgICAgICBsZXQgYmV0d2VlbiA9ICcnO1xuICAgICAgICBsZXQgY29sb24gICA9IDA7XG4gICAgICAgIGxldCB2YWx1ZSAgID0gW107XG4gICAgICAgIGxldCBwcm9wICAgID0gJyc7XG4gICAgICAgIGZvciAoIGxldCBpID0gMDsgaSA8IHBhcnQudG9rZW5zLmxlbmd0aDsgaSsrICkge1xuICAgICAgICAgICAgbGV0IHRva2VuID0gcGFydC50b2tlbnNbaV07XG4gICAgICAgICAgICBpZiAoIHRva2VuWzBdID09PSAnOicgKSB7XG4gICAgICAgICAgICAgICAgYmV0d2VlbiArPSB0b2tlblsxXTtcbiAgICAgICAgICAgICAgICBjb2xvbiAgICA9IHRva2VuO1xuICAgICAgICAgICAgICAgIHZhbHVlICAgID0gcGFydC50b2tlbnMuc2xpY2UoaSArIDEpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggdG9rZW5bMF0gPT09ICdjb21tZW50JyB8fCB0b2tlblswXSA9PT0gJ3NwYWNlJyApIHtcbiAgICAgICAgICAgICAgICBiZXR3ZWVuICs9IHRva2VuWzFdO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggYmV0d2VlbiAhPT0gJycgKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5iYWRQcm9wKHRva2VuKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcHJvcCArPSB0b2tlblsxXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICggcHJvcCA9PT0gJycgKSB0aGlzLnVubmFtZWREZWNsKHBhcnQudG9rZW5zWzBdKTtcbiAgICAgICAgbm9kZS5wcm9wID0gcHJvcDtcblxuICAgICAgICBsZXQgbmV4dCA9IHRoaXMucGFydHNbdGhpcy5wb3MgKyAxXTtcblxuICAgICAgICB3aGlsZSAoICFuZXh0LmVuZCAmJiAhbmV4dC5hdHJ1bGUgJiYgIW5leHQuY29sb24gJiZcbiAgICAgICAgICAgICAgICBuZXh0LmluZGVudC5sZW5ndGggPiBwYXJ0LmluZGVudC5sZW5ndGggKSB7XG4gICAgICAgICAgICB2YWx1ZS5wdXNoKFsnc3BhY2UnLCBuZXh0LmJlZm9yZSArIG5leHQuaW5kZW50XSk7XG4gICAgICAgICAgICB2YWx1ZSA9IHZhbHVlLmNvbmNhdChuZXh0LnRva2Vucyk7XG4gICAgICAgICAgICB0aGlzLnBvcyArPSAxO1xuICAgICAgICAgICAgbmV4dCA9IHRoaXMucGFydHNbdGhpcy5wb3MgKyAxXTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAoIGxldCBpID0gdmFsdWUubGVuZ3RoIC0gMTsgaSA+IDA7IGktLSApIHtcbiAgICAgICAgICAgIGxldCB0ID0gdmFsdWVbaV1bMF07XG4gICAgICAgICAgICBpZiAoIHQgPT09ICd3b3JkJyAmJiB2YWx1ZVtpXVsxXSA9PT0gJyFpbXBvcnRhbnQnICkge1xuICAgICAgICAgICAgICAgIG5vZGUuaW1wb3J0YW50ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBpZiAoIGkgPiAwICYmIHZhbHVlW2kgLSAxXVswXSA9PT0gJ3NwYWNlJyApIHtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5yYXdzLmltcG9ydGFudCA9IHZhbHVlW2kgLSAxXVsxXSArICchaW1wb3J0YW50JztcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUuc3BsaWNlKGkgLSAxLCAyKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBub2RlLnJhd3MuaW1wb3J0YW50ID0gJyFpbXBvcnRhbnQnO1xuICAgICAgICAgICAgICAgICAgICB2YWx1ZS5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggdCAhPT0gJ3NwYWNlJyAmJiB0ICE9PSAnbmV3bGluZScgJiYgdCAhPT0gJ2NvbW1lbnQnICkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgbm9kZS5yYXdzLmJldHdlZW4gPSBiZXR3ZWVuICsgdGhpcy5maXJzdFNwYWNlcyh2YWx1ZSk7XG4gICAgICAgIHRoaXMucmF3KG5vZGUsICd2YWx1ZScsIHZhbHVlLCBjb2xvbik7XG4gICAgfVxuXG4gICAgcnVsZShwYXJ0KSB7XG4gICAgICAgIGxldCBub2RlID0gbmV3IFJ1bGUoKTtcbiAgICAgICAgdGhpcy5pbml0KG5vZGUsIHBhcnQpO1xuXG4gICAgICAgIGxldCBzZWxlY3RvciA9IHBhcnQudG9rZW5zO1xuICAgICAgICBsZXQgbmV4dCAgICAgPSB0aGlzLnBhcnRzW3RoaXMucG9zICsgMV07XG5cbiAgICAgICAgd2hpbGUgKCAhbmV4dC5lbmQgJiYgbmV4dC5pbmRlbnQubGVuZ3RoID09PSBwYXJ0LmluZGVudC5sZW5ndGggKSB7XG4gICAgICAgICAgICBzZWxlY3Rvci5wdXNoKFsnc3BhY2UnLCBuZXh0LmJlZm9yZSArIG5leHQuaW5kZW50XSk7XG4gICAgICAgICAgICBzZWxlY3RvciA9IHNlbGVjdG9yLmNvbmNhdChuZXh0LnRva2Vucyk7XG4gICAgICAgICAgICB0aGlzLnBvcyArPSAxO1xuICAgICAgICAgICAgbmV4dCA9IHRoaXMucGFydHNbdGhpcy5wb3MgKyAxXTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMua2VlcFRyYWlsaW5nU3BhY2Uobm9kZSwgc2VsZWN0b3IpO1xuICAgICAgICB0aGlzLnJhdyhub2RlLCAnc2VsZWN0b3InLCBzZWxlY3Rvcik7XG4gICAgfVxuXG4gICAgLyogSGVscGVycyAqL1xuXG4gICAgaW5kZW50KHBhcnQpIHtcbiAgICAgICAgbGV0IGluZGVudCA9IHBhcnQuaW5kZW50Lmxlbmd0aDtcbiAgICAgICAgbGV0IGlzUHJldiA9IHR5cGVvZiB0aGlzLnByZXZJbmRlbnQgIT09ICd1bmRlZmluZWQnO1xuXG4gICAgICAgIGlmICggIWlzUHJldiAmJiBpbmRlbnQgKSB0aGlzLmluZGVudGVkRmlyc3RMaW5lKHBhcnQpO1xuXG4gICAgICAgIGlmICggIXRoaXMuc3RlcCAmJiBpbmRlbnQgKSB7XG4gICAgICAgICAgICB0aGlzLnN0ZXAgPSBpbmRlbnQ7XG4gICAgICAgICAgICB0aGlzLnJvb3QucmF3cy5pbmRlbnQgPSBwYXJ0LmluZGVudDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICggaXNQcmV2ICYmIHRoaXMucHJldkluZGVudCAhPT0gaW5kZW50ICkge1xuICAgICAgICAgICAgbGV0IGRpZmYgPSBpbmRlbnQgLSB0aGlzLnByZXZJbmRlbnQ7XG4gICAgICAgICAgICBpZiAoIGRpZmYgPiAwICkge1xuICAgICAgICAgICAgICAgIGlmICggZGlmZiAhPT0gdGhpcy5zdGVwICkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLndyb25nSW5kZW50KHRoaXMucHJldkluZGVudCArIHRoaXMuc3RlcCwgaW5kZW50LCBwYXJ0KTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmN1cnJlbnQgPSB0aGlzLmN1cnJlbnQubGFzdDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBkaWZmICUgdGhpcy5zdGVwICE9PSAwICkge1xuICAgICAgICAgICAgICAgIGxldCBtID0gaW5kZW50ICsgZGlmZiAlIHRoaXMuc3RlcDtcbiAgICAgICAgICAgICAgICB0aGlzLndyb25nSW5kZW50KGAkeyBtIH0gb3IgJHsgbSArIHRoaXMuc3RlcCB9YCwgaW5kZW50LCBwYXJ0KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZm9yICggbGV0IGkgPSAwOyBpIDwgLWRpZmYgLyB0aGlzLnN0ZXA7IGkrKyApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50ID0gdGhpcy5jdXJyZW50LnBhcmVudDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnByZXZJbmRlbnQgPSBpbmRlbnQ7XG4gICAgfVxuXG4gICAgaW5pdChub2RlLCBwYXJ0KSB7XG4gICAgICAgIHRoaXMuaW5kZW50KHBhcnQpO1xuXG4gICAgICAgIGlmICggIXRoaXMuY3VycmVudC5ub2RlcyApIHRoaXMuY3VycmVudC5ub2RlcyA9IFtdO1xuICAgICAgICB0aGlzLmN1cnJlbnQucHVzaChub2RlKTtcblxuICAgICAgICBub2RlLnJhd3MuYmVmb3JlID0gcGFydC5iZWZvcmUgKyBwYXJ0LmluZGVudDtcbiAgICAgICAgbm9kZS5zb3VyY2UgPSB7XG4gICAgICAgICAgICBzdGFydDogeyBsaW5lOiBwYXJ0LnRva2Vuc1swXVsyXSwgY29sdW1uOiBwYXJ0LnRva2Vuc1swXVszXSB9LFxuICAgICAgICAgICAgaW5wdXQ6IHRoaXMuaW5wdXRcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBrZWVwVHJhaWxpbmdTcGFjZShub2RlLCB0b2tlbnMpIHtcbiAgICAgICAgbGV0IGxhc3RTcGFjZSA9IHRva2Vuc1t0b2tlbnMubGVuZ3RoIC0gMV07XG4gICAgICAgIGlmICggbGFzdFNwYWNlICYmIGxhc3RTcGFjZVswXSA9PT0gJ3NwYWNlJyApIHtcbiAgICAgICAgICAgIHRva2Vucy5wb3AoKTtcbiAgICAgICAgICAgIG5vZGUucmF3cy5zc3NCZXR3ZWVuID0gbGFzdFNwYWNlWzFdO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZmlyc3RTcGFjZXModG9rZW5zKSB7XG4gICAgICAgIGxldCByZXN1bHQgPSAnJztcbiAgICAgICAgZm9yICggbGV0IGkgPSAwOyBpIDwgdG9rZW5zLmxlbmd0aDsgaSsrICkge1xuICAgICAgICAgICAgaWYgKCB0b2tlbnNbaV1bMF0gPT09ICdzcGFjZScgfHwgdG9rZW5zW2ldWzBdID09PSAnbmV3bGluZScgKSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0ICs9IHRva2Vucy5zaGlmdCgpWzFdO1xuICAgICAgICAgICAgICAgIGkgLT0gMTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICByYXcobm9kZSwgcHJvcCwgdG9rZW5zLCBhbHRMYXN0KSB7XG4gICAgICAgIGxldCB0b2tlbiwgdHlwZTtcbiAgICAgICAgbGV0IGxlbmd0aCA9IHRva2Vucy5sZW5ndGg7XG4gICAgICAgIGxldCB2YWx1ZSAgPSAnJztcbiAgICAgICAgbGV0IGNsZWFuICA9IHRydWU7XG4gICAgICAgIGZvciAoIGxldCBpID0gMDsgaSA8IGxlbmd0aDsgaSArPSAxICkge1xuICAgICAgICAgICAgdG9rZW4gPSB0b2tlbnNbaV07XG4gICAgICAgICAgICB0eXBlICA9IHRva2VuWzBdO1xuICAgICAgICAgICAgaWYgKCB0eXBlID09PSAnY29tbWVudCcgfHwgdHlwZSA9PT0gJ3NwYWNlJyAmJiBpID09PSBsZW5ndGggLSAxICkge1xuICAgICAgICAgICAgICAgIGNsZWFuID0gZmFsc2U7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhbHVlICs9IHRva2VuWzFdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICggIWNsZWFuICkge1xuICAgICAgICAgICAgbGV0IHNzcyA9IHRva2Vucy5yZWR1Y2UoIChhbGwsIGkpID0+IGFsbCArIGlbMV0sICcnKTtcbiAgICAgICAgICAgIGxldCByYXcgPSB0b2tlbnMucmVkdWNlKCAoYWxsLCBpKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCBpWzBdID09PSAnY29tbWVudCcgJiYgaVs2XSA9PT0gJ2lubGluZScgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhbGwgKyAnLyogJyArIGlbMV0uc2xpY2UoMikudHJpbSgpICsgJyAqLyc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFsbCArIGlbMV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSwgJycpO1xuICAgICAgICAgICAgbm9kZS5yYXdzW3Byb3BdID0geyB2YWx1ZSwgcmF3IH07XG4gICAgICAgICAgICBpZiAoIHNzcyAhPT0gcmF3ICkgbm9kZS5yYXdzW3Byb3BdLnNzcyA9IHNzcztcbiAgICAgICAgfVxuICAgICAgICBub2RlW3Byb3BdID0gdmFsdWU7XG5cbiAgICAgICAgbGV0IGxhc3QgPSB0b2tlbnNbdG9rZW5zLmxlbmd0aCAtIDFdIHx8IGFsdExhc3Q7XG4gICAgICAgIG5vZGUuc291cmNlLmVuZCA9IHsgbGluZTogbGFzdFs0XSwgY29sdW1uOiBsYXN0WzVdIH07XG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A9IHRoaXMucGFydHNbdGhpcy5wb3NdO1xuXG4gICAgICAgICAgICBpZiAoIHBhcnQuY29tbWVudCApIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNvbW1lbnQocGFydCk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBwYXJ0LmF0cnVsZSApIHtcbiAgICAgICAgICAgICAgICB0aGlzLmF0cnVsZShwYXJ0KTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHBhcnQuY29sb24gKSB7XG4gICAgICAgICAgICAgICAgbGV0IG5leHQgPSB0aGlzLm5leHROb25Db21tZW50KHRoaXMucG9zKTtcblxuICAgICAgICAgICAgICAgIGlmICggbmV4dC5lbmQgfHwgbmV4dC5hdHJ1bGUgKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZGVjbChwYXJ0KTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBsZXQgc2FtZUluZGVudCA9IG5leHQuaW5kZW50Lmxlbmd0aCA9PT0gcGFydC5pbmRlbnQubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIHNhbWVJbmRlbnQgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRlY2wocGFydCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoICFzYW1lSW5kZW50ICYmIG5leHQuY29sb24gKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnJ1bGUocGFydCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoICFzYW1lSW5kZW50ICYmICFuZXh0LmNvbG9uICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kZWNsKHBhcnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmICggcGFydC5lbmQgKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5yb290LnJhd3MuYWZ0Z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ldCBub2RlICA9IG5ldyBBdFJ1bGUoKTtcbiAgICAgICAgbm9kZS5uYW1lID0gYXR3b3JkWzFdLnNsaWNlKDEpO1xuICAgICAgICB0aGlzLmluaXQobm9kZSwgcGFydCk7XG5cbiAgICAgICAgaWYgKCBub2RlLm5hbWUgPT09ICcnICkgdGhpcy51bm5hbWVkQXRydWxlKGF0d29yZCk7XG5cbiAgICAgICAgd2hpbGUgKCAhcGFydC5lbmQgJiYgcGFydC5sYXN0Q29tbWEgKSB7XG4gICAgICAgICAgICB0aGlzLnBvcyArPSAxO1xuICAgICAgICAgICAgcGFydCA9IHRoaXMucGFydHNbdGhpcy5wb3NdO1xuICAgICAgICAgICAgcGFyYW1zLnB1c2goWydzcGFjZScsIHBhcnQuYmVmb3JlICsgcGFydC5pbmRlbnRdKTtcbiAgICAgICAgICAgIHBhcmFtcyA9IHBhcmFtcy5jb25jYXQocGFydC50b2tlbnMpO1xuICAgICAgICB9XG5cbiAgICAgICAgbm9kZS5yYXdzLmFmdGVyTmFtZSA9IHRoaXMuZmlyc3RTcGFjZXMocGFyYW1zKTtcbiAgICAgICAgdGhpcy5rZWVwVHJhaWxpbmdTcGFjZShub2RlLCBwYXJhbXMpO1xuICAgICAgICB0aGlzLnJhdyhub2RlLCAncGFyYW1zJywgcGFyYW1zLCBhdHdvcmQpO1xuICAgIH1cblxuICAgIGRlY2wocGFydCkge1xuICAgICAgICBsZXQgbm9kZSA9IG5ldyBEZWNsYXJhdGlvbigpO1xuICAgICAgICB0aGlzLmluaXQobm9kZSwgcGFydCk7XG5cbiAgICAgICAgbGV0IGJldHdlZW4gPSAnJztcbiAgICAgICAgbGV0IGNvbG9uICAgPSAwO1xuICAgICAgICBsZXQgdmFsdWUgICA9IFtdO1xuICAgICAgICBsZXQgcHJvcCAgICA9ICcnO1xuICAgICAgICBmb3IgKCBsZXQgaSA9IDA7IGkgPCBwYXJ0LnRva2Vucy5sZW5ndGg7IGkrKyApIHtcbiAgICAgICAgICAgIGxldCB0b2tlbiA9IHBhcnQudG9rZW5zW2ldO1xuICAgICAgICAgICAgaWYgKCB0b2tlblswXSA9PT0gJzonICkge1xuICAgICAgICAgICAgICAgIGJldHdlZW4gKz0gdG9rZW5bMV07XG4gICAgICAgICAgICAgICAgY29sb24gICAgPSB0b2tlbjtcbiAgICAgICAgICAgICAgICB2YWx1ZSAgICA9IHBhcnQudG9rZW5zLnNsaWNlKGkgKyAxKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHRva2VuWzBdID09PSAnY29tbWVudCcgfHwgdG9rZW5bMF0gPT09ICdzcGFjZScgKSB7XG4gICAgICAgICAgICAgICAgYmV0d2VlbiArPSB0b2tlblsxXTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIGJldHdlZW4gIT09ICcnICkge1xuICAgICAgICAgICAgICAgIHRoaXMuYmFkUHJvcCh0b2tlbik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHByb3AgKz0gdG9rZW5bMV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIHByb3AgPT09ICcnICkgdGhpcy51bm5hbWVkRGVjbChwYXJ0LnRva2Vuc1swXSk7XG4gICAgICAgIG5vZGUucHJvcCA9IHByb3A7XG5cbiAgICAgICAgbGV0IG5leHQgPSB0aGlzLnBhcnRzW3RoaXMucG9zICsgMV07XG5cbiAgICAgICAgd2hpbGUgKCAhbmV4dC5lbmQgJiYgIW5leHQuYXRydWxlICYmICFuZXh0LmNvbG9uICYmXG4gICAgICAgICAgICAgICAgbmV4dC5pbmRlbnQubGVuZ3RoID4gcGFydC5pbmRlbnQubGVuZ3RoICkge1xuICAgICAgICAgICAgdmFsdWUucHVzaChbJ3NwYWNlJywgbmV4dC5iZWZvcmUgKyBuZXh0LmluZGVudF0pO1xuICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZS5jb25jYXQobmV4dC50b2tlbnMpO1xuICAgICAgICAgICAgdGhpcy5wb3MgKz0gMTtcbiAgICAgICAgICAgIG5leHQgPSB0aGlzLnBhcnRzW3RoaXMucG9zICsgMV07XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKCBsZXQgaSA9IHZhbHVlLmxlbmd0aCAtIDE7IGkgPiAwOyBpLS0gKSB7XG4gICAgICAgICAgICBsZXQgdCA9IHZhbHVlW2ldWzBdO1xuICAgICAgICAgICAgaWYgKCB0ID09PSAnd29yZCcgJiYgdmFsdWVbaV1bMV0gPT09ICchaW1wb3J0YW50JyApIHtcbiAgICAgICAgICAgICAgICBub2RlLmltcG9ydGFudCA9IHRydWU7XG4gICAgICAgICAgICAgICAgaWYgKCBpID4gMCAmJiB2YWx1ZVtpIC0gMV1bMF0gPT09ICdzcGFjZScgKSB7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUucmF3cy5pbXBvcnRhbnQgPSB2YWx1ZVtpIC0gMV1bMV0gKyAnIWltcG9ydGFudCc7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlLnNwbGljZShpIC0gMSwgMik7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5yYXdzLmltcG9ydGFudCA9ICchaW1wb3J0YW50JztcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUuc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHQgIT09ICdzcGFjZScgJiYgdCAhPT0gJ25ld2xpbmUnICYmIHQgIT09ICdjb21tZW50JyApIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIG5vZGUucmF3cy5iZXR3ZWVuID0gYmV0d2VlbiArIHRoaXMuZmlyc3RTcGFjZXModmFsdWUpO1xuICAgICAgICB0aGlzLnJhdyhub2RlLCAndmFsdWUnLCB2YWx1ZSwgY29sb24pO1xuICAgIH1cblxuICAgIHJ1bGUocGFydCkge1xuICAgICAgICBsZXQgbm9kZSA9IG5ldyBSdWxlKCk7XG4gICAgICAgIHRoaXMuaW5pdChub2RlLCBwYXJ0KTtcblxuICAgICAgICBsZXQgc2VsZWN0b3IgPSBwYXJ0LnRva2VucztcbiAgICAgICAgbGV0IG5leHQgICAgID0gdGhpcy5wYXJ0c1t0aGlzLnBvcyArIDFdO1xuXG4gICAgICAgIHdoaWxlICggIW5leHQuZW5kICYmIG5leHQuaW5kZW50Lmxlbmd0aCA9PT0gcGFydC5pbmRlbnQubGVuZ3RoICkge1xuICAgICAgICAgICAgc2VsZWN0b3IucHVzaChbJ3NwYWNlJywgbmV4dC5iZWZvcmUgKyBuZXh0LmluZGVudF0pO1xuICAgICAgICAgICAgc2VsZWN0b3IgPSBzZWxlY3Rvci5jb25jYXQobmV4dC50b2tlbnMpO1xuICAgICAgICAgICAgdGhpcy5wb3MgKz0gMTtcbiAgICAgICAgICAgIG5leHQgPSB0aGlzLnBhcnRzW3RoaXMucG9zICsgMV07XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmtlZXBUcmFpbGluZ1NwYWNlKG5vZGUsIHNlbGVjdG9yKTtcbiAgICAgICAgdGhpcy5yYXcobm9kZSwgJ3NlbGVjdG9yJywgc2VsZWN0b3IpO1xuICAgIH1cblxuICAgIC8qIEhlbHBlcnMgKi9cblxuICAgIGluZGVudChwYXJ0KSB7XG4gICAgICAgIGxldCBpbmRlbnQgPSBwYXJ0LmluZGVudC5sZW5ndGg7XG4gICAgICAgIGxldCBpc1ByZXYgPSB0eXBlb2YgdGhpcy5wcmV2SW5kZW50ICE9PSAndW5kZWZpbmVkJztcblxuICAgICAgICBpZiAoICFpc1ByZXYgJiYgaW5kZW50ICkgdGhpcy5pbmRlbnRlZEZpcnN0TGluZShwYXJ0KTtcblxuICAgICAgICBpZiAoICF0aGlzLnN0ZXAgJiYgaW5kZW50ICkge1xuICAgICAgICAgICAgdGhpcy5zdGVwID0gaW5kZW50O1xuICAgICAgICAgICAgdGhpcy5yb290LnJhd3MuaW5kZW50ID0gcGFydC5pbmRlbnQ7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIGlzUHJldiAmJiB0aGlzLnByZXZJbmRlbnQgIT09IGluZGVudCApIHtcbiAgICAgICAgICAgIGxldCBkaWZmID0gaW5kZW50IC0gdGhpcy5wcmV2SW5kZW50O1xuICAgICAgICAgICAgaWYgKCBkaWZmID4gMCApIHtcbiAgICAgICAgICAgICAgICBpZiAoIGRpZmYgIT09IHRoaXMuc3RlcCApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy53cm9uZ0luZGVudCh0aGlzLnByZXZJbmRlbnQgKyB0aGlzLnN0ZXAsIGluZGVudCwgcGFydCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50ID0gdGhpcy5jdXJyZW50Lmxhc3Q7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmICggZGlmZiAlIHRoaXMuc3RlcCAhPT0gMCApIHtcbiAgICAgICAgICAgICAgICBsZXQgbSA9IGluZGVudCArIGRpZmYgJSB0aGlzLnN0ZXA7XG4gICAgICAgICAgICAgICAgdGhpcy53cm9uZ0luZGVudChgJHsgbSB9IG9yICR7IG0gKyB0aGlzLnN0ZXAgfWAsIGluZGVudCwgcGFydCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGZvciAoIGxldCBpID0gMDsgaSA8IC1kaWZmIC8gdGhpcy5zdGVwOyBpKysgKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudCA9IHRoaXMuY3VycmVudC5wYXJlbnQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5wcmV2SW5kZW50ID0gaW5kZW50O1xuICAgIH1cblxuICAgIGluaXQobm9kZSwgcGFydCkge1xuICAgICAgICB0aGlzLmluZGVudChwYXJ0KTtcblxuICAgICAgICBpZiAoICF0aGlzLmN1cnJlbnQubm9kZXMgKSB0aGlzLmN1cnJlbnQubm9kZXMgPSBbXTtcbiAgICAgICAgdGhpcy5jdXJyZW50LnB1c2gobm9kZSk7XG5cbiAgICAgICAgbm9kZS5yYXdzLmJlZm9yZSA9IHBhcnQuYmVmb3JlICsgcGFydC5pbmRlbnQ7XG4gICAgICAgIG5vZGUuc291cmNlID0ge1xuICAgICAgICAgICAgc3RhcnQ6IHsgbGluZTogcGFydC50b2tlbnNbMF1bMl0sIGNvbHVtbjogcGFydC50b2tlbnNbMF1bM10gfSxcbiAgICAgICAgICAgIGlucHV0OiB0aGlzLmlucHV0XG4gICAgICAgIH07XG4gICAgfVxuXG4gICAga2VlcFRyYWlsaW5nU3BhY2Uobm9kZSwgdG9rZW5zKSB7XG4gICAgICAgIGxldCBsYXN0U3BhY2UgPSB0b2tlbnNbdG9rZW5zLmxlbmd0aCAtIDFdO1xuICAgICAgICBpZiAoIGxhc3RTcGFjZSAmJiBsYXN0U3BhY2VbMF0gPT09ICdzcGFjZScgKSB7XG4gICAgICAgICAgICB0b2tlbnMucG9wKCk7XG4gICAgICAgICAgICBub2RlLnJhd3Muc3NzQmV0d2VlbiA9IGxhc3RTcGFjZVsxXTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZpcnN0U3BhY2VzKHRva2Vucykge1xuICAgICAgICBsZXQgcmVzdWx0ID0gJyc7XG4gICAgICAgIGZvciAoIGxldCBpID0gMDsgaSA8IHRva2Vucy5sZW5ndGg7IGkrKyApIHtcbiAgICAgICAgICAgIGlmICggdG9rZW5zW2ldWzBdID09PSAnc3BhY2UnIHx8IHRva2Vuc1tpXVswXSA9PT0gJ25ld2xpbmUnICkge1xuICAgICAgICAgICAgICAgIHJlc3VsdCArPSB0b2tlbnMuc2hpZnQoKVsxXTtcbiAgICAgICAgICAgICAgICBpIC09IDE7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcmF3KG5vZGUsIHByb3AsIHRva2VucywgYWx0TGFzdCkge1xuICAgICAgICBsZXQgdG9rZW4sIHR5cGU7XG4gICAgICAgIGxldCBsZW5ndGggPSB0b2tlbnMubGVuZ3RoO1xuICAgICAgICBsZXQgdmFsdWUgID0gJyc7XG4gICAgICAgIGxldCBjbGVhbiAgPSB0cnVlO1xuICAgICAgICBmb3IgKCBsZXQgaSA9IDA7IGkgPCBsZW5ndGg7IGkgKz0gMSApIHtcbiAgICAgICAgICAgIHRva2VuID0gdG9rZW5zW2ldO1xuICAgICAgICAgICAgdHlwZSAgPSB0b2tlblswXTtcbiAgICAgICAgICAgIGlmICggdHlwZSA9PT0gJ2NvbW1lbnQnIHx8IHR5cGUgPT09ICdzcGFjZScgJiYgaSA9PT0gbGVuZ3RoIC0gMSApIHtcbiAgICAgICAgICAgICAgICBjbGVhbiA9IGZhbHNlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSArPSB0b2tlblsxXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoICFjbGVhbiApIHtcbiAgICAgICAgICAgIGxldCBzc3MgPSB0b2tlbnMucmVkdWNlKCAoYWxsLCBpKSA9PiBhbGwgKyBpWzFdLCAnJyk7XG4gICAgICAgICAgICBsZXQgcmF3ID0gdG9rZW5zLnJlZHVjZSggKGFsbCwgaSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICggaVswXSA9PT0gJ2NvbW1lbnQnICYmIGlbNl0gPT09ICdpbmxpbmUnICkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYWxsICsgJy8qICcgKyBpWzFdLnNsaWNlKDIpLnRyaW0oKSArICcgKi8nO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhbGwgKyBpWzFdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sICcnKTtcbiAgICAgICAgICAgIG5vZGUucmF3c1twcm9wXSA9IHsgdmFsdWUsIHJhdyB9O1xuICAgICAgICAgICAgaWYgKCBzc3MgIT09IHJhdyApIG5vZGUucmF3c1twcm9wXS5zc3MgPSBzc3M7XG4gICAgICAgIH1cbiAgICAgICAgbm9kZVtwcm9wXSA9IHZhbHVlO1xuXG4gICAgICAgIGxldCBsYXN0ID0gdG9rZW5zW3Rva2Vucy5sZW5ndGggLSAxXSB8fCBhbHRMYXN0O1xuICAgICAgICBub2RlLnNvdXJjZS5lbmQgPSB7IGxpbmU6IGxhc3RbNF0sIGNvbHVtbjogbGFzdFs1XSB9O1xuICAgIH1cblxuICAgIG5leHROb25Db21tZW50KHBvcykge1xuICAgICAgICBsZXQgbmV4dCA9IHBvcztcbiAgICAgICAgbGV0IHBhcnQ7XG4gICAgICAgIHdoaWxlICggbmV4dCA8IHRoaXMucGFydHMubGVuZ3RoICkge1xuICAgICAgICAgICAgbmV4dCArPSAxO1xuICAgICAgICAgICAgcGFydCA9IHRoaXMucGFydHNbbmV4dF07XG4gICAgICAgICAgICBpZiAoIHBhcnQuZW5kIHx8ICFwYXJ0LmNvbW1lbnQgKSBicmVhaztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcGFydDtcbiAgICB9XG5cbiAgICAvLyBFcnJvcnNcblxuICAgIGVycm9yKG1zZywgbGluZSwgY29sdW1uKSB7XG4gICAgICAgIHRocm93IHRoaXMuaW5wdXQuZXJyb3IobXNnLCBsaW5lLCBjb2x1bW4pO1xuICAgIH1cblxuICAgIHVubmFtZWRBdHJ1bGUodG9rZW4pIHtcbiAgICAgICAgdGhpcy5lcnJvcignQXQtcnVsZSB3aXRob3V0IG5hbWUnLCB0b2tlblsyXSwgdG9rZW5bM10pO1xuICAgIH1cblxuICAgIHVubmFtZWREZWNsKHRva2VuKSB7XG4gICAgICAgIHRoaXMuZXJyb3IoJ0RlY2xhcmF0aW9uIHdpdGhvdXQgbmFtZScsIHRva2VuWzJdLCB0b2tlblszXSk7XG4gICAgfVxuXG4gICAgaW5kZW50ZWRGaXJzdExpbmUocGFydCkge1xuICAgICAgICB0aGlzLmVycm9yKCdGaXJzdCBsaW5lIHNob3VsZCBub3QgaGF2ZSBpbmRlbnQnLCBwYXJ0Lm51bWJlciwgMSk7XG4gICAgfVxuXG4gICAgd3JvbmdJbmRlbnQoZXhwZWN0ZWQsIHJlYWwsIHBhcnQpIHtcbiAgICAgICAgbGV0IG1zZyA9IGBFeHBlY3RlZCAkeyBleHBlY3RlZCB9IGluZGVudCwgYnV0IGdldCAkeyByZWFsIH1gO1xuICAgICAgICB0aGlzLmVycm9yKG1zZywgcGFydC5udW1iZXIsIDEpO1xuICAgIH1cblxuICAgIGJhZFByb3AodG9rZW4pIHtcbiAgICAgICAgdGhpcy5lcnJvcignVW5leHBlY3RlZCBzZXBhcmF0b3IgaW4gcHJvcGVydHknLCB0b2tlblsyXSwgdG9rZW5bM10pO1xuICAgIH1cblxufVxuIl19
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