├── .gitignore ├── .no-sublime-package ├── Context.sublime-menu ├── Default (Linux).sublime-keymap ├── Default (OSX).sublime-keymap ├── Default (Windows).sublime-keymap ├── Main.sublime-menu ├── README.md ├── cssorder.js ├── cssorder.py ├── cssorder.sublime-commands ├── cssorder.sublime-settings ├── libs ├── diff_match_patch │ ├── COPYING │ ├── README.txt │ ├── __init__.py │ ├── __init__.pyc │ ├── python2 │ │ ├── .diff_match_patch.py.swp │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── diff_match_patch.py │ │ └── diff_match_patch.pyc │ └── python3 │ │ ├── __init__.py │ │ └── diff_match_patch.py ├── merge_utils.py └── merge_utils.pyc ├── node_modules ├── .bin │ └── csscomb └── cssorder │ ├── README.md │ ├── bin │ └── cssorder │ ├── node_modules │ ├── .bin │ │ ├── csscomb │ │ └── csscomb.cmd │ └── csscomb │ │ ├── README.md │ │ ├── bin │ │ └── csscomb │ │ ├── config │ │ ├── csscomb.json │ │ ├── yandex.json │ │ └── zen.json │ │ ├── lib │ │ ├── cli.js │ │ ├── csscomb.js │ │ └── options │ │ │ ├── always-semicolon.js │ │ │ ├── block-indent.js │ │ │ ├── color-case.js │ │ │ ├── color-shorthand.js │ │ │ ├── element-case.js │ │ │ ├── eof-newline.js │ │ │ ├── leading-zero.js │ │ │ ├── quotes.js │ │ │ ├── remove-empty-rulesets.js │ │ │ ├── sort-order-fallback.js │ │ │ ├── sort-order.js │ │ │ ├── space-after-colon.js │ │ │ ├── space-after-combinator.js │ │ │ ├── space-after-opening-brace.js │ │ │ ├── space-after-selector-delimiter.js │ │ │ ├── space-before-closing-brace.js │ │ │ ├── space-before-colon.js │ │ │ ├── space-before-combinator.js │ │ │ ├── space-before-opening-brace.js │ │ │ ├── space-before-selector-delimiter.js │ │ │ ├── space-between-declarations.js │ │ │ ├── strip-spaces.js │ │ │ ├── tab-size.js │ │ │ ├── unitless-zero.js │ │ │ └── vendor-prefix-align.js │ │ ├── node_modules │ │ ├── .bin │ │ │ ├── gonzales │ │ │ └── gonzales.cmd │ │ ├── commander │ │ │ ├── History.md │ │ │ ├── Readme.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── csscomb-core │ │ │ ├── .npmignore │ │ │ ├── README.md │ │ │ ├── TODO.nani │ │ │ ├── lib │ │ │ │ └── core.js │ │ │ ├── node_modules │ │ │ │ ├── minimatch │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── minimatch.js │ │ │ │ │ ├── node_modules │ │ │ │ │ │ ├── lru-cache │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ ├── CONTRIBUTORS │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── lib │ │ │ │ │ │ │ │ └── lru-cache.js │ │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ │ └── test │ │ │ │ │ │ │ │ ├── basic.js │ │ │ │ │ │ │ │ ├── foreach.js │ │ │ │ │ │ │ │ └── memory-leak.js │ │ │ │ │ │ └── sigmund │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── bench.js │ │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ │ ├── sigmund.js │ │ │ │ │ │ │ └── test │ │ │ │ │ │ │ └── basic.js │ │ │ │ │ ├── package.json │ │ │ │ │ └── test │ │ │ │ │ │ ├── basic.js │ │ │ │ │ │ ├── brace-expand.js │ │ │ │ │ │ ├── caching.js │ │ │ │ │ │ └── defaults.js │ │ │ │ └── vow-fs │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── .travis.yml │ │ │ │ │ ├── README.md │ │ │ │ │ ├── lib │ │ │ │ │ └── fs.js │ │ │ │ │ ├── node_modules │ │ │ │ │ ├── glob │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── examples │ │ │ │ │ │ │ ├── g.js │ │ │ │ │ │ │ └── usr-local.js │ │ │ │ │ │ ├── glob.js │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ └── inherits │ │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ ├── inherits.js │ │ │ │ │ │ │ │ ├── inherits_browser.js │ │ │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ │ │ └── test.js │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ └── test │ │ │ │ │ │ │ ├── 00-setup.js │ │ │ │ │ │ │ ├── bash-comparison.js │ │ │ │ │ │ │ ├── bash-results.json │ │ │ │ │ │ │ ├── cwd-test.js │ │ │ │ │ │ │ ├── globstar-match.js │ │ │ │ │ │ │ ├── mark.js │ │ │ │ │ │ │ ├── new-glob-optional-options.js │ │ │ │ │ │ │ ├── nocase-nomagic.js │ │ │ │ │ │ │ ├── pause-resume.js │ │ │ │ │ │ │ ├── root-nomount.js │ │ │ │ │ │ │ ├── root.js │ │ │ │ │ │ │ ├── stat.js │ │ │ │ │ │ │ └── zz-cleanup.js │ │ │ │ │ ├── node-uuid │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── LICENSE.md │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── benchmark │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── bench.gnu │ │ │ │ │ │ │ ├── bench.sh │ │ │ │ │ │ │ ├── benchmark-native.c │ │ │ │ │ │ │ └── benchmark.js │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ ├── test │ │ │ │ │ │ │ ├── compare_v1.js │ │ │ │ │ │ │ ├── test.html │ │ │ │ │ │ │ └── test.js │ │ │ │ │ │ └── uuid.js │ │ │ │ │ └── vow-queue │ │ │ │ │ │ ├── .jscs.json │ │ │ │ │ │ ├── .jshintignore │ │ │ │ │ │ ├── .jshintrc │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ ├── CHANGELOG.md │ │ │ │ │ │ ├── CONTRIBUTION.md │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── bower.json │ │ │ │ │ │ ├── lib │ │ │ │ │ │ └── queue.js │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── package.json │ │ │ │ │ └── test │ │ │ │ │ ├── copy.js │ │ │ │ │ ├── issymlink.js │ │ │ │ │ ├── makedir.js │ │ │ │ │ ├── maketmpfile.js │ │ │ │ │ ├── removedir.js │ │ │ │ │ └── runner.js │ │ │ └── package.json │ │ ├── gonzales-pe │ │ │ ├── .npmignore │ │ │ ├── CHANGELOG.md │ │ │ ├── MIT-LICENSE.txt │ │ │ ├── README.md │ │ │ ├── bin │ │ │ │ └── gonzales.js │ │ │ ├── doc │ │ │ │ ├── AST-Description.md │ │ │ │ └── Gonzales-Usage.md │ │ │ ├── lib │ │ │ │ ├── ast-to-src.js │ │ │ │ ├── ast-to-string.js │ │ │ │ ├── css │ │ │ │ │ ├── mark.js │ │ │ │ │ ├── node-types.js │ │ │ │ │ ├── rules.js │ │ │ │ │ ├── stringify.js │ │ │ │ │ └── tokenizer.js │ │ │ │ ├── gonzales.ast-to-css.js │ │ │ │ ├── gonzales.css-to-ast.js │ │ │ │ ├── gonzales.js │ │ │ │ ├── js │ │ │ │ │ ├── mark.js │ │ │ │ │ ├── node-types.js │ │ │ │ │ ├── rules.js │ │ │ │ │ ├── stringify.js │ │ │ │ │ └── tokenizer.js │ │ │ │ ├── less │ │ │ │ │ ├── mark.js │ │ │ │ │ ├── node-types.js │ │ │ │ │ ├── rules.js │ │ │ │ │ ├── stringify.js │ │ │ │ │ └── tokenizer.js │ │ │ │ ├── sass │ │ │ │ │ ├── mark.js │ │ │ │ │ ├── node-types.js │ │ │ │ │ ├── rules.js │ │ │ │ │ ├── stringify.js │ │ │ │ │ └── tokenizer.js │ │ │ │ ├── scss │ │ │ │ │ ├── mark.js │ │ │ │ │ ├── node-types.js │ │ │ │ │ ├── rules.js │ │ │ │ │ ├── stringify.js │ │ │ │ │ └── tokenizer.js │ │ │ │ ├── src-to-ast.js │ │ │ │ └── token-types.js │ │ │ ├── package.json │ │ │ └── web │ │ │ │ ├── gonzales.ast-to-css.js │ │ │ │ └── gonzales.css-to-ast.js │ │ └── vow │ │ │ ├── lib │ │ │ └── vow.js │ │ │ ├── package.json │ │ │ └── vow.min.js │ │ └── package.json │ ├── package.json │ └── src │ ├── cli.js │ ├── config │ └── config.json │ └── cssorder.js └── package.json /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lightningtgc/sublime-cssorder/3adb47b695a75ebba7b6c11242ec96e9799a7e76/.gitignore -------------------------------------------------------------------------------- /.no-sublime-package: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lightningtgc/sublime-cssorder/3adb47b695a75ebba7b6c11242ec96e9799a7e76/.no-sublime-package -------------------------------------------------------------------------------- /Context.sublime-menu: -------------------------------------------------------------------------------- 1 | [{ 2 | "caption": "Css Order", 3 | "children": [{ 4 | "caption": "Run Cssorder", 5 | "command": "css_order" 6 | }, { 7 | "caption": "Set Cssorder Config", 8 | "command": "css_order_set_cssorder_config" 9 | }, { 10 | "caption": "Set Keyboard Shortcuts", 11 | "command": "css_order_set_keyboard_shortcuts" 12 | }] 13 | }] 14 | -------------------------------------------------------------------------------- /Default (Linux).sublime-keymap: -------------------------------------------------------------------------------- 1 | [{ 2 | "keys": ["ctrl+shift+o"], 3 | "command": "css_order" 4 | }] 5 | -------------------------------------------------------------------------------- /Default (OSX).sublime-keymap: -------------------------------------------------------------------------------- 1 | [{ 2 | "keys": ["super+shift+o"], 3 | "command": "css_order" 4 | }] 5 | -------------------------------------------------------------------------------- /Default (Windows).sublime-keymap: -------------------------------------------------------------------------------- 1 | [{ 2 | "keys": ["ctrl+shift+o"], 3 | "command": "css_order" 4 | }] 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #Sublime CSSOrder 2 | 3 | > CSSOrder is a sublime text plugin for CSS file formatting. 4 | 5 | > Required Node.js 6 | 7 | ## Intro 8 | 9 | CSSOrder is a css coding style formatter with [Tencent CSS Style](http://alloyteam.github.io/CodeGuide/#css) 10 | 11 | It can handle some special case like 'base64 url', 'single comment // ' and so on in CSS files. 12 | 13 | ## Effect 14 | 15 | Make CSS code become the following coding style: 16 | 17 | ```css 18 | /* Final CSS code */ 19 | .some-style, 20 | .same-style { 21 | position: relative; 22 | top: -2px; 23 | right: 0; 24 | bottom: 0; 25 | left: 5px; 26 | z-index: 100; 27 | 28 | display: inline-block; 29 | width: 20px; 30 | height: 20px; 31 | padding: 5px 10px; 32 | overflow: hidden; 33 | 34 | vertical-align: middle; 35 | 36 | color: #fff; 37 | -webkit-border-radius: 5px; 38 | -moz-border-radius: 5px; 39 | border-radius: 5px; 40 | background-color: rgba(82,157,218,.9); 41 | -webkit-background-clip: padding-box; 42 | -moz-background-clip: padding-box; 43 | background-clip: padding-box; 44 | } 45 | 46 | ``` 47 | 48 | ## Install 49 | 50 | 0. Install [Node.js](http://nodejs.org/) ( if you don't install it before ). 51 | 52 | 1. Install [Package Control](https://packagecontrol.io/installation). 53 | 54 | 2. Press ctrl+shift+p , then input `install` and press Enter . 55 | 56 | After that input `CSSOrder` to find the plugin and press Enter to install it. 57 | 58 | Manually: 59 | 60 | Clone or [download](https://github.com/lightningtgc/sublime-cssorder/archive/master.zip) git repo into your packages folder (in SublimeText, find Browse Packages... menu item to open this folder) 61 | 62 | ## Usage 63 | 64 | Press ctrl+shift+o 65 | 66 | or `right click` the content and select `Run Cssorder`. 67 | 68 | ## Custom configuration 69 | 70 | * You can write your own configuration by opening 71 | 72 | `Tools> Css Order> Set Cssorder Config` 73 | 74 | or `right click` the content and select `Set Cssorder Config` 75 | 76 | * `order_config` is using for some special case (like add newline for every 77 | block). 78 | 79 | `comb_config` is using for the configuration of CSSComb. 80 | 81 | * It will automatically format when you saved the file, 82 | 83 | and you can close automatical format by 84 | 85 | setting `format_on_save` to `false` in `Set Cssorder Config`. 86 | 87 | ## Release History 88 | 89 | + v0.4.0: Add custom config to handle special case. 90 | + v0.3.1: Fix libs dependence. 91 | + v0.3.0: Support Sass and Less. 92 | + v0.2.1: Submitting to Sublime Package Control. 93 | + v0.2.0: Handle compressive file case. 94 | + v0.1.0: Release. 95 | -------------------------------------------------------------------------------- /cssorder.js: -------------------------------------------------------------------------------- 1 | var str = ''; 2 | 3 | process.stdin.resume(); 4 | process.stdin.setEncoding('utf8'); 5 | 6 | process.stdin.on('data', function (data) { 7 | str += data; 8 | }); 9 | 10 | // Deal with cssorder custom config 11 | function handleOrderCustom (content) { 12 | var orderConfig; 13 | try { 14 | orderConfig = JSON.parse(process.argv[4]); 15 | } catch (e) { 16 | orderConfig = null; 17 | } 18 | 19 | // handle options 20 | if (orderConfig) { 21 | //Every block add newline 22 | if(orderConfig["block-newline"]){ 23 | // Deal with multiple comment include css block {} 24 | content = content.replace(/\}[\s\S][^\}+\*\/]+?\{/g, function(match){ 25 | 26 | // remove unnecessary newline,keep single newline 27 | match = match.replace(/\n(?=\n)/g, ''); 28 | match = match.replace(/\}/, ''); 29 | return '}\n' + match; 30 | }); 31 | 32 | // add \n between } and /* 33 | // don't handle same line 34 | content = content.replace(/\}\n[\s\S][^\}+\{+\*\/]+?\/\*/g, function(match){ 35 | // remove unnecessary newline,keep single newline 36 | match = match.replace(/\n/g, ''); 37 | match = match.replace(/\}/, ''); 38 | return '}\n\n' + match; 39 | }); 40 | } 41 | } 42 | return content; 43 | } 44 | 45 | process.stdin.on('end', function () { 46 | var CSSOrder = require('./node_modules/cssorder/src/cssorder'), 47 | order = new CSSOrder(), 48 | syntax = process.argv[2], 49 | config, ordered; 50 | 51 | try { 52 | config = JSON.parse(process.argv[3]); 53 | } catch (e) { 54 | config = null; 55 | } 56 | 57 | config = config || 58 | CSSOrder.getCustomConfig() || 59 | CSSOrder.getConfig('csscomb'); 60 | 61 | ordered = order.configure(config).processText(str, {syntax: syntax}); 62 | // Handle cssorder custom config 63 | try { 64 | ordered = handleOrderCustom(ordered); 65 | } catch (e) { 66 | throw new Error('CSSOrder custom config error'); 67 | } 68 | process.stdout.write(ordered); 69 | }); 70 | 71 | -------------------------------------------------------------------------------- /cssorder.sublime-commands: -------------------------------------------------------------------------------- 1 | [{ 2 | "caption": "CssOrder", 3 | "command": "css_order" 4 | }, { 5 | "caption": "CssOrder: Set Cssorder Config", 6 | "command": "css_order_set_cssorder_config" 7 | }, { 8 | "caption": "CssOrder: Set Keyboard Shortcuts", 9 | "command": "css_order_set_keyboard_shortcuts" 10 | }] 11 | -------------------------------------------------------------------------------- /libs/diff_match_patch/README.txt: -------------------------------------------------------------------------------- 1 | Diff, Match and Patch Library 2 | http://code.google.com/p/google-diff-match-patch/ 3 | Neil Fraser 4 | 5 | This library is currently available in seven different ports, all using the same API. 6 | Every version includes a full set of unit tests. 7 | 8 | C++: 9 | * Ported by Mike Slemmer. 10 | * Currently requires the Qt library. 11 | 12 | C#: 13 | * Ported by Matthaeus G. Chajdas. 14 | 15 | Dart: 16 | * The Dart language is still growing and evolving, so this port is only as 17 | stable as the underlying language. 18 | 19 | Java: 20 | * Included is both the source and a Maven package. 21 | 22 | JavaScript: 23 | * diff_match_patch_uncompressed.js is the human-readable version. 24 | Users of node.js should 'require' this uncompressed version since the 25 | compressed version is not guaranteed to work outside of a web browser. 26 | * diff_match_patch.js has been compressed using Google's internal JavaScript compressor. 27 | Non-Google hackers who wish to recompress the source can use: 28 | http://dean.edwards.name/packer/ 29 | 30 | Lua: 31 | * Ported by Duncan Cross. 32 | * Does not support line-mode speedup. 33 | 34 | Objective C: 35 | * Ported by Jan Weiss. 36 | * Includes speed test (this is a separate bundle for other languages). 37 | 38 | Python: 39 | * Two versions, one for Python 2.x, the other for Python 3.x. 40 | * Runs 10x faster under PyPy than CPython. 41 | 42 | Demos: 43 | * Separate demos for Diff, Match and Patch in JavaScript. 44 | -------------------------------------------------------------------------------- /libs/diff_match_patch/__init__.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | if sys.version_info < (3, 0): 4 | from .python2 import * 5 | else: 6 | from .python3 import * 7 | -------------------------------------------------------------------------------- /libs/diff_match_patch/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lightningtgc/sublime-cssorder/3adb47b695a75ebba7b6c11242ec96e9799a7e76/libs/diff_match_patch/__init__.pyc -------------------------------------------------------------------------------- /libs/diff_match_patch/python2/.diff_match_patch.py.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lightningtgc/sublime-cssorder/3adb47b695a75ebba7b6c11242ec96e9799a7e76/libs/diff_match_patch/python2/.diff_match_patch.py.swp -------------------------------------------------------------------------------- /libs/diff_match_patch/python2/__init__.py: -------------------------------------------------------------------------------- 1 | from .diff_match_patch import diff_match_patch, patch_obj 2 | 3 | -------------------------------------------------------------------------------- /libs/diff_match_patch/python2/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lightningtgc/sublime-cssorder/3adb47b695a75ebba7b6c11242ec96e9799a7e76/libs/diff_match_patch/python2/__init__.pyc -------------------------------------------------------------------------------- /libs/diff_match_patch/python2/diff_match_patch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lightningtgc/sublime-cssorder/3adb47b695a75ebba7b6c11242ec96e9799a7e76/libs/diff_match_patch/python2/diff_match_patch.pyc -------------------------------------------------------------------------------- /libs/diff_match_patch/python3/__init__.py: -------------------------------------------------------------------------------- 1 | from .diff_match_patch import diff_match_patch, patch_obj 2 | 3 | -------------------------------------------------------------------------------- /libs/merge_utils.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright (c) 2012 The GoSublime Authors 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | of the Software, and to permit persons to whom the Software is furnished to do 9 | so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | """ 22 | 23 | # Borrowed from GoSublime 24 | 25 | import sublime 26 | 27 | from diff_match_patch import diff_match_patch 28 | 29 | 30 | class MergeException(Exception): 31 | pass 32 | 33 | 34 | def _merge_code(view, edit, code, formatted): 35 | def ss(start, end): 36 | return view.substr(sublime.Region(start, end)) 37 | 38 | dmp = diff_match_patch() 39 | diffs = dmp.diff_main(code, formatted) 40 | dmp.diff_cleanupEfficiency(diffs) 41 | i = 0 42 | dirty = False 43 | for k, s in diffs: 44 | l = len(s) 45 | if k == 0: 46 | # match 47 | l = len(s) 48 | if ss(i, i + l) != s: 49 | raise MergeException('mismatch', dirty) 50 | i += l 51 | else: 52 | dirty = True 53 | if k > 0: 54 | # insert 55 | view.insert(edit, i, s) 56 | i += l 57 | else: 58 | # delete 59 | if ss(i, i + l) != s: 60 | raise MergeException('mismatch', dirty) 61 | view.erase(edit, sublime.Region(i, i + l)) 62 | return dirty 63 | 64 | 65 | def merge_code(view, edit, code, formatted_code): 66 | vs = view.settings() 67 | ttts = vs.get("translate_tabs_to_spaces") 68 | vs.set("translate_tabs_to_spaces", False) 69 | if not code.strip(): 70 | return (False, '') 71 | 72 | dirty = False 73 | err = '' 74 | try: 75 | dirty = _merge_code(view, edit, code, formatted_code) 76 | except MergeException as exc: 77 | dirty = True 78 | err = "Could not merge changes into the buffer, edit aborted: %s" % exc 79 | view.replace(edit, sublime.Region(0, view.size()), code) 80 | except Exception as ex: 81 | err = "Unknown exception: %s" % ex 82 | finally: 83 | vs.set("translate_tabs_to_spaces", ttts) 84 | return (dirty, err) 85 | -------------------------------------------------------------------------------- /libs/merge_utils.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lightningtgc/sublime-cssorder/3adb47b695a75ebba7b6c11242ec96e9799a7e76/libs/merge_utils.pyc -------------------------------------------------------------------------------- /node_modules/.bin/csscomb: -------------------------------------------------------------------------------- 1 | ../csscomb/bin/csscomb -------------------------------------------------------------------------------- /node_modules/cssorder/README.md: -------------------------------------------------------------------------------- 1 | #CSSOrder 2 | 3 | > A CSS style formatter, make CSS code tidy and order. 4 | 5 | > Base on Node.js and csscomb 6 | 7 | ## Intro 8 | 9 | CSSOrder is a css coding style formatter with [Tencent CSS Style](http://alloyteam.github.io/code-guide/#css) 10 | 11 | It can handle some special case like 'base64 url', 'single comment // ' and so on in CSS files. 12 | 13 | ## Effect 14 | 15 | Make CSS code become the following coding style: 16 | 17 | ```css 18 | /* Final CSS code */ 19 | .some-style, 20 | .same-style { 21 | position: relative; 22 | top: -2px; 23 | right: 0; 24 | bottom: 0; 25 | left: 5px; 26 | z-index: 100; 27 | 28 | display: inline-block; 29 | width: 20px; 30 | height: 20px; 31 | padding: 5px 10px; 32 | overflow: hidden; 33 | 34 | vertical-align: middle; 35 | 36 | color: #fff; 37 | -webkit-border-radius: 5px; 38 | -moz-border-radius: 5px; 39 | border-radius: 5px; 40 | background-color: rgba(82,157,218,.9); 41 | -webkit-background-clip: padding-box; 42 | -moz-background-clip: padding-box; 43 | background-clip: padding-box; 44 | } 45 | 46 | ``` 47 | 48 | ## Install 49 | 50 | ``` 51 | npm install -g cssorder 52 | ``` 53 | 54 | 55 | -------------------------------------------------------------------------------- /node_modules/cssorder/bin/cssorder: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('../src/cli'); 3 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/.bin/csscomb: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | basedir=`dirname "$0"` 3 | 4 | case `uname` in 5 | *CYGWIN*) basedir=`cygpath -w "$basedir"`;; 6 | esac 7 | 8 | if [ -x "$basedir/node" ]; then 9 | "$basedir/node" "$basedir/../csscomb/bin/csscomb" "$@" 10 | ret=$? 11 | else 12 | node "$basedir/../csscomb/bin/csscomb" "$@" 13 | ret=$? 14 | fi 15 | exit $ret 16 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/.bin/csscomb.cmd: -------------------------------------------------------------------------------- 1 | @IF EXIST "%~dp0\node.exe" ( 2 | "%~dp0\node.exe" "%~dp0\..\csscomb\bin\csscomb" %* 3 | ) ELSE ( 4 | @SETLOCAL 5 | @SET PATHEXT=%PATHEXT:;.JS;=;% 6 | node "%~dp0\..\csscomb\bin\csscomb" %* 7 | ) -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/README.md: -------------------------------------------------------------------------------- 1 | # CSScomb [![CSSComb](logo.png)](http://csscomb.com/) 2 | [![Build Status](https://travis-ci.org/csscomb/csscomb.js.svg?branch=master)](http://travis-ci.org/csscomb/csscomb.js) 3 | [![NPM version](https://badge.fury.io/js/csscomb.svg)](http://badge.fury.io/js/csscomb) 4 | [![Dependency Status](https://david-dm.org/csscomb/csscomb.js.svg)](https://david-dm.org/csscomb/csscomb.js) 5 | [![devDependency Status](https://david-dm.org/csscomb/csscomb.js/dev-status.svg)](https://david-dm.org/csscomb/csscomb.js#info=devDependencies) 6 | 7 | CSScomb is a coding style formatter for CSS. 8 | You can easily write your own [configuration](doc/configuration.md) to make 9 | your style sheets beautiful and consistent. 10 | 11 | The main feature is [sorting properties](doc/options.md#sort-order) in a specific order. 12 | It was inspired by [@miripiruni](https://github.com/miripiruni)'s 13 | [PHP-based tool](https://github.com/csscomb/csscomb) of the same name. 14 | This is the new JavaScript version, based on the powerful CSS parser 15 | [Gonzales PE](https://github.com/tonyganch/gonzales-pe). 16 | 17 | ## 1. Install 18 | 19 | Global installation (for use as a command-line tool): 20 | 21 | ```bash 22 | npm install csscomb -g 23 | ``` 24 | 25 | Local installation (for use as a command-line tool within current directory): 26 | 27 | ```bash 28 | npm install csscomb 29 | ``` 30 | 31 | To install as a project dependency (the package will appear in your dependencies): 32 | 33 | ```bash 34 | npm install csscomb --save 35 | ``` 36 | 37 | To install as a dev dependency (the package will appear in your devDependencies): 38 | 39 | ```bash 40 | npm install csscomb --save-dev 41 | ``` 42 | 43 | ## 2. [Configure](doc/configuration.md) 44 | 45 | There are a number of ways to configure CSScomb: 46 | 47 | - Use one of [predefined configs](config) 48 | - Put `.csscomb.json` file in the project root. 49 | - Set path to config's file 50 | - Use `*.css` file as a template 51 | 52 | ## 3. Use 53 | 54 | ### [Command Line](doc/usage-cli.md) 55 | 56 | ```bash 57 | csscomb assets/css 58 | ``` 59 | 60 | ### [Node.js module](doc/usage-node.md) 61 | 62 | ```js 63 | var Comb = require('csscomb'); 64 | var comb = new Comb('zen'); 65 | comb.processPath('assets/css'); 66 | ``` 67 | 68 | ## 4. Contribute 69 | 70 | Anyone and everyone is welcome to contribute. 71 | Please take a moment to review the [guidelines for contributing](CONTRIBUTING.md). 72 | 73 | ## Authors 74 | 75 | [@mishanga](https://github.com/mishanga), 76 | [@tonyganch](https://github.com/tonyganch) 77 | 78 | Thanks for assistance and contributions: 79 | 80 | [@miripiruni](https://github.com/miripiruni), 81 | [@anton-rudeshko](https://github.com/anton-rudeshko), 82 | [@cvrebert](https://github.com/cvrebert), 83 | [@filtercake](https://github.com/filtercake), 84 | [@ignovak](https://github.com/ignovak), 85 | [@kizu](https://github.com/kizu), 86 | [@lefoy](https://github.com/lefoy), 87 | [@L0stSoul](https://github.com/L0stSoul), 88 | [@mishaberezin](https://github.com/mishaberezin), 89 | [@puzankov](https://github.com/puzankov), 90 | [@schneyra](https://github.com/schneyra), 91 | [@thejameskyle](https://github.com/thejameskyle), 92 | [@vecmezoni](https://github.com/vecmezoni) 93 | 94 | ## License 95 | 96 | This software is released under the terms of the 97 | [MIT license](https://github.com/csscomb/csscomb.js/blob/master/LICENSE). 98 | 99 | ## Other projects 100 | * https://github.com/senchalabs/cssbeautify 101 | * https://github.com/css/gonzales 102 | * https://github.com/tonyganch/gonzales-pe 103 | * https://github.com/css/csso 104 | * https://github.com/nzakas/parser-lib 105 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/bin/csscomb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('../lib/cli'); 3 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/cli.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Command line implementation for CSSComb 3 | * 4 | * Usage example: 5 | * ./node_modules/.bin/csscomb [options] file1 [dir1 [fileN [dirN]]] 6 | */ 7 | var fs = require('fs'); 8 | var path = require('path'); 9 | var program = require('commander'); 10 | var vow = require('vow'); 11 | var Comb = require('./csscomb'); 12 | 13 | program 14 | .version(require('../package.json').version) 15 | .usage('[options] ') 16 | .option('-v, --verbose', 'verbose mode') 17 | .option('-c, --config [path]', 'configuration file path') 18 | .option('-d, --detect', 'detect mode (would return detected options)') 19 | .option('-l, --lint', 'in case some fixes needed returns an error') 20 | .parse(process.argv); 21 | 22 | if (!program.args.length) { 23 | console.log('No input paths specified'); 24 | program.help(); 25 | } 26 | 27 | var comb = new Comb(); 28 | 29 | if (program.detect) { 30 | console.log(JSON.stringify(Comb.detectInFile(program.args[0]), false, 4)); 31 | process.exit(0); 32 | } 33 | 34 | var config; 35 | var configPath = program.config && 36 | path.resolve(process.cwd(), program.config) || 37 | Comb.getCustomConfigPath(); 38 | 39 | if (!fs.existsSync(configPath)) { 40 | config = require('../config/csscomb.json'); 41 | } else if (configPath.match(/\.css$/)) { 42 | config = Comb.detectInFile(configPath); 43 | } else { 44 | config = Comb.getCustomConfig(configPath); 45 | } 46 | 47 | if (!config) { 48 | console.log('Configuration file ' + configPath + ' was not found.'); 49 | process.exit(1); 50 | } 51 | 52 | if (config.template) { 53 | if (fs.existsSync(config.template)) { 54 | var templateConfig = Comb.detectInFile(config.template); 55 | for (var attrname in templateConfig) { 56 | if (!config[attrname]) { 57 | config[attrname] = templateConfig[attrname]; 58 | } 59 | } 60 | } else { 61 | console.log('Template configuration file ' + config.template + ' was not found.'); 62 | process.exit(1); 63 | } 64 | } 65 | 66 | console.time('spent'); 67 | 68 | config.verbose = program.verbose === true || config.verbose; 69 | config.lint = program.lint; 70 | 71 | comb.configure(config); 72 | 73 | vow.all(program.args.map(comb.processPath.bind(comb))) 74 | .then(function(changedFiles) { 75 | changedFiles = [].concat.apply([], changedFiles) 76 | .filter(function(isChanged) { 77 | return isChanged !== undefined; 78 | }); 79 | 80 | for (var i = changedFiles.length, tbchanged = 0; i--;) { 81 | tbchanged += changedFiles[i]; 82 | } 83 | 84 | var changed = config.lint ? 0 : tbchanged; 85 | 86 | if (config.verbose) { 87 | console.log(''); 88 | console.log(changedFiles.length + ' file' + (changedFiles.length === 1 ? '' : 's') + ' processed'); 89 | console.log(changed + ' file' + (changed === 1 ? '' : 's') + ' fixed'); 90 | console.timeEnd('spent'); 91 | } 92 | 93 | if (config.lint && tbchanged) { 94 | process.exit(1); 95 | } 96 | }) 97 | .fail(function(e) { 98 | console.log('stack: ', e.stack); 99 | process.exit(1); 100 | }); 101 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/always-semicolon.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'always-semicolon', 3 | 4 | syntax: ['css', 'less', 'sass', 'scss'], 5 | 6 | accepts: { boolean: [true] }, 7 | 8 | /** 9 | * Processes tree node. 10 | * @param {String} nodeType 11 | * @param {node} node 12 | */ 13 | process: function(nodeType, node) { 14 | if (nodeType === 'block') { 15 | for (var i = node.length; i--;) { 16 | var currentNode = node[i]; 17 | var currentNodeType = currentNode[0]; 18 | var nodeWithoutSemicolon; 19 | 20 | // Skip nodes that already have `;` at the end: 21 | if (currentNodeType === 'declDelim') break; 22 | 23 | // Add semicolon only after declarations and includes. 24 | // If current node is include, insert semicolon right into it. 25 | // If it's declaration, look for value node: 26 | if (currentNodeType === 'include') { 27 | nodeWithoutSemicolon = currentNode; 28 | } else if (currentNodeType === 'declaration') { 29 | for (var k = currentNode.length; k--;) { 30 | if (currentNode[k][0] === 'value') { 31 | nodeWithoutSemicolon = currentNode[k]; 32 | break; 33 | } 34 | } 35 | } else { 36 | continue; 37 | } 38 | 39 | var space = []; 40 | var isBlock = false; 41 | 42 | // Check if there are spaces and comments at the end of the node: 43 | for (var j = nodeWithoutSemicolon.length; j--;) { 44 | var lastNode = nodeWithoutSemicolon[j][0]; 45 | // If the node's last child is block, do not add semicolon: 46 | // TODO: Add syntax check and run the code only for scss 47 | if (lastNode === 'block') { 48 | isBlock = true; 49 | break; 50 | } else if (['s', 'commentML', 'commentSL'].indexOf(lastNode) === -1) break; 51 | 52 | space.unshift(nodeWithoutSemicolon[j]); 53 | } 54 | 55 | if (isBlock) break; 56 | 57 | // Temporarily remove last spaces and comments and insert `;` 58 | // before them: 59 | nodeWithoutSemicolon.splice(nodeWithoutSemicolon.length - space.length); 60 | node.splice.apply(node, [i + 1, 0, ['declDelim']].concat(space)); 61 | break; 62 | } 63 | } 64 | }, 65 | 66 | /** 67 | * Detects the value of an option at the tree node. 68 | * 69 | * @param {String} nodeType 70 | * @param {node} node 71 | */ 72 | detect: function(nodeType, node) { 73 | if (nodeType === 'block') { 74 | for (var i = node.length; i--;) { 75 | var nodeItem = node[i]; 76 | var type = nodeItem[0]; 77 | if (type === 'declDelim') return true; 78 | 79 | if (type === 'declaration') return false; 80 | } 81 | } 82 | } 83 | }; 84 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/block-indent.js: -------------------------------------------------------------------------------- 1 | module.exports = (function() { 2 | function processStylesheet(node) { 3 | var spaces; 4 | var whitespaceNode; 5 | var i; 6 | 7 | for (i = node.length; i--;) { 8 | whitespaceNode = node[i]; 9 | 10 | if (whitespaceNode[0] !== 's') continue; 11 | 12 | spaces = whitespaceNode[1].replace(/\n[ \t]+/gm, '\n'); 13 | 14 | if (spaces === '') { 15 | node.splice(i, 1); 16 | } else { 17 | whitespaceNode[1] = spaces; 18 | } 19 | } 20 | } 21 | 22 | function processSassBlock(node, level, value) { 23 | var spaces; 24 | var whitespaceNode; 25 | var i; 26 | 27 | for (i = node.length; i--;) { 28 | whitespaceNode = node[i]; 29 | 30 | if (whitespaceNode[0] !== 's') continue; 31 | 32 | if (whitespaceNode[1] === '\n') continue; 33 | 34 | spaces = whitespaceNode[1].replace(/[ \t]/gm, ''); 35 | spaces += new Array(level + 2).join(value); 36 | whitespaceNode[1] = spaces; 37 | } 38 | } 39 | 40 | function processSpaceNode(node, level, value) { 41 | var spaces; 42 | 43 | // Remove all whitespaces and tabs, leave only new lines: 44 | spaces = node[0].replace(/[ \t]/gm, ''); 45 | 46 | if (!spaces) return; 47 | 48 | spaces += new Array(level + 1).join(value); 49 | node[0] = spaces; 50 | } 51 | 52 | return { 53 | name: 'block-indent', 54 | 55 | runBefore: 'sort-order', 56 | 57 | syntax: ['css', 'less', 'sass', 'scss'], 58 | 59 | accepts: { 60 | number: true, 61 | string: /^[ \t]*$/ 62 | }, 63 | 64 | /** 65 | * Processes tree node. 66 | * 67 | * @param {String} nodeType 68 | * @param {node} node 69 | * @param {Number} level 70 | */ 71 | process: function process(nodeType, node, level) { 72 | var syntax = this.getSyntax(); 73 | var value = this.getValue('block-indent'); 74 | 75 | if (nodeType === 'stylesheet') { 76 | return processStylesheet(node); 77 | } 78 | 79 | if (syntax === 'sass' && nodeType === 'block') { 80 | return processSassBlock(node, level, value); 81 | } 82 | 83 | // Continue only with space nodes inside {...}: 84 | if (syntax !== 'sass' && level !== 0 && nodeType === 's') { 85 | processSpaceNode(node, level, value); 86 | } 87 | }, 88 | 89 | /** 90 | * Detects the value of an option at the tree node. 91 | * 92 | * @param {String} nodeType 93 | * @param {node} node 94 | * @param {Number} level 95 | */ 96 | detect: function(nodeType, node, level) { 97 | var result = []; 98 | 99 | // Continue only with non-empty {...} blocks: 100 | if (nodeType !== 'atrulers' && nodeType !== 'block' || !node.length) return; 101 | 102 | for (var i = node.length; i--;) { 103 | var whitespaceNode = node[i]; 104 | if (whitespaceNode[0] !== 's') continue; 105 | 106 | var spaces = whitespaceNode[1]; 107 | var lastIndex = spaces.lastIndexOf('\n'); 108 | 109 | // Do not continue if there is no line break: 110 | if (lastIndex < 0) continue; 111 | 112 | // Number of spaces from beginning of line: 113 | var spacesLength = spaces.slice(lastIndex + 1).length; 114 | var arrayLength = Math.floor(spacesLength / (level + 1)) + 1; 115 | result.push(new Array(arrayLength).join(' ')); 116 | } 117 | 118 | return result; 119 | } 120 | }; 121 | })(); 122 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/color-case.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'color-case', 3 | 4 | syntax: ['css', 'less', 'sass', 'scss'], 5 | 6 | accepts: { string: /^lower|upper$/ }, 7 | 8 | /** 9 | * Processes tree node. 10 | * @param {String} nodeType 11 | * @param {node} node 12 | */ 13 | process: function(nodeType, node) { 14 | var value = this.getValue('color-case'); 15 | if (nodeType === 'vhash') { 16 | if (value === 'lower') { 17 | node[0] = node[0].toLowerCase(); 18 | } else if (value === 'upper') { 19 | node[0] = node[0].toUpperCase(); 20 | } 21 | } 22 | }, 23 | 24 | /** 25 | * Detects the value of an option at the tree node. 26 | * 27 | * @param {String} nodeType 28 | * @param {node} node 29 | */ 30 | detect: function(nodeType, node) { 31 | if (nodeType === 'vhash') { 32 | if (node[0].match(/^[^A-F]*[a-f][^A-F]*$/)) { 33 | return 'lower'; 34 | } else if (node[0].match(/^[^a-f]*[A-F][^a-f]*$/)) { 35 | return 'upper'; 36 | } 37 | } 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/color-shorthand.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'color-shorthand', 3 | 4 | syntax: ['css', 'less', 'sass', 'scss'], 5 | 6 | accepts: { boolean: [true, false] }, 7 | 8 | /** 9 | * Processes tree node. 10 | * @param {String} nodeType 11 | * @param {node} node 12 | */ 13 | process: function(nodeType, node) { 14 | if (nodeType === 'vhash') { 15 | if (this.getValue('color-shorthand')) { 16 | node[0] = node[0].replace(/(\w)\1(\w)\2(\w)\3/i, '$1$2$3'); 17 | } else { 18 | node[0] = node[0].replace(/^(\w)(\w)(\w)$/, '$1$1$2$2$3$3'); 19 | } 20 | } 21 | }, 22 | 23 | /** 24 | * Detects the value of an option at the tree node. 25 | * 26 | * @param {String} nodeType 27 | * @param {node} node 28 | */ 29 | detect: function(nodeType, node) { 30 | if (nodeType === 'vhash') { 31 | if (node[0].match(/^\w{3}$/)) { 32 | return true; 33 | } else if (node[0].match(/^(\w)\1(\w)\2(\w)\3$/)) { 34 | return false; 35 | } 36 | } 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/element-case.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'element-case', 3 | 4 | syntax: ['css', 'less', 'sass', 'scss'], 5 | 6 | accepts: { string: /^lower|upper$/ }, 7 | 8 | /** 9 | * Processes tree node. 10 | * @param {String} nodeType 11 | * @param {node} node 12 | */ 13 | process: function(nodeType, node) { 14 | if (nodeType !== 'selector' && 15 | nodeType !== 'arguments') return; 16 | 17 | for (var x = node.length; x--;) { 18 | var selector = node[x]; 19 | if (selector[0] !== 'simpleselector') continue; 20 | 21 | for (var i = selector.length; i--;) { 22 | var simpleselector = selector[i]; 23 | if (!Array.isArray(simpleselector) || 24 | simpleselector[0] !== 'ident') continue; 25 | 26 | simpleselector[1] = this.getValue('element-case') === 'lower' ? 27 | simpleselector[1].toLowerCase() : 28 | simpleselector[1].toUpperCase(); 29 | } 30 | } 31 | }, 32 | 33 | /** 34 | * Detects the value of an option at the tree node. 35 | * 36 | * @param {String} nodeType 37 | * @param {node} node 38 | */ 39 | detect: function(nodeType, node) { 40 | if (nodeType !== 'simpleselector') return; 41 | 42 | var variants = []; 43 | for (var i = node.length; i--;) { 44 | var nodeItem = node[i]; 45 | if (nodeItem[0] !== 'ident') continue; 46 | if (nodeItem[1].match(/^[a-z]+$/)) { 47 | variants.push('lower'); 48 | } else if (nodeItem[1].match(/^[A-Z]+$/)) { 49 | variants.push('upper'); 50 | } 51 | } 52 | return variants; 53 | } 54 | }; 55 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/eof-newline.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'eof-newline', 3 | 4 | syntax: ['css', 'less', 'sass', 'scss'], 5 | 6 | accepts: { boolean: [true, false] }, 7 | 8 | /** 9 | * Processes tree node. 10 | * @param {String} nodeType 11 | * @param {node} node 12 | */ 13 | process: function(nodeType, node) { 14 | if (nodeType === 'stylesheet') { 15 | var lastChild = node[node.length - 1]; 16 | if (lastChild[0] !== 's') { 17 | lastChild = ['s', '']; 18 | node.push(lastChild); 19 | } 20 | lastChild[1] = lastChild[1].replace(/\n$/, ''); 21 | if (this.getValue('eof-newline')) lastChild[1] += '\n'; 22 | } 23 | }, 24 | 25 | /** 26 | * Detects the value of an option at the tree node. 27 | * 28 | * @param {String} nodeType 29 | * @param {node} node 30 | */ 31 | detect: function(nodeType, node) { 32 | if (nodeType === 'stylesheet') { 33 | if (node[node.length - 1][0] === 's' && node[node.length - 1][1].indexOf('\n') !== -1) { 34 | return true; 35 | } else { 36 | return false; 37 | } 38 | } 39 | } 40 | }; 41 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/leading-zero.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'leading-zero', 3 | 4 | syntax: ['css', 'less', 'sass', 'scss'], 5 | 6 | accepts: { boolean: [true, false] }, 7 | 8 | /** 9 | * Processes tree node. 10 | * @param {String} nodeType 11 | * @param {node} node 12 | */ 13 | process: function(nodeType, node) { 14 | if (nodeType === 'number') { 15 | if (this.getValue('leading-zero')) { 16 | if (node[0][0] === '.') 17 | node[0] = '0' + node[0]; 18 | } else { 19 | node[0] = node[0].replace(/^0+(?=\.)/, ''); 20 | } 21 | } 22 | }, 23 | 24 | /** 25 | * Detects the value of an option at the tree node. 26 | * 27 | * @param {String} nodeType 28 | * @param {node} node 29 | */ 30 | detect: function(nodeType, node) { 31 | if (nodeType === 'number') { 32 | if (node.toString().match(/^\.[0-9]+/)) { 33 | return false; 34 | } else if (node.toString().match(/^0\.[0-9]+/)) { 35 | return true; 36 | } 37 | } 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/quotes.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'quotes', 3 | 4 | syntax: ['css', 'less', 'sass', 'scss'], 5 | 6 | accepts: { string: /^single|double$/ }, 7 | 8 | /** 9 | * Processes tree node. 10 | * @param {String} nodeType 11 | * @param {node} node 12 | */ 13 | process: function(nodeType, node) { 14 | var value = this.getValue('quotes'); 15 | if (nodeType === 'string') { 16 | if (node[0][0] === '"' && value === 'single') { 17 | node[0] = node[0] 18 | .replace(/\\"/g, '"') // unescape all escaped double quotes 19 | .replace(/([^\\])'/g, '$1\\\'') // escape all the single quotes 20 | .replace(/^"|"$/g, '\''); // replace the first and the last quote 21 | 22 | } else if (node[0][0] === '\'' && value === 'double') { 23 | node[0] = node[0] 24 | .replace(/\\'/g, '\'') // unescape all escaped single quotes 25 | .replace(/([^\\])"/g, '$1\\\"') // escape all the double quotes 26 | .replace(/^'|'$/g, '"'); // replace the first and the last quote 27 | } 28 | } 29 | }, 30 | 31 | /** 32 | * Detects the value of an option at the tree node. 33 | * 34 | * @param {String} nodeType 35 | * @param {node} node 36 | */ 37 | detect: function(nodeType, node) { 38 | if (nodeType === 'string') { 39 | if (node[0][0] === '"') { 40 | return 'double'; 41 | } else if (node[0][0] === '\'') { 42 | return 'single'; 43 | } 44 | } 45 | } 46 | }; 47 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/remove-empty-rulesets.js: -------------------------------------------------------------------------------- 1 | module.exports = (function() { 2 | function processStylesheetContent(nodeContent) { 3 | removeEmptyRulesets(nodeContent); 4 | mergeAdjacentWhitespace(nodeContent); 5 | } 6 | 7 | function removeEmptyRulesets(nodeContent) { 8 | var i = nodeContent.length; 9 | // Loop through node and try to find a ruleset: 10 | while (i--) { 11 | var node = nodeContent[i]; 12 | if (!isRuleset(node)) continue; 13 | // If a ruleset is found, try to find its nested rulesets and remove 14 | // all empty ones: 15 | var j = node.length; 16 | while (j--) { 17 | // Nested rulesets are located inside blocks, that's why look 18 | // for blocks only: 19 | var blockNode = node[j]; 20 | if (blockNode[0] !== 'block') continue; 21 | blockNode.shift(); 22 | processStylesheetContent(blockNode); 23 | blockNode.unshift('block'); 24 | node[j] = blockNode; 25 | } 26 | // If after removing all empty nested rulesets the parent has also 27 | // become empty, remove it too: 28 | if (isEmptyRuleset(node)) { 29 | nodeContent.splice(i, 1); 30 | } 31 | } 32 | } 33 | 34 | /** 35 | * Removing ruleset nodes from tree may result in two adjacent whitespace nodes which is not correct AST: 36 | * [space, ruleset, space] => [space, space] 37 | * To ensure correctness of further processing we should merge such nodes into one. 38 | * [space, space] => [space] 39 | */ 40 | function mergeAdjacentWhitespace(nodeContent) { 41 | var i = nodeContent.length - 1; 42 | while (i-- > 0) { 43 | if (isWhitespace(nodeContent[i]) && isWhitespace(nodeContent[i + 1])) { 44 | nodeContent[i][1] += nodeContent[i + 1][1]; 45 | nodeContent.splice(i + 1, 1); 46 | } 47 | } 48 | } 49 | 50 | function isEmptyRuleset(ruleset) { 51 | return ruleset.filter(isBlock).every(isEmptyBlock, this); 52 | } 53 | 54 | /** 55 | * Block is considered empty when it has nothing but spaces. 56 | */ 57 | function isEmptyBlock(node) { 58 | return node.length === 1 || !node.some(isNotWhitespace); 59 | } 60 | 61 | function isRuleset(node) { 62 | return node[0] === 'ruleset'; 63 | } 64 | 65 | function isBlock(node) { 66 | return node[0] === 'block'; 67 | } 68 | 69 | function isWhitespace(node) { 70 | return node[0] === 's'; 71 | } 72 | 73 | function isNotWhitespace(node) { 74 | return typeof node === 'object' && node[0] !== 's'; 75 | } 76 | 77 | return { 78 | name: 'remove-empty-rulesets', 79 | 80 | runBefore: 'block-indent', 81 | 82 | syntax: ['css', 'less', 'sass', 'scss'], 83 | 84 | accepts: { boolean: [true] }, 85 | 86 | /** 87 | * Remove rulesets with no declarations. 88 | * 89 | * @param {String} nodeType 90 | * @param {Array} nodeContent 91 | */ 92 | process: function(nodeType, nodeContent) { 93 | if (nodeType === 'stylesheet') { 94 | processStylesheetContent(nodeContent); 95 | } 96 | }, 97 | 98 | /** 99 | * Detects the value of an option at the tree node. 100 | * This option is treated as `true` by default, but any trailing space would invalidate it. 101 | * 102 | * @param {String} nodeType 103 | * @param {node} node 104 | */ 105 | detectDefault: true, 106 | 107 | detect: function(nodeType, node) { 108 | if (nodeType === 'atrulers' || nodeType === 'block') { 109 | if (node.length === 0 || (node.length === 1 && node[0][0] === 's')) { 110 | return false; 111 | } 112 | } 113 | } 114 | }; 115 | })(); 116 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/sort-order-fallback.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'sort-order-fallback', 3 | 4 | syntax: ['css', 'less', 'sass', 'scss'], 5 | 6 | accepts: { string: /^abc$/ }, 7 | 8 | process: function() {} 9 | }; 10 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/space-after-colon.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'space-after-colon', 3 | 4 | runBefore: 'block-indent', 5 | 6 | syntax: ['css', 'less', 'sass', 'scss'], 7 | 8 | accepts: { 9 | number: true, 10 | string: /^[ \t\n]*$/ 11 | }, 12 | 13 | /** 14 | * Processes tree node. 15 | * 16 | * @param {String} nodeType 17 | * @param {node} node 18 | */ 19 | process: function(nodeType, node) { 20 | if (nodeType !== 'declaration') return; 21 | 22 | var value = this.getValue('space-after-colon'); 23 | 24 | for (var i = node.length; i--;) { 25 | if (node[i][0] !== 'propertyDelim') continue; 26 | 27 | if (this.getSyntax() === 'sass' && !node[i - 1]) break; 28 | 29 | // Remove any spaces after colon: 30 | if (node[i + 1][0] === 's') node.splice(i + 1, 1); 31 | // If the value set in config is not empty, add spaces: 32 | if (value !== '') node.splice(i + 1, 0, ['s', value]); 33 | 34 | break; 35 | } 36 | }, 37 | 38 | /** 39 | * Detects the value of an option at the tree node. 40 | * 41 | * @param {String} nodeType 42 | * @param {node} node 43 | */ 44 | detect: function(nodeType, node) { 45 | if (nodeType !== 'declaration') return; 46 | 47 | for (var i = node.length; i--;) { 48 | if (node[i][0] !== 'propertyDelim') continue; 49 | 50 | if (node[i + 1][0] === 's') { 51 | return node[i + 1][1]; 52 | } else { 53 | return ''; 54 | } 55 | } 56 | } 57 | }; 58 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/space-after-combinator.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'space-after-combinator', 3 | 4 | runBefore: 'block-indent', 5 | 6 | syntax: ['css', 'less', 'sass', 'scss'], 7 | 8 | accepts: { 9 | number: true, 10 | string: /^[ \t\n]*$/ 11 | }, 12 | 13 | /** 14 | * Processes tree node. 15 | * 16 | * @param {String} nodeType 17 | * @param {node} node 18 | */ 19 | process: function(nodeType, node) { 20 | if (nodeType !== 'selector') return; 21 | 22 | var value = this.getValue('space-after-combinator'); 23 | 24 | for (var i = node.length; i--;) { 25 | var subSelector = node[i]; 26 | for (var j = subSelector.length; j--;) { 27 | if (subSelector[j][0] !== 'combinator') continue; 28 | 29 | if (subSelector[j + 1][0] === 's') { 30 | subSelector[j + 1][1] = value; 31 | } else { 32 | subSelector.splice(j + 1, 0, ['s', value]); 33 | } 34 | } 35 | } 36 | }, 37 | 38 | /** 39 | * Detects the value of an option at the tree node. 40 | * 41 | * @param {String} nodeType 42 | * @param {node} node 43 | */ 44 | detect: function(nodeType, node) { 45 | if (nodeType !== 'selector') return; 46 | 47 | var variants = []; 48 | 49 | for (var i = node.length; i--;) { 50 | var subSelector = node[i]; 51 | for (var j = subSelector.length; j--;) { 52 | if (subSelector[j][0] !== 'combinator') continue; 53 | 54 | if (subSelector[j + 1][0] === 's') { 55 | variants.push(subSelector[j + 1][1]); 56 | } else { 57 | variants.push(''); 58 | } 59 | } 60 | } 61 | 62 | return variants; 63 | } 64 | }; 65 | 66 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/space-after-opening-brace.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'space-after-opening-brace', 3 | 4 | runBefore: 'block-indent', 5 | 6 | syntax: ['css', 'less', 'scss'], 7 | 8 | accepts: { 9 | number: true, 10 | string: /^[ \t\n]*$/ 11 | }, 12 | 13 | /** 14 | * Processes tree node. 15 | * 16 | * @param {String} nodeType 17 | * @param {node} node 18 | */ 19 | process: function(nodeType, node) { 20 | // If found block node stop at the next one for space check 21 | if (nodeType !== 'block' && nodeType !== 'atrulers') return; 22 | 23 | var value = this.getValue('space-after-opening-brace'); 24 | 25 | if (node[0][0] === 's') { 26 | node[0][1] = value; 27 | } else if (value !== '') { 28 | node.unshift(['s', value]); 29 | } 30 | }, 31 | 32 | /** 33 | * Detects the value of an option at the tree node. 34 | * 35 | * @param {String} nodeType 36 | * @param {node} node 37 | */ 38 | detect: function(nodeType, node) { 39 | if (nodeType !== 'block' && nodeType !== 'atrulers') return; 40 | 41 | if (node[0][0] === 's') { 42 | return node[0][1]; 43 | } else { 44 | return ''; 45 | } 46 | } 47 | }; 48 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/space-after-selector-delimiter.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'space-after-selector-delimiter', 3 | 4 | runBefore: 'block-indent', 5 | 6 | syntax: ['css', 'less', 'sass', 'scss'], 7 | 8 | accepts: { 9 | number: true, 10 | string: /^[ \t\n]*$/ 11 | }, 12 | 13 | /** 14 | * Processes tree node. 15 | * 16 | * @param {String} nodeType 17 | * @param {node} node 18 | */ 19 | process: function(nodeType, node) { 20 | if (nodeType !== 'selector') return; 21 | 22 | var value = this.getValue('space-after-selector-delimiter'); 23 | 24 | for (var i = node.length; i--;) { 25 | if (node[i][0] !== 'delim') continue; 26 | 27 | if (node[i + 1][0] === 's') { 28 | node[i + 1][1] = value; 29 | } else if (node[i + 1][1][0] === 's') { 30 | node[i + 1][1][1] = value; 31 | } else { 32 | node[i + 1].splice(1, 0, ['s', value]); 33 | } 34 | } 35 | }, 36 | 37 | /** 38 | * Detects the value of an option at the tree node. 39 | * 40 | * @param {String} nodeType 41 | * @param {node} node 42 | */ 43 | detect: function(nodeType, node) { 44 | if (nodeType !== 'selector') return; 45 | 46 | var variants = []; 47 | 48 | for (var i = node.length; i--;) { 49 | if (node[i][0] !== 'delim') continue; 50 | 51 | if (node[i + 1][1][0] === 's') { 52 | variants.push(node[i + 1][1][1]); 53 | } else { 54 | variants.push(''); 55 | } 56 | } 57 | 58 | return variants; 59 | } 60 | }; 61 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/space-before-closing-brace.js: -------------------------------------------------------------------------------- 1 | module.exports = (function() { 2 | function getLastWhitespaceNode(node) { 3 | var lastNode = node[node.length - 1]; 4 | 5 | if (typeof lastNode !== 'object' || lastNode[0] === 'block') return null; 6 | if (lastNode[0] === 's') return lastNode; 7 | 8 | return getLastWhitespaceNode(lastNode); 9 | } 10 | 11 | return { 12 | name: 'space-before-closing-brace', 13 | 14 | runBefore: 'tab-size', 15 | 16 | syntax: ['css', 'less', 'scss'], 17 | 18 | accepts: { 19 | number: true, 20 | string: /^[ \t\n]*$/ 21 | }, 22 | 23 | /** 24 | * Processes tree node. 25 | * @param {String} nodeType 26 | * @param {node} node 27 | * @param {Number} level 28 | */ 29 | process: function(nodeType, node, level) { 30 | if (nodeType !== 'block' && nodeType !== 'atrulers') return; 31 | 32 | var value = this.getValue('space-before-closing-brace'); 33 | 34 | // If found block node stop at the next one for space check 35 | // For the pre-block node, find its last (the deepest) child 36 | var whitespaceNode = getLastWhitespaceNode(node); 37 | 38 | if (value.indexOf('\n') > -1) { 39 | var blockIndent = this.getValue('block-indent'); 40 | // TODO: Check that it works for '' block indent value 41 | if (blockIndent) value += new Array(level + 1).join(blockIndent); 42 | } 43 | 44 | // If it's spaces, modify this node 45 | // If it's something different from spaces, add a space node to the end 46 | 47 | if (whitespaceNode) { 48 | whitespaceNode[1] = value; 49 | } else if (value !== '') { 50 | node.push(['s', value]); 51 | } 52 | }, 53 | 54 | /** 55 | * Detects the value of an option at the tree node. 56 | * 57 | * @param {String} nodeType 58 | * @param {node} node 59 | */ 60 | detect: function(nodeType, node) { 61 | var variants = []; 62 | 63 | // Loop through node from the end to the beginning: 64 | for (var i = node.length; i--;) { 65 | // If found block node stop for space check: 66 | if (node[i][0] !== 'block' && node[i][0] !== 'atrulers') continue; 67 | 68 | // For the block node, find its last (the deepest) child 69 | var whitespaceNode = getLastWhitespaceNode(node[i]); 70 | 71 | if (whitespaceNode) { 72 | variants.push(whitespaceNode[1]); 73 | } else { 74 | variants.push(''); 75 | } 76 | } 77 | 78 | return variants; 79 | } 80 | }; 81 | })(); 82 | 83 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/space-before-colon.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'space-before-colon', 3 | 4 | runBefore: 'block-indent', 5 | 6 | syntax: ['css', 'less', 'sass', 'scss'], 7 | 8 | accepts: { 9 | number: true, 10 | string: /^[ \t\n]*$/ 11 | }, 12 | 13 | /** 14 | * Processes tree node. 15 | * 16 | * @param {String} nodeType 17 | * @param {node} node 18 | */ 19 | process: function(nodeType, node) { 20 | if (nodeType !== 'declaration') return; 21 | 22 | var value = this.getValue('space-before-colon'); 23 | 24 | for (var i = node.length; i--;) { 25 | if (node[i][0] !== 'propertyDelim') continue; 26 | 27 | if (this.getSyntax() === 'sass' && !node[i - 1]) break; 28 | 29 | // Remove any spaces before colon: 30 | if (node[i - 1][0] === 's') { 31 | node.splice(i - 1, 1); 32 | i--; 33 | } 34 | // If the value set in config is not empty, add spaces: 35 | if (value !== '') node.splice(i, 0, ['s', value]); 36 | 37 | break; 38 | } 39 | }, 40 | 41 | /** 42 | * Detects the value of an option at the tree node. 43 | * 44 | * @param {String} nodeType 45 | * @param {node} node 46 | */ 47 | detect: function(nodeType, node) { 48 | if (nodeType !== 'declaration') return; 49 | 50 | for (var i = node.length; i--;) { 51 | if (node[i][0] !== 'propertyDelim') continue; 52 | 53 | if (node[i - 1][0] === 's') { 54 | return node[i - 1][1]; 55 | } else { 56 | return ''; 57 | } 58 | } 59 | } 60 | }; 61 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/space-before-combinator.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'space-before-combinator', 3 | 4 | runBefore: 'block-indent', 5 | 6 | syntax: ['css', 'less', 'sass', 'scss'], 7 | 8 | accepts: { 9 | number: true, 10 | string: /^[ \t\n]*$/ 11 | }, 12 | 13 | /** 14 | * Processes tree node. 15 | * 16 | * @param {String} nodeType 17 | * @param {node} node 18 | */ 19 | process: function(nodeType, node) { 20 | if (nodeType !== 'selector') return; 21 | 22 | var value = this.getValue('space-before-combinator'); 23 | 24 | for (var i = node.length; i--;) { 25 | var subSelector = node[i]; 26 | for (var j = subSelector.length; j--;) { 27 | if (subSelector[j][0] !== 'combinator') continue; 28 | if (subSelector[j - 1][0] === 's') { 29 | subSelector[j - 1][1] = value; 30 | } else { 31 | subSelector.splice(j, 0, ['s', value]); 32 | } 33 | } 34 | } 35 | }, 36 | 37 | /** 38 | * Detects the value of an option at the tree node. 39 | * 40 | * @param {String} nodeType 41 | * @param {node} node 42 | */ 43 | detect: function(nodeType, node) { 44 | if (nodeType !== 'selector') return; 45 | 46 | var variants = []; 47 | 48 | for (var i = node.length; i--;) { 49 | var subSelector = node[i]; 50 | for (var j = subSelector.length; j--;) { 51 | if (subSelector[j][0] !== 'combinator') continue; 52 | 53 | if (subSelector[j - 1][0] === 's') { 54 | variants.push(subSelector[j - 1][1]); 55 | } else { 56 | variants.push(''); 57 | } 58 | } 59 | } 60 | 61 | return variants; 62 | } 63 | }; 64 | 65 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/space-before-opening-brace.js: -------------------------------------------------------------------------------- 1 | module.exports = (function() { 2 | /** 3 | * Gets the last (the deepest) whitespace node. 4 | * 5 | * @param {node} node 6 | * @returns {node|undefined} If no whitespace node is found, returns 7 | * `undefined` 8 | */ 9 | function getLastWhitespaceNode(node) { 10 | if (typeof node !== 'object') return; 11 | if (node[0] === 's') return node; 12 | 13 | return getLastWhitespaceNode(node[node.length - 1]); 14 | } 15 | 16 | return { 17 | name: 'space-before-opening-brace', 18 | 19 | runBefore: 'block-indent', 20 | 21 | syntax: ['css', 'less', 'scss'], 22 | 23 | accepts: { 24 | number: true, 25 | string: /^[ \t\n]*$/ 26 | }, 27 | 28 | /** 29 | * Processes tree node. 30 | * 31 | * @param {String} nodeType 32 | * @param {node} node 33 | */ 34 | process: function(nodeType, node) { 35 | var value = this.getValue('space-before-opening-brace'); 36 | 37 | // Loop through node from the end to the beginning: 38 | for (var i = node.length; i--;) { 39 | // If found block node stop at the next one for space check: 40 | if (node[i][0] !== 'block' && node[i][0] !== 'atrulers') continue; 41 | 42 | // For the pre-block node, find its last (the deepest) child: 43 | // TODO: Exclude nodes with braces (for example, arguments) 44 | var whitespaceNode = getLastWhitespaceNode(node[i - 1]); 45 | 46 | // If it's spaces, modify this node. 47 | // If it's something different from spaces, add a space node to 48 | // the end: 49 | if (whitespaceNode) { 50 | whitespaceNode[1] = value; 51 | } else if (value !== '') { 52 | if (node[i - 1][0] === 'atrulerq') { 53 | node[i - 1].push(['s', value]); 54 | } else { 55 | node.splice(i, 0, ['s', value]); 56 | } 57 | } 58 | } 59 | }, 60 | 61 | /** 62 | * Detects the value of an option at the tree node. 63 | * 64 | * @param {String} nodeType 65 | * @param {node} node 66 | */ 67 | detect: function(nodeType, node) { 68 | var variants = []; 69 | 70 | // Loop through node from the end to the beginning: 71 | for (var i = node.length; i--;) { 72 | // If found block node stop at the next one for space check: 73 | if (node[i][0] !== 'block' && node[i][0] !== 'atrulers') continue; 74 | 75 | // For the pre-block node, find its last (the deepest) child 76 | var whitespaceNode = getLastWhitespaceNode(node[i - 1]); 77 | 78 | if (whitespaceNode) { 79 | variants.push(whitespaceNode[1]); 80 | } else { 81 | variants.push(''); 82 | } 83 | } 84 | 85 | return variants; 86 | } 87 | }; 88 | })(); 89 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/space-before-selector-delimiter.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'space-before-selector-delimiter', 3 | 4 | runBefore: 'block-indent', 5 | 6 | syntax: ['css', 'less', 'sass', 'scss'], 7 | 8 | accepts: { 9 | number: true, 10 | string: /^[ \t\n]*$/ 11 | }, 12 | 13 | /** 14 | * Processes tree node. 15 | * 16 | * @param {String} nodeType 17 | * @param {node} node 18 | */ 19 | process: function(nodeType, node) { 20 | if (nodeType !== 'selector') return; 21 | 22 | var value = this.getValue('space-before-selector-delimiter'); 23 | 24 | for (var i = node.length; i--;) { 25 | if (node[i][0] !== 'delim') continue; 26 | 27 | var previousNode = node[i - 1]; 28 | if (previousNode[previousNode.length - 1][0] === 's') { 29 | previousNode[previousNode.length - 1][1] = value; 30 | } else { 31 | previousNode.push(['s', value]); 32 | } 33 | } 34 | }, 35 | 36 | /** 37 | * Detects the value of an option at the tree node. 38 | * 39 | * @param {String} nodeType 40 | * @param {node} node 41 | */ 42 | detect: function(nodeType, node) { 43 | if (nodeType !== 'selector') return; 44 | 45 | var variants = []; 46 | 47 | for (var i = node.length; i--;) { 48 | if (node[i][0] !== 'delim') continue; 49 | 50 | var previousNode = node[i - 1]; 51 | if (previousNode[previousNode.length - 1][0] === 's') { 52 | variants.push(previousNode[previousNode.length - 1][1]); 53 | } else { 54 | variants.push(''); 55 | } 56 | } 57 | 58 | return variants; 59 | } 60 | }; 61 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/space-between-declarations.js: -------------------------------------------------------------------------------- 1 | module.exports = (function() { 2 | function getDeclarationEnd(node, i) { 3 | for (;i < node.length; i++) { 4 | if (!node[i + 1]) { 5 | return 0; 6 | } else if (node[i + 1][0] === 's') { 7 | if (node[i + 1][1].indexOf('\n') > -1) { 8 | if (node[i + 2] && node[i + 2][0] === 'declaration') { 9 | return i; 10 | } else { 11 | return 0; 12 | } 13 | } else if (node[i + 2] && node[i + 2][0] === 'commentML') { 14 | if (node[i + 3] && node[i + 3][0] === 'declaration') { 15 | return i + 2; 16 | } else if (node[i + 3] && node[i + 3][0] === 's') { 17 | if (node[i + 4] && node[i + 4][0] === 'declaration') { 18 | return i + 2; 19 | } else { 20 | return 0; 21 | } 22 | } else { 23 | return 0; 24 | } 25 | } else if (node[i + 2] && node[i + 2][0] === 'declaration') { 26 | return i; 27 | } 28 | } else if (node[i + 1][0] === 'declaration') { 29 | return i; 30 | } else if (node[i + 1][0] === 'commentML') { 31 | if (node[i + 2] && node[i + 2][0] === 'declaration') { 32 | return i + 1; 33 | } else if (node[i + 2] && node[i + 2][0] === 's') { 34 | if (node[i + 3] && node[i + 3][0] === 'declaration') { 35 | return i + 1; 36 | } 37 | } else { 38 | return 0; 39 | } 40 | } else { 41 | return 0; 42 | } 43 | } 44 | } 45 | 46 | return { 47 | name: 'space-between-declarations', 48 | 49 | runBefore: 'block-indent', 50 | 51 | syntax: ['css', 'less', 'scss'], 52 | 53 | accepts: { 54 | number: true, 55 | string: /^[ \t\n]*$/ 56 | }, 57 | 58 | /** 59 | * Processes tree node. 60 | * 61 | * @param {String} nodeType 62 | * @param {node} node 63 | */ 64 | process: function(nodeType, node) { 65 | var value = this.getValue('space-between-declarations'); 66 | 67 | // TODO: Limit nodes to blocks, stylesheet, etc. 68 | 69 | for (var i = 0, l = node.length; i < l; i++) { 70 | var currentNode = node[i]; 71 | 72 | if (currentNode[0] !== 'declDelim') continue; 73 | 74 | // Grom user's point of view "declaration" includes semicolons 75 | // and comments placed on the same line. 76 | // So group those things together: 77 | var declarationEnd = getDeclarationEnd(node, i); 78 | if (!declarationEnd) { 79 | continue; 80 | } else { 81 | i = declarationEnd; 82 | } 83 | 84 | var nextNode = node[i + 1]; 85 | if (nextNode[0] === 's') { 86 | nextNode[1] = value; 87 | } else { 88 | i++; 89 | l++; 90 | node.splice(i, 0, ['s', value]); 91 | } 92 | } 93 | } 94 | }; 95 | })(); 96 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/strip-spaces.js: -------------------------------------------------------------------------------- 1 | module.exports = (function() { 2 | /** 3 | * Trim trailing spaces on each line. 4 | * @private 5 | * @param {String} s Spaceful string 6 | * @returns {String} 7 | */ 8 | function trim(s) { 9 | return s.replace(/[ \t]+\n/g, '\n'); 10 | } 11 | 12 | return { 13 | name: 'strip-spaces', 14 | 15 | syntax: ['css', 'less', 'sass', 'scss'], 16 | 17 | accepts: { boolean: [true] }, 18 | 19 | /** 20 | * Processes tree node. 21 | * @param {String} nodeType 22 | * @param {node} node 23 | */ 24 | process: function(nodeType, node) { 25 | if (nodeType === 's') { 26 | node[0] = trim(node[0]); 27 | } 28 | if (nodeType === 'stylesheet') { 29 | var lastChild = node[node.length - 1]; 30 | if (lastChild[0] === 's') { 31 | lastChild[1] = trim(lastChild[1]) 32 | .replace(/[ \t]+$/, '') 33 | .replace(/[\n]+/g, '\n'); 34 | } 35 | } 36 | }, 37 | 38 | /** 39 | * Detects the value of an option at the tree node. 40 | * This option is treated as `true` by default, but any trailing space would invalidate it. 41 | * 42 | * @param {String} nodeType 43 | * @param {node} node 44 | */ 45 | detectDefault: true, 46 | 47 | detect: function(nodeType, node) { 48 | if (nodeType === 's') { 49 | if (node[0].match(/[ \t]\n/)) { 50 | return false; 51 | } 52 | } 53 | if (nodeType === 'stylesheet') { 54 | var lastChild = node[node.length - 1]; 55 | if (lastChild[0] === 's' && lastChild[1] !== '\n' && lastChild[1].match(/^[ \n\t]+$/)) { 56 | return false; 57 | } 58 | } 59 | } 60 | }; 61 | })(); 62 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/tab-size.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'tab-size', 3 | 4 | runBefore: 'vendor-prefix-align', 5 | 6 | syntax: ['css', 'less', 'sass', 'scss'], 7 | 8 | accepts: { number: true }, 9 | 10 | /** 11 | * Processes tree node. 12 | * 13 | * @param {String} nodeType 14 | * @param {node} node 15 | */ 16 | process: function(nodeType, node) { 17 | if (nodeType !== 's') return; 18 | node[0] = node[0].replace(/\t/, this.getValue('tab-size')); 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/lib/options/unitless-zero.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'unitless-zero', 3 | 4 | syntax: ['css', 'less', 'sass', 'scss'], 5 | 6 | accepts: { boolean: [true] }, 7 | 8 | /** 9 | * Processes tree node. 10 | * @param {String} nodeType 11 | * @param {node} node 12 | */ 13 | process: function(nodeType, node) { 14 | if (nodeType === 'value' || nodeType === 'braces') { 15 | node.forEach(function(child, index) { 16 | if ( 17 | (child[0] === 'percentage' || 18 | child[0] === 'dimension' && ['cm', 'em', 'ex', 'pt', 'px'].indexOf(child[2][1]) !== -1) && 19 | child[1][1] === '0') { 20 | node[index] = child[1]; 21 | } 22 | }); 23 | } 24 | }, 25 | 26 | /** 27 | * Detects the value of an option at the tree node. 28 | * 29 | * @param {String} nodeType 30 | * @param {node} node 31 | */ 32 | detect: function(nodeType, node) { 33 | var result = null; 34 | 35 | // If we see a zero with unit and it is not degree, then we don’t have an option 36 | if ( 37 | nodeType === 'percentage' && node[0][1] === '0' || 38 | nodeType === 'dimension' && node[0][1] === '0' && node[1][1] !== 'deg' 39 | ) { 40 | result = false; 41 | } 42 | 43 | // If we see a zero and previous node is not percentage or dimension, then we have an option 44 | if ( 45 | nodeType === 'number' && 46 | node[0] === '0' && 47 | this._prev !== 'percentage' && 48 | this._prev !== 'dimension' 49 | ) { 50 | result = true; 51 | } 52 | 53 | // Store the previous nodeType 54 | this._prev = nodeType; 55 | 56 | if (result !== null) { 57 | return result; 58 | } 59 | } 60 | }; 61 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/.bin/gonzales: -------------------------------------------------------------------------------- 1 | "$basedir/../gonzales-pe/bin/gonzales.js" "$@" 2 | exit $? 3 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/.bin/gonzales.cmd: -------------------------------------------------------------------------------- 1 | "%~dp0\..\gonzales-pe\bin\gonzales.js" %* 2 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/commander/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "commander", 3 | "version": "2.0.0", 4 | "description": "the complete solution for node.js command-line programs", 5 | "keywords": [ 6 | "command", 7 | "option", 8 | "parser", 9 | "prompt", 10 | "stdin" 11 | ], 12 | "author": { 13 | "name": "TJ Holowaychuk", 14 | "email": "tj@vision-media.ca" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "https://github.com/visionmedia/commander.js.git" 19 | }, 20 | "devDependencies": { 21 | "should": ">= 0.0.1" 22 | }, 23 | "scripts": { 24 | "test": "make test" 25 | }, 26 | "main": "index", 27 | "engines": { 28 | "node": ">= 0.6.x" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/visionmedia/commander.js/issues" 32 | }, 33 | "_id": "commander@2.0.0", 34 | "dist": { 35 | "shasum": "d1b86f901f8b64bd941bdeadaf924530393be928", 36 | "tarball": "http://npm.oa.com/attachments/commander/-/commander-2.0.0.tgz" 37 | }, 38 | "_from": "commander@2.0.0", 39 | "_npmVersion": "1.2.25", 40 | "_npmUser": { 41 | "name": "tjholowaychuk", 42 | "email": "tj@vision-media.ca" 43 | }, 44 | "maintainers": [ 45 | { 46 | "name": "tjholowaychuk", 47 | "email": "tj@vision-media.ca" 48 | } 49 | ], 50 | "directories": {}, 51 | "_shasum": "d1b86f901f8b64bd941bdeadaf924530393be928", 52 | "_resolved": "http://npm.oa.com/attachments/commander/-/commander-2.0.0.tgz" 53 | } 54 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/TODO.nani: -------------------------------------------------------------------------------- 1 | Rename setValue_ to formatValue 2 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/minimatch/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009, 2010, 2011 Isaac Z. Schlueter. 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person 5 | obtaining a copy of this software and associated documentation 6 | files (the "Software"), to deal in the Software without 7 | restriction, including without limitation the rights to use, 8 | copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/minimatch/node_modules/lru-cache/.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # Authors, sorted by whether or not they are me 2 | Isaac Z. Schlueter 3 | Brian Cottingham 4 | Carlos Brito Lage 5 | Jesse Dailey 6 | Kevin O'Hara 7 | Marco Rogers 8 | Mark Cavage 9 | Marko Mikulicic 10 | Nathan Rajlich 11 | Satheesh Natesan 12 | Trent Mick 13 | ashleybrener 14 | n4kz 15 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/minimatch/node_modules/lru-cache/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009, 2010, 2011 Isaac Z. Schlueter. 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person 5 | obtaining a copy of this software and associated documentation 6 | files (the "Software"), to deal in the Software without 7 | restriction, including without limitation the rights to use, 8 | copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/minimatch/node_modules/lru-cache/README.md: -------------------------------------------------------------------------------- 1 | # lru cache 2 | 3 | A cache object that deletes the least-recently-used items. 4 | 5 | ## Usage: 6 | 7 | ```javascript 8 | var LRU = require("lru-cache") 9 | , options = { max: 500 10 | , length: function (n) { return n * 2 } 11 | , dispose: function (key, n) { n.close() } 12 | , maxAge: 1000 * 60 * 60 } 13 | , cache = LRU(options) 14 | , otherCache = LRU(50) // sets just the max size 15 | 16 | cache.set("key", "value") 17 | cache.get("key") // "value" 18 | 19 | cache.reset() // empty the cache 20 | ``` 21 | 22 | If you put more stuff in it, then items will fall out. 23 | 24 | If you try to put an oversized thing in it, then it'll fall out right 25 | away. 26 | 27 | ## Options 28 | 29 | * `max` The maximum size of the cache, checked by applying the length 30 | function to all values in the cache. Not setting this is kind of 31 | silly, since that's the whole purpose of this lib, but it defaults 32 | to `Infinity`. 33 | * `maxAge` Maximum age in ms. Items are not pro-actively pruned out 34 | as they age, but if you try to get an item that is too old, it'll 35 | drop it and return undefined instead of giving it to you. 36 | * `length` Function that is used to calculate the length of stored 37 | items. If you're storing strings or buffers, then you probably want 38 | to do something like `function(n){return n.length}`. The default is 39 | `function(n){return 1}`, which is fine if you want to store `n` 40 | like-sized things. 41 | * `dispose` Function that is called on items when they are dropped 42 | from the cache. This can be handy if you want to close file 43 | descriptors or do other cleanup tasks when items are no longer 44 | accessible. Called with `key, value`. It's called *before* 45 | actually removing the item from the internal cache, so if you want 46 | to immediately put it back in, you'll have to do that in a 47 | `nextTick` or `setTimeout` callback or it won't do anything. 48 | * `stale` By default, if you set a `maxAge`, it'll only actually pull 49 | stale items out of the cache when you `get(key)`. (That is, it's 50 | not pre-emptively doing a `setTimeout` or anything.) If you set 51 | `stale:true`, it'll return the stale value before deleting it. If 52 | you don't set this, then it'll return `undefined` when you try to 53 | get a stale entry, as if it had already been deleted. 54 | 55 | ## API 56 | 57 | * `set(key, value)` 58 | * `get(key) => value` 59 | 60 | Both of these will update the "recently used"-ness of the key. 61 | They do what you think. 62 | 63 | * `peek(key)` 64 | 65 | Returns the key value (or `undefined` if not found) without 66 | updating the "recently used"-ness of the key. 67 | 68 | (If you find yourself using this a lot, you *might* be using the 69 | wrong sort of data structure, but there are some use cases where 70 | it's handy.) 71 | 72 | * `del(key)` 73 | 74 | Deletes a key out of the cache. 75 | 76 | * `reset()` 77 | 78 | Clear the cache entirely, throwing away all values. 79 | 80 | * `has(key)` 81 | 82 | Check if a key is in the cache, without updating the recent-ness 83 | or deleting it for being stale. 84 | 85 | * `forEach(function(value,key,cache), [thisp])` 86 | 87 | Just like `Array.prototype.forEach`. Iterates over all the keys 88 | in the cache, in order of recent-ness. (Ie, more recently used 89 | items are iterated over first.) 90 | 91 | * `keys()` 92 | 93 | Return an array of the keys in the cache. 94 | 95 | * `values()` 96 | 97 | Return an array of the values in the cache. 98 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/minimatch/node_modules/lru-cache/test/foreach.js: -------------------------------------------------------------------------------- 1 | var test = require('tap').test 2 | var LRU = require('../') 3 | 4 | test('forEach', function (t) { 5 | var l = new LRU(5) 6 | for (var i = 0; i < 10; i ++) { 7 | l.set(i.toString(), i.toString(2)) 8 | } 9 | 10 | var i = 9 11 | l.forEach(function (val, key, cache) { 12 | t.equal(cache, l) 13 | t.equal(key, i.toString()) 14 | t.equal(val, i.toString(2)) 15 | i -= 1 16 | }) 17 | 18 | // get in order of most recently used 19 | l.get(6) 20 | l.get(8) 21 | 22 | var order = [ 8, 6, 9, 7, 5 ] 23 | var i = 0 24 | 25 | l.forEach(function (val, key, cache) { 26 | var j = order[i ++] 27 | t.equal(cache, l) 28 | t.equal(key, j.toString()) 29 | t.equal(val, j.toString(2)) 30 | }) 31 | 32 | t.end() 33 | }) 34 | 35 | test('keys() and values()', function (t) { 36 | var l = new LRU(5) 37 | for (var i = 0; i < 10; i ++) { 38 | l.set(i.toString(), i.toString(2)) 39 | } 40 | 41 | t.similar(l.keys(), ['9', '8', '7', '6', '5']) 42 | t.similar(l.values(), ['1001', '1000', '111', '110', '101']) 43 | 44 | // get in order of most recently used 45 | l.get(6) 46 | l.get(8) 47 | 48 | t.similar(l.keys(), ['8', '6', '9', '7', '5']) 49 | t.similar(l.values(), ['1000', '110', '1001', '111', '101']) 50 | 51 | t.end() 52 | }) 53 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node --expose_gc 2 | 3 | var weak = require('weak'); 4 | var test = require('tap').test 5 | var LRU = require('../') 6 | var l = new LRU({ max: 10 }) 7 | var refs = 0 8 | function X() { 9 | refs ++ 10 | weak(this, deref) 11 | } 12 | 13 | function deref() { 14 | refs -- 15 | } 16 | 17 | test('no leaks', function (t) { 18 | // fill up the cache 19 | for (var i = 0; i < 100; i++) { 20 | l.set(i, new X); 21 | // throw some gets in there, too. 22 | if (i % 2 === 0) 23 | l.get(i / 2) 24 | } 25 | 26 | gc() 27 | 28 | var start = process.memoryUsage() 29 | 30 | // capture the memory 31 | var startRefs = refs 32 | 33 | // do it again, but more 34 | for (var i = 0; i < 10000; i++) { 35 | l.set(i, new X); 36 | // throw some gets in there, too. 37 | if (i % 2 === 0) 38 | l.get(i / 2) 39 | } 40 | 41 | gc() 42 | 43 | var end = process.memoryUsage() 44 | t.equal(refs, startRefs, 'no leaky refs') 45 | 46 | console.error('start: %j\n' + 47 | 'end: %j', start, end); 48 | t.pass(); 49 | t.end(); 50 | }) 51 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/minimatch/node_modules/sigmund/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Isaac Z. Schlueter ("Author") 2 | All rights reserved. 3 | 4 | The BSD License 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in the 15 | documentation and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS 21 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/minimatch/node_modules/sigmund/README.md: -------------------------------------------------------------------------------- 1 | # sigmund 2 | 3 | Quick and dirty signatures for Objects. 4 | 5 | This is like a much faster `deepEquals` comparison, which returns a 6 | string key suitable for caches and the like. 7 | 8 | ## Usage 9 | 10 | ```javascript 11 | function doSomething (someObj) { 12 | var key = sigmund(someObj, maxDepth) // max depth defaults to 10 13 | var cached = cache.get(key) 14 | if (cached) return cached) 15 | 16 | var result = expensiveCalculation(someObj) 17 | cache.set(key, result) 18 | return result 19 | } 20 | ``` 21 | 22 | The resulting key will be as unique and reproducible as calling 23 | `JSON.stringify` or `util.inspect` on the object, but is much faster. 24 | In order to achieve this speed, some differences are glossed over. 25 | For example, the object `{0:'foo'}` will be treated identically to the 26 | array `['foo']`. 27 | 28 | Also, just as there is no way to summon the soul from the scribblings 29 | of a cocain-addled psychoanalyst, there is no way to revive the object 30 | from the signature string that sigmund gives you. In fact, it's 31 | barely even readable. 32 | 33 | As with `sys.inspect` and `JSON.stringify`, larger objects will 34 | produce larger signature strings. 35 | 36 | Because sigmund is a bit less strict than the more thorough 37 | alternatives, the strings will be shorter, and also there is a 38 | slightly higher chance for collisions. For example, these objects 39 | have the same signature: 40 | 41 | var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} 42 | var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} 43 | 44 | Like a good Freudian, sigmund is most effective when you already have 45 | some understanding of what you're looking for. It can help you help 46 | yourself, but you must be willing to do some work as well. 47 | 48 | Cycles are handled, and cyclical objects are silently omitted (though 49 | the key is included in the signature output.) 50 | 51 | The second argument is the maximum depth, which defaults to 10, 52 | because that is the maximum object traversal depth covered by most 53 | insurance carriers. 54 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/minimatch/node_modules/sigmund/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sigmund", 3 | "version": "1.0.0", 4 | "description": "Quick and dirty signatures for Objects.", 5 | "main": "sigmund.js", 6 | "directories": { 7 | "test": "test" 8 | }, 9 | "dependencies": {}, 10 | "devDependencies": { 11 | "tap": "~0.3.0" 12 | }, 13 | "scripts": { 14 | "test": "tap test/*.js", 15 | "bench": "node bench.js" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/isaacs/sigmund" 20 | }, 21 | "keywords": [ 22 | "object", 23 | "signature", 24 | "key", 25 | "data", 26 | "psychoanalysis" 27 | ], 28 | "author": { 29 | "name": "Isaac Z. Schlueter", 30 | "email": "i@izs.me", 31 | "url": "http://blog.izs.me/" 32 | }, 33 | "license": "BSD", 34 | "readme": "# sigmund\n\nQuick and dirty signatures for Objects.\n\nThis is like a much faster `deepEquals` comparison, which returns a\nstring key suitable for caches and the like.\n\n## Usage\n\n```javascript\nfunction doSomething (someObj) {\n var key = sigmund(someObj, maxDepth) // max depth defaults to 10\n var cached = cache.get(key)\n if (cached) return cached)\n\n var result = expensiveCalculation(someObj)\n cache.set(key, result)\n return result\n}\n```\n\nThe resulting key will be as unique and reproducible as calling\n`JSON.stringify` or `util.inspect` on the object, but is much faster.\nIn order to achieve this speed, some differences are glossed over.\nFor example, the object `{0:'foo'}` will be treated identically to the\narray `['foo']`.\n\nAlso, just as there is no way to summon the soul from the scribblings\nof a cocain-addled psychoanalyst, there is no way to revive the object\nfrom the signature string that sigmund gives you. In fact, it's\nbarely even readable.\n\nAs with `sys.inspect` and `JSON.stringify`, larger objects will\nproduce larger signature strings.\n\nBecause sigmund is a bit less strict than the more thorough\nalternatives, the strings will be shorter, and also there is a\nslightly higher chance for collisions. For example, these objects\nhave the same signature:\n\n var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}\n var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}\n\nLike a good Freudian, sigmund is most effective when you already have\nsome understanding of what you're looking for. It can help you help\nyourself, but you must be willing to do some work as well.\n\nCycles are handled, and cyclical objects are silently omitted (though\nthe key is included in the signature output.)\n\nThe second argument is the maximum depth, which defaults to 10,\nbecause that is the maximum object traversal depth covered by most\ninsurance carriers.\n", 35 | "readmeFilename": "README.md", 36 | "bugs": { 37 | "url": "https://github.com/isaacs/sigmund/issues" 38 | }, 39 | "homepage": "https://github.com/isaacs/sigmund", 40 | "_id": "sigmund@1.0.0", 41 | "_from": "sigmund@>=1.0.0 <1.1.0" 42 | } 43 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/minimatch/node_modules/sigmund/sigmund.js: -------------------------------------------------------------------------------- 1 | module.exports = sigmund 2 | function sigmund (subject, maxSessions) { 3 | maxSessions = maxSessions || 10; 4 | var notes = []; 5 | var analysis = ''; 6 | var RE = RegExp; 7 | 8 | function psychoAnalyze (subject, session) { 9 | if (session > maxSessions) return; 10 | 11 | if (typeof subject === 'function' || 12 | typeof subject === 'undefined') { 13 | return; 14 | } 15 | 16 | if (typeof subject !== 'object' || !subject || 17 | (subject instanceof RE)) { 18 | analysis += subject; 19 | return; 20 | } 21 | 22 | if (notes.indexOf(subject) !== -1 || session === maxSessions) return; 23 | 24 | notes.push(subject); 25 | analysis += '{'; 26 | Object.keys(subject).forEach(function (issue, _, __) { 27 | // pseudo-private values. skip those. 28 | if (issue.charAt(0) === '_') return; 29 | var to = typeof subject[issue]; 30 | if (to === 'function' || to === 'undefined') return; 31 | analysis += issue; 32 | psychoAnalyze(subject[issue], session + 1); 33 | }); 34 | } 35 | psychoAnalyze(subject, 0); 36 | return analysis; 37 | } 38 | 39 | // vim: set softtabstop=4 shiftwidth=4: 40 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/minimatch/node_modules/sigmund/test/basic.js: -------------------------------------------------------------------------------- 1 | var test = require('tap').test 2 | var sigmund = require('../sigmund.js') 3 | 4 | 5 | // occasionally there are duplicates 6 | // that's an acceptable edge-case. JSON.stringify and util.inspect 7 | // have some collision potential as well, though less, and collision 8 | // detection is expensive. 9 | var hash = '{abc/def/g{0h1i2{jkl' 10 | var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} 11 | var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} 12 | 13 | var obj3 = JSON.parse(JSON.stringify(obj1)) 14 | obj3.c = /def/ 15 | obj3.g[2].cycle = obj3 16 | var cycleHash = '{abc/def/g{0h1i2{jklcycle' 17 | 18 | test('basic', function (t) { 19 | t.equal(sigmund(obj1), hash) 20 | t.equal(sigmund(obj2), hash) 21 | t.equal(sigmund(obj3), cycleHash) 22 | t.end() 23 | }) 24 | 25 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/minimatch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Isaac Z. Schlueter", 4 | "email": "i@izs.me", 5 | "url": "http://blog.izs.me" 6 | }, 7 | "name": "minimatch", 8 | "description": "a glob matcher in javascript", 9 | "version": "0.2.12", 10 | "repository": { 11 | "type": "git", 12 | "url": "git://github.com/isaacs/minimatch.git" 13 | }, 14 | "main": "minimatch.js", 15 | "scripts": { 16 | "test": "tap test" 17 | }, 18 | "engines": { 19 | "node": "*" 20 | }, 21 | "dependencies": { 22 | "lru-cache": "2", 23 | "sigmund": "~1.0.0" 24 | }, 25 | "devDependencies": { 26 | "tap": "" 27 | }, 28 | "license": { 29 | "type": "MIT", 30 | "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" 31 | }, 32 | "_id": "minimatch@0.2.12", 33 | "dist": { 34 | "shasum": "ea82a012ac662c7ddfaa144f1c147e6946f5dafb", 35 | "tarball": "http://npm.oa.com/attachments/minimatch/-/minimatch-0.2.12.tgz" 36 | }, 37 | "_from": "minimatch@0.2.12", 38 | "_npmVersion": "1.2.18", 39 | "_npmUser": { 40 | "name": "isaacs", 41 | "email": "i@izs.me" 42 | }, 43 | "maintainers": [ 44 | { 45 | "name": "isaacs", 46 | "email": "i@izs.me" 47 | } 48 | ], 49 | "directories": {}, 50 | "_shasum": "ea82a012ac662c7ddfaa144f1c147e6946f5dafb", 51 | "_resolved": "http://npm.oa.com/attachments/minimatch/-/minimatch-0.2.12.tgz" 52 | } 53 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/minimatch/test/brace-expand.js: -------------------------------------------------------------------------------- 1 | var tap = require("tap") 2 | , minimatch = require("../") 3 | 4 | tap.test("brace expansion", function (t) { 5 | // [ pattern, [expanded] ] 6 | ; [ [ "a{b,c{d,e},{f,g}h}x{y,z}" 7 | , [ "abxy" 8 | , "abxz" 9 | , "acdxy" 10 | , "acdxz" 11 | , "acexy" 12 | , "acexz" 13 | , "afhxy" 14 | , "afhxz" 15 | , "aghxy" 16 | , "aghxz" ] ] 17 | , [ "a{1..5}b" 18 | , [ "a1b" 19 | , "a2b" 20 | , "a3b" 21 | , "a4b" 22 | , "a5b" ] ] 23 | , [ "a{b}c", ["a{b}c"] ] 24 | ].forEach(function (tc) { 25 | var p = tc[0] 26 | , expect = tc[1] 27 | t.equivalent(minimatch.braceExpand(p), expect, p) 28 | }) 29 | console.error("ending") 30 | t.end() 31 | }) 32 | 33 | 34 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/minimatch/test/caching.js: -------------------------------------------------------------------------------- 1 | var Minimatch = require("../minimatch.js").Minimatch 2 | var tap = require("tap") 3 | tap.test("cache test", function (t) { 4 | var mm1 = new Minimatch("a?b") 5 | var mm2 = new Minimatch("a?b") 6 | t.equal(mm1, mm2, "should get the same object") 7 | // the lru should drop it after 100 entries 8 | for (var i = 0; i < 100; i ++) { 9 | new Minimatch("a"+i) 10 | } 11 | mm2 = new Minimatch("a?b") 12 | t.notEqual(mm1, mm2, "cache should have dropped") 13 | t.end() 14 | }) 15 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | coverage/ 3 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | node_js: 4 | - 0.8 5 | - 0.10 6 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/README.md: -------------------------------------------------------------------------------- 1 | vow-fs [![NPM version](https://badge.fury.io/js/vow-fs.png)](http://badge.fury.io/js/vow-fs) [![Build Status](https://secure.travis-ci.org/dfilatov/vow-fs.png)](http://travis-ci.org/dfilatov/vow-fs) 2 | ====== 3 | 4 | [Vow](https://github.com/dfilatov/vow)-based file I/O for Node.js 5 | 6 | Requirements 7 | ------------ 8 | Vow-fs works with Node.js 0.6, 0.8 and 0.10. 9 | 10 | Getting Started 11 | --------------- 12 | You can install vow-fs using Node Package Manager (npm): 13 | 14 | npm install vow-fs 15 | 16 | ####Usage#### 17 | ````javascript 18 | var fs = require('vow-fs'); 19 | ```` 20 | 21 | API 22 | --- 23 | ####read(path, [encoding=utf8])#### 24 | Returns a promise for the file's content at a given ````path````. 25 | ####write(path, data, [encoding=utf8])#### 26 | Writes ````data```` to file at a given ````path````. Returns a promise for the completion of the operation. 27 | ####append(path, data, [encoding=utf8])#### 28 | Appends````data```` to file's content at a given ````path````. Returns a promise for the completion of the operation. 29 | ####remove(path)#### 30 | Removes a file at a given ````path````. Returns a promise for the completion of the operation. 31 | ####copy(sourcePath, targetPath)#### 32 | Copies a file from ````sourcePath```` to ````targetPath````. Returns a promise for the completion of the operation. 33 | ####move(sourcePath, targetPath)#### 34 | Moves a file or directory from ````sourcePath```` to ````targetPath````. Returns a promise for the completion of the operation. 35 | ####stat(path)#### 36 | Returns a promise for the metadata about the given ````path```` as a [Stats](http://nodejs.org/api/fs.html#fs_class_fs_stats) object. 37 | ####exists(path)#### 38 | Returns a promise for whether the given ````path```` exists. 39 | ####link(sourcePath, targetPath)#### 40 | Creates a hard link from the ````sourcePath```` to ````targetPath````. 41 | ####symLink(sourcePath, targetPath, [type=file])#### 42 | Creates a symbolic link from the ````sourcePath```` to ````targetPath````. 43 | ####chown(path, uid, gid)#### 44 | Changes the owner of a given ````path````. 45 | ####chmod(path, mode)#### 46 | Changes the mode of a given ````path```` to ````mode````. 47 | ####absolute(path)#### 48 | ####isFile(path)#### 49 | Returns a promise for whether the given ````path```` is a file. 50 | ####isDir(path)#### 51 | Returns a promise for whether the given ````path```` is a directory. 52 | ####isSocket(path)#### 53 | Returns a promise for whether the given ````path```` is a socket. 54 | ####isSymLink(path)#### 55 | Returns a promise for whether the given ````path```` is a symbolic link. 56 | ####makeTmpFile([options])#### 57 | Makes a temporary file. Returns a promise with generated path to file. 58 | The ````options````: 59 | * prefix (absent by default) 60 | * dir (operating system's directory for temp files by default) 61 | * ext (````.tmp```` by default) 62 | 63 | ####listDir(path)#### 64 | Returns a promise for a list of files and directories in directory at the given ````path````. 65 | ####makeDir(path, [mode=0777], [failIfExist=false])#### 66 | Makes a directory at a given ````path```` and any necessary subdirectories (like ````mkdir -p````). Returns a promise for the completion of the operation. 67 | ####removeDir(path)#### 68 | Recursively removes a directory at a given path (like ````remove -rf````). Returns a promise for the completion of the operation. 69 | ####glob(pattern, [options])#### 70 | Matches files using the patterns. See https://github.com/isaacs/node-glob for details. 71 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/.npmignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | test/a/ 3 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Isaac Z. Schlueter ("Author") 2 | All rights reserved. 3 | 4 | The BSD License 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in the 15 | documentation and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS 21 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/examples/g.js: -------------------------------------------------------------------------------- 1 | var Glob = require("../").Glob 2 | 3 | var pattern = "test/a/**/[cg]/../[cg]" 4 | console.log(pattern) 5 | 6 | var mg = new Glob(pattern, {mark: true, sync:true}, function (er, matches) { 7 | console.log("matches", matches) 8 | }) 9 | console.log("after") 10 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/examples/usr-local.js: -------------------------------------------------------------------------------- 1 | var Glob = require("../").Glob 2 | 3 | var pattern = "{./*/*,/*,/usr/local/*}" 4 | console.log(pattern) 5 | 6 | var mg = new Glob(pattern, {mark: true}, function (er, matches) { 7 | console.log("matches", matches) 8 | }) 9 | console.log("after") 10 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/node_modules/inherits/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 10 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 11 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 14 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | PERFORMANCE OF THIS SOFTWARE. 16 | 17 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/node_modules/inherits/README.md: -------------------------------------------------------------------------------- 1 | Browser-friendly inheritance fully compatible with standard node.js 2 | [inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). 3 | 4 | This package exports standard `inherits` from node.js `util` module in 5 | node environment, but also provides alternative browser-friendly 6 | implementation through [browser 7 | field](https://gist.github.com/shtylman/4339901). Alternative 8 | implementation is a literal copy of standard one located in standalone 9 | module to avoid requiring of `util`. It also has a shim for old 10 | browsers with no `Object.create` support. 11 | 12 | While keeping you sure you are using standard `inherits` 13 | implementation in node.js environment, it allows bundlers such as 14 | [browserify](https://github.com/substack/node-browserify) to not 15 | include full `util` package to your client code if all you need is 16 | just `inherits` function. It worth, because browser shim for `util` 17 | package is large and `inherits` is often the single function you need 18 | from it. 19 | 20 | It's recommended to use this package instead of 21 | `require('util').inherits` for any code that has chances to be used 22 | not only in node.js but in browser too. 23 | 24 | ## usage 25 | 26 | ```js 27 | var inherits = require('inherits'); 28 | // then use exactly as the standard one 29 | ``` 30 | 31 | ## note on version ~1.0 32 | 33 | Version ~1.0 had completely different motivation and is not compatible 34 | neither with 2.0 nor with standard node.js `inherits`. 35 | 36 | If you are using version ~1.0 and planning to switch to ~2.0, be 37 | careful: 38 | 39 | * new version uses `super_` instead of `super` for referencing 40 | superclass 41 | * new version overwrites current prototype while old one preserves any 42 | existing fields on it 43 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/node_modules/inherits/inherits.js: -------------------------------------------------------------------------------- 1 | module.exports = require('util').inherits 2 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/node_modules/inherits/inherits_browser.js: -------------------------------------------------------------------------------- 1 | if (typeof Object.create === 'function') { 2 | // implementation from standard node.js 'util' module 3 | module.exports = function inherits(ctor, superCtor) { 4 | ctor.super_ = superCtor 5 | ctor.prototype = Object.create(superCtor.prototype, { 6 | constructor: { 7 | value: ctor, 8 | enumerable: false, 9 | writable: true, 10 | configurable: true 11 | } 12 | }); 13 | }; 14 | } else { 15 | // old school shim for old browsers 16 | module.exports = function inherits(ctor, superCtor) { 17 | ctor.super_ = superCtor 18 | var TempCtor = function () {} 19 | TempCtor.prototype = superCtor.prototype 20 | ctor.prototype = new TempCtor() 21 | ctor.prototype.constructor = ctor 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/node_modules/inherits/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "inherits", 3 | "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", 4 | "version": "2.0.1", 5 | "keywords": [ 6 | "inheritance", 7 | "class", 8 | "klass", 9 | "oop", 10 | "object-oriented", 11 | "inherits", 12 | "browser", 13 | "browserify" 14 | ], 15 | "main": "./inherits.js", 16 | "browser": "./inherits_browser.js", 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/isaacs/inherits" 20 | }, 21 | "license": "ISC", 22 | "scripts": { 23 | "test": "node test" 24 | }, 25 | "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n", 26 | "readmeFilename": "README.md", 27 | "bugs": { 28 | "url": "https://github.com/isaacs/inherits/issues" 29 | }, 30 | "homepage": "https://github.com/isaacs/inherits", 31 | "_id": "inherits@2.0.1", 32 | "_from": "inherits@>=2.0.0 <3.0.0" 33 | } 34 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/node_modules/inherits/test.js: -------------------------------------------------------------------------------- 1 | var inherits = require('./inherits.js') 2 | var assert = require('assert') 3 | 4 | function test(c) { 5 | assert(c.constructor === Child) 6 | assert(c.constructor.super_ === Parent) 7 | assert(Object.getPrototypeOf(c) === Child.prototype) 8 | assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) 9 | assert(c instanceof Child) 10 | assert(c instanceof Parent) 11 | } 12 | 13 | function Child() { 14 | Parent.call(this) 15 | test(this) 16 | } 17 | 18 | function Parent() {} 19 | 20 | inherits(Child, Parent) 21 | 22 | var c = new Child 23 | test(c) 24 | 25 | console.log('ok') 26 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Isaac Z. Schlueter", 4 | "email": "i@izs.me", 5 | "url": "http://blog.izs.me/" 6 | }, 7 | "name": "glob", 8 | "description": "a little globber", 9 | "version": "3.2.8", 10 | "repository": { 11 | "type": "git", 12 | "url": "git://github.com/isaacs/node-glob.git" 13 | }, 14 | "main": "glob.js", 15 | "engines": { 16 | "node": "*" 17 | }, 18 | "dependencies": { 19 | "minimatch": "~0.2.11", 20 | "inherits": "2" 21 | }, 22 | "devDependencies": { 23 | "tap": "~0.4.0", 24 | "mkdirp": "0", 25 | "rimraf": "1" 26 | }, 27 | "scripts": { 28 | "test": "tap test/*.js" 29 | }, 30 | "license": "BSD", 31 | "bugs": { 32 | "url": "https://github.com/isaacs/node-glob/issues" 33 | }, 34 | "homepage": "https://github.com/isaacs/node-glob", 35 | "_id": "glob@3.2.8", 36 | "dist": { 37 | "shasum": "5506f4311721bcc618c7d8dba144188750307073", 38 | "tarball": "http://npm.oa.com/attachments/glob/-/glob-3.2.8.tgz" 39 | }, 40 | "_from": "glob@3.2.8", 41 | "_npmVersion": "1.3.23", 42 | "_npmUser": { 43 | "name": "isaacs", 44 | "email": "i@izs.me" 45 | }, 46 | "maintainers": [ 47 | { 48 | "name": "isaacs", 49 | "email": "i@izs.me" 50 | } 51 | ], 52 | "directories": {}, 53 | "_shasum": "5506f4311721bcc618c7d8dba144188750307073", 54 | "_resolved": "http://npm.oa.com/attachments/glob/-/glob-3.2.8.tgz" 55 | } 56 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/bash-comparison.js: -------------------------------------------------------------------------------- 1 | // basic test 2 | // show that it does the same thing by default as the shell. 3 | var tap = require("tap") 4 | , child_process = require("child_process") 5 | , bashResults = require("./bash-results.json") 6 | , globs = Object.keys(bashResults) 7 | , glob = require("../") 8 | , path = require("path") 9 | 10 | // run from the root of the project 11 | // this is usually where you're at anyway, but be sure. 12 | process.chdir(path.resolve(__dirname, "..")) 13 | 14 | function alphasort (a, b) { 15 | a = a.toLowerCase() 16 | b = b.toLowerCase() 17 | return a > b ? 1 : a < b ? -1 : 0 18 | } 19 | 20 | globs.forEach(function (pattern) { 21 | var expect = bashResults[pattern] 22 | // anything regarding the symlink thing will fail on windows, so just skip it 23 | if (process.platform === "win32" && 24 | expect.some(function (m) { 25 | return /\/symlink\//.test(m) 26 | })) 27 | return 28 | 29 | tap.test(pattern, function (t) { 30 | glob(pattern, function (er, matches) { 31 | if (er) 32 | throw er 33 | 34 | // sort and unmark, just to match the shell results 35 | matches = cleanResults(matches) 36 | 37 | t.deepEqual(matches, expect, pattern) 38 | t.end() 39 | }) 40 | }) 41 | 42 | tap.test(pattern + " sync", function (t) { 43 | var matches = cleanResults(glob.sync(pattern)) 44 | 45 | t.deepEqual(matches, expect, "should match shell") 46 | t.end() 47 | }) 48 | }) 49 | 50 | function cleanResults (m) { 51 | // normalize discrepancies in ordering, duplication, 52 | // and ending slashes. 53 | return m.map(function (m) { 54 | return m.replace(/\/+/g, "/").replace(/\/$/, "") 55 | }).sort(alphasort).reduce(function (set, f) { 56 | if (f !== set[set.length - 1]) set.push(f) 57 | return set 58 | }, []).sort(alphasort).map(function (f) { 59 | // de-windows 60 | return (process.platform !== 'win32') ? f 61 | : f.replace(/^[a-zA-Z]:[\/\\]+/, '/').replace(/[\\\/]+/g, '/') 62 | }) 63 | } 64 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/cwd-test.js: -------------------------------------------------------------------------------- 1 | var tap = require("tap") 2 | 3 | var origCwd = process.cwd() 4 | process.chdir(__dirname) 5 | 6 | tap.test("changing cwd and searching for **/d", function (t) { 7 | var glob = require('../') 8 | var path = require('path') 9 | t.test('.', function (t) { 10 | glob('**/d', function (er, matches) { 11 | t.ifError(er) 12 | t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) 13 | t.end() 14 | }) 15 | }) 16 | 17 | t.test('a', function (t) { 18 | glob('**/d', {cwd:path.resolve('a')}, function (er, matches) { 19 | t.ifError(er) 20 | t.like(matches, [ 'b/c/d', 'c/d' ]) 21 | t.end() 22 | }) 23 | }) 24 | 25 | t.test('a/b', function (t) { 26 | glob('**/d', {cwd:path.resolve('a/b')}, function (er, matches) { 27 | t.ifError(er) 28 | t.like(matches, [ 'c/d' ]) 29 | t.end() 30 | }) 31 | }) 32 | 33 | t.test('a/b/', function (t) { 34 | glob('**/d', {cwd:path.resolve('a/b/')}, function (er, matches) { 35 | t.ifError(er) 36 | t.like(matches, [ 'c/d' ]) 37 | t.end() 38 | }) 39 | }) 40 | 41 | t.test('.', function (t) { 42 | glob('**/d', {cwd: process.cwd()}, function (er, matches) { 43 | t.ifError(er) 44 | t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) 45 | t.end() 46 | }) 47 | }) 48 | 49 | t.test('cd -', function (t) { 50 | process.chdir(origCwd) 51 | t.end() 52 | }) 53 | 54 | t.end() 55 | }) 56 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/globstar-match.js: -------------------------------------------------------------------------------- 1 | var Glob = require("../glob.js").Glob 2 | var test = require('tap').test 3 | 4 | test('globstar should not have dupe matches', function(t) { 5 | var pattern = 'a/**/[gh]' 6 | var g = new Glob(pattern, { cwd: __dirname }) 7 | var matches = [] 8 | g.on('match', function(m) { 9 | console.error('match %j', m) 10 | matches.push(m) 11 | }) 12 | g.on('end', function(set) { 13 | console.error('set', set) 14 | matches = matches.sort() 15 | set = set.sort() 16 | t.same(matches, set, 'should have same set of matches') 17 | t.end() 18 | }) 19 | }) 20 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/mark.js: -------------------------------------------------------------------------------- 1 | var test = require("tap").test 2 | var glob = require('../') 3 | process.chdir(__dirname) 4 | 5 | test("mark, no / on pattern", function (t) { 6 | glob("a/*", {mark: true}, function (er, results) { 7 | if (er) 8 | throw er 9 | var expect = [ 'a/abcdef/', 10 | 'a/abcfed/', 11 | 'a/b/', 12 | 'a/bc/', 13 | 'a/c/', 14 | 'a/cb/' ] 15 | 16 | if (process.platform !== "win32") 17 | expect.push('a/symlink/') 18 | 19 | t.same(results, expect) 20 | t.end() 21 | }).on('match', function(m) { 22 | t.similar(m, /\/$/) 23 | }) 24 | }) 25 | 26 | test("mark=false, no / on pattern", function (t) { 27 | glob("a/*", function (er, results) { 28 | if (er) 29 | throw er 30 | var expect = [ 'a/abcdef', 31 | 'a/abcfed', 32 | 'a/b', 33 | 'a/bc', 34 | 'a/c', 35 | 'a/cb' ] 36 | 37 | if (process.platform !== "win32") 38 | expect.push('a/symlink') 39 | t.same(results, expect) 40 | t.end() 41 | }).on('match', function(m) { 42 | t.similar(m, /[^\/]$/) 43 | }) 44 | }) 45 | 46 | test("mark=true, / on pattern", function (t) { 47 | glob("a/*/", {mark: true}, function (er, results) { 48 | if (er) 49 | throw er 50 | var expect = [ 'a/abcdef/', 51 | 'a/abcfed/', 52 | 'a/b/', 53 | 'a/bc/', 54 | 'a/c/', 55 | 'a/cb/' ] 56 | if (process.platform !== "win32") 57 | expect.push('a/symlink/') 58 | t.same(results, expect) 59 | t.end() 60 | }).on('match', function(m) { 61 | t.similar(m, /\/$/) 62 | }) 63 | }) 64 | 65 | test("mark=false, / on pattern", function (t) { 66 | glob("a/*/", function (er, results) { 67 | if (er) 68 | throw er 69 | var expect = [ 'a/abcdef/', 70 | 'a/abcfed/', 71 | 'a/b/', 72 | 'a/bc/', 73 | 'a/c/', 74 | 'a/cb/' ] 75 | if (process.platform !== "win32") 76 | expect.push('a/symlink/') 77 | t.same(results, expect) 78 | t.end() 79 | }).on('match', function(m) { 80 | t.similar(m, /\/$/) 81 | }) 82 | }) 83 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/new-glob-optional-options.js: -------------------------------------------------------------------------------- 1 | var Glob = require('../glob.js').Glob; 2 | var test = require('tap').test; 3 | 4 | test('new glob, with cb, and no options', function (t) { 5 | new Glob(__filename, function(er, results) { 6 | if (er) throw er; 7 | t.same(results, [__filename]); 8 | t.end(); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/nocase-nomagic.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var test = require('tap').test; 3 | var glob = require('../'); 4 | 5 | test('mock fs', function(t) { 6 | var stat = fs.stat 7 | var statSync = fs.statSync 8 | var readdir = fs.readdir 9 | var readdirSync = fs.readdirSync 10 | 11 | function fakeStat(path) { 12 | var ret 13 | switch (path.toLowerCase()) { 14 | case '/tmp': case '/tmp/': 15 | ret = { isDirectory: function() { return true } } 16 | break 17 | case '/tmp/a': 18 | ret = { isDirectory: function() { return false } } 19 | break 20 | } 21 | return ret 22 | } 23 | 24 | fs.stat = function(path, cb) { 25 | var f = fakeStat(path); 26 | if (f) { 27 | process.nextTick(function() { 28 | cb(null, f) 29 | }) 30 | } else { 31 | stat.call(fs, path, cb) 32 | } 33 | } 34 | 35 | fs.statSync = function(path) { 36 | return fakeStat(path) || statSync.call(fs, path) 37 | } 38 | 39 | function fakeReaddir(path) { 40 | var ret 41 | switch (path.toLowerCase()) { 42 | case '/tmp': case '/tmp/': 43 | ret = [ 'a', 'A' ] 44 | break 45 | case '/': 46 | ret = ['tmp', 'tMp', 'tMP', 'TMP'] 47 | } 48 | return ret 49 | } 50 | 51 | fs.readdir = function(path, cb) { 52 | var f = fakeReaddir(path) 53 | if (f) 54 | process.nextTick(function() { 55 | cb(null, f) 56 | }) 57 | else 58 | readdir.call(fs, path, cb) 59 | } 60 | 61 | fs.readdirSync = function(path) { 62 | return fakeReaddir(path) || readdirSync.call(fs, path) 63 | } 64 | 65 | t.pass('mocked') 66 | t.end() 67 | }) 68 | 69 | test('nocase, nomagic', function(t) { 70 | var n = 2 71 | var want = [ '/TMP/A', 72 | '/TMP/a', 73 | '/tMP/A', 74 | '/tMP/a', 75 | '/tMp/A', 76 | '/tMp/a', 77 | '/tmp/A', 78 | '/tmp/a' ] 79 | glob('/tmp/a', { nocase: true }, function(er, res) { 80 | if (er) 81 | throw er 82 | t.same(res.sort(), want) 83 | if (--n === 0) t.end() 84 | }) 85 | glob('/tmp/A', { nocase: true }, function(er, res) { 86 | if (er) 87 | throw er 88 | t.same(res.sort(), want) 89 | if (--n === 0) t.end() 90 | }) 91 | }) 92 | 93 | test('nocase, with some magic', function(t) { 94 | t.plan(2) 95 | var want = [ '/TMP/A', 96 | '/TMP/a', 97 | '/tMP/A', 98 | '/tMP/a', 99 | '/tMp/A', 100 | '/tMp/a', 101 | '/tmp/A', 102 | '/tmp/a' ] 103 | glob('/tmp/*', { nocase: true }, function(er, res) { 104 | if (er) 105 | throw er 106 | t.same(res.sort(), want) 107 | }) 108 | glob('/tmp/*', { nocase: true }, function(er, res) { 109 | if (er) 110 | throw er 111 | t.same(res.sort(), want) 112 | }) 113 | }) 114 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/pause-resume.js: -------------------------------------------------------------------------------- 1 | // show that no match events happen while paused. 2 | var tap = require("tap") 3 | , child_process = require("child_process") 4 | // just some gnarly pattern with lots of matches 5 | , pattern = "test/a/!(symlink)/**" 6 | , bashResults = require("./bash-results.json") 7 | , patterns = Object.keys(bashResults) 8 | , glob = require("../") 9 | , Glob = glob.Glob 10 | , path = require("path") 11 | 12 | // run from the root of the project 13 | // this is usually where you're at anyway, but be sure. 14 | process.chdir(path.resolve(__dirname, "..")) 15 | 16 | function alphasort (a, b) { 17 | a = a.toLowerCase() 18 | b = b.toLowerCase() 19 | return a > b ? 1 : a < b ? -1 : 0 20 | } 21 | 22 | function cleanResults (m) { 23 | // normalize discrepancies in ordering, duplication, 24 | // and ending slashes. 25 | return m.map(function (m) { 26 | return m.replace(/\/+/g, "/").replace(/\/$/, "") 27 | }).sort(alphasort).reduce(function (set, f) { 28 | if (f !== set[set.length - 1]) set.push(f) 29 | return set 30 | }, []).sort(alphasort).map(function (f) { 31 | // de-windows 32 | return (process.platform !== 'win32') ? f 33 | : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') 34 | }) 35 | } 36 | 37 | var globResults = [] 38 | tap.test("use a Glob object, and pause/resume it", function (t) { 39 | var g = new Glob(pattern) 40 | , paused = false 41 | , res = [] 42 | , expect = bashResults[pattern] 43 | 44 | g.on("pause", function () { 45 | console.error("pause") 46 | }) 47 | 48 | g.on("resume", function () { 49 | console.error("resume") 50 | }) 51 | 52 | g.on("match", function (m) { 53 | t.notOk(g.paused, "must not be paused") 54 | globResults.push(m) 55 | g.pause() 56 | t.ok(g.paused, "must be paused") 57 | setTimeout(g.resume.bind(g), 10) 58 | }) 59 | 60 | g.on("end", function (matches) { 61 | t.pass("reached glob end") 62 | globResults = cleanResults(globResults) 63 | matches = cleanResults(matches) 64 | t.deepEqual(matches, globResults, 65 | "end event matches should be the same as match events") 66 | 67 | t.deepEqual(matches, expect, 68 | "glob matches should be the same as bash results") 69 | 70 | t.end() 71 | }) 72 | }) 73 | 74 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/root-nomount.js: -------------------------------------------------------------------------------- 1 | var tap = require("tap") 2 | 3 | var origCwd = process.cwd() 4 | process.chdir(__dirname) 5 | 6 | tap.test("changing root and searching for /b*/**", function (t) { 7 | var glob = require('../') 8 | var path = require('path') 9 | t.test('.', function (t) { 10 | glob('/b*/**', { globDebug: true, root: '.', nomount: true }, function (er, matches) { 11 | t.ifError(er) 12 | t.like(matches, []) 13 | t.end() 14 | }) 15 | }) 16 | 17 | t.test('a', function (t) { 18 | glob('/b*/**', { globDebug: true, root: path.resolve('a'), nomount: true }, function (er, matches) { 19 | t.ifError(er) 20 | t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) 21 | t.end() 22 | }) 23 | }) 24 | 25 | t.test('root=a, cwd=a/b', function (t) { 26 | glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b'), nomount: true }, function (er, matches) { 27 | t.ifError(er) 28 | t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) 29 | t.end() 30 | }) 31 | }) 32 | 33 | t.test('cd -', function (t) { 34 | process.chdir(origCwd) 35 | t.end() 36 | }) 37 | 38 | t.end() 39 | }) 40 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/root.js: -------------------------------------------------------------------------------- 1 | var t = require("tap") 2 | 3 | var origCwd = process.cwd() 4 | process.chdir(__dirname) 5 | 6 | var glob = require('../') 7 | var path = require('path') 8 | 9 | t.test('.', function (t) { 10 | glob('/b*/**', { globDebug: true, root: '.' }, function (er, matches) { 11 | t.ifError(er) 12 | t.like(matches, []) 13 | t.end() 14 | }) 15 | }) 16 | 17 | 18 | t.test('a', function (t) { 19 | console.error("root=" + path.resolve('a')) 20 | glob('/b*/**', { globDebug: true, root: path.resolve('a') }, function (er, matches) { 21 | t.ifError(er) 22 | var wanted = [ 23 | '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' 24 | ].map(function (m) { 25 | return path.join(path.resolve('a'), m).replace(/\\/g, '/') 26 | }) 27 | 28 | t.like(matches, wanted) 29 | t.end() 30 | }) 31 | }) 32 | 33 | t.test('root=a, cwd=a/b', function (t) { 34 | glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b') }, function (er, matches) { 35 | t.ifError(er) 36 | t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ].map(function (m) { 37 | return path.join(path.resolve('a'), m).replace(/\\/g, '/') 38 | })) 39 | t.end() 40 | }) 41 | }) 42 | 43 | t.test('cd -', function (t) { 44 | process.chdir(origCwd) 45 | t.end() 46 | }) 47 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/stat.js: -------------------------------------------------------------------------------- 1 | var glob = require('../') 2 | var test = require('tap').test 3 | var path = require('path') 4 | 5 | test('stat all the things', function(t) { 6 | var g = new glob.Glob('a/*abc*/**', { stat: true, cwd: __dirname }) 7 | var matches = [] 8 | g.on('match', function(m) { 9 | matches.push(m) 10 | }) 11 | var stats = [] 12 | g.on('stat', function(m) { 13 | stats.push(m) 14 | }) 15 | g.on('end', function(eof) { 16 | stats = stats.sort() 17 | matches = matches.sort() 18 | eof = eof.sort() 19 | t.same(stats, matches) 20 | t.same(eof, matches) 21 | var cache = Object.keys(this.statCache) 22 | t.same(cache.map(function (f) { 23 | return path.relative(__dirname, f) 24 | }).sort(), matches) 25 | 26 | cache.forEach(function(c) { 27 | t.equal(typeof this.statCache[c], 'object') 28 | }, this) 29 | 30 | t.end() 31 | }) 32 | }) 33 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/zz-cleanup.js: -------------------------------------------------------------------------------- 1 | // remove the fixtures 2 | var tap = require("tap") 3 | , rimraf = require("rimraf") 4 | , path = require("path") 5 | 6 | tap.test("cleanup fixtures", function (t) { 7 | rimraf(path.resolve(__dirname, "a"), function (er) { 8 | t.ifError(er, "removed") 9 | t.end() 10 | }) 11 | }) 12 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Robert Kieffer 2 | 3 | Dual licensed under the [MIT](http://en.wikipedia.org/wiki/MIT_License) and [GPL](http://en.wikipedia.org/wiki/GNU_General_Public_License) licenses. 4 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/benchmark/README.md: -------------------------------------------------------------------------------- 1 | # node-uuid Benchmarks 2 | 3 | ### Results 4 | 5 | To see the results of our benchmarks visit https://github.com/broofa/node-uuid/wiki/Benchmark 6 | 7 | ### Run them yourself 8 | 9 | node-uuid comes with some benchmarks to measure performance of generating UUIDs. These can be run using node.js. node-uuid is being benchmarked against some other uuid modules, that are available through npm namely `uuid` and `uuid-js`. 10 | 11 | To prepare and run the benchmark issue; 12 | 13 | ``` 14 | npm install uuid uuid-js 15 | node benchmark/benchmark.js 16 | ``` 17 | 18 | You'll see an output like this one: 19 | 20 | ``` 21 | # v4 22 | nodeuuid.v4(): 854700 uuids/second 23 | nodeuuid.v4('binary'): 788643 uuids/second 24 | nodeuuid.v4('binary', buffer): 1336898 uuids/second 25 | uuid(): 479386 uuids/second 26 | uuid('binary'): 582072 uuids/second 27 | uuidjs.create(4): 312304 uuids/second 28 | 29 | # v1 30 | nodeuuid.v1(): 938086 uuids/second 31 | nodeuuid.v1('binary'): 683060 uuids/second 32 | nodeuuid.v1('binary', buffer): 1644736 uuids/second 33 | uuidjs.create(1): 190621 uuids/second 34 | ``` 35 | 36 | * The `uuid()` entries are for Nikhil Marathe's [uuid module](https://bitbucket.org/nikhilm/uuidjs) which is a wrapper around the native libuuid library. 37 | * The `uuidjs()` entries are for Patrick Negri's [uuid-js module](https://github.com/pnegri/uuid-js) which is a pure javascript implementation based on [UUID.js](https://github.com/LiosK/UUID.js) by LiosK. 38 | 39 | If you want to get more reliable results you can run the benchmark multiple times and write the output into a log file: 40 | 41 | ``` 42 | for i in {0..9}; do node benchmark/benchmark.js >> benchmark/bench_0.4.12.log; done; 43 | ``` 44 | 45 | If you're interested in how performance varies between different node versions, you can issue the above command multiple times. 46 | 47 | You can then use the shell script `bench.sh` provided in this directory to calculate the averages over all benchmark runs and draw a nice plot: 48 | 49 | ``` 50 | (cd benchmark/ && ./bench.sh) 51 | ``` 52 | 53 | This assumes you have [gnuplot](http://www.gnuplot.info/) and [ImageMagick](http://www.imagemagick.org/) installed. You'll find a nice `bench.png` graph in the `benchmark/` directory then. 54 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/benchmark/bench.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # for a given node version run: 4 | # for i in {0..9}; do node benchmark.js >> bench_0.6.2.log; done; 5 | 6 | PATTERNS=('nodeuuid.v1()' "nodeuuid.v1('binary'," 'nodeuuid.v4()' "nodeuuid.v4('binary'," "uuid()" "uuid('binary')" 'uuidjs.create(1)' 'uuidjs.create(4)' '140byte') 7 | FILES=(node_uuid_v1_string node_uuid_v1_buf node_uuid_v4_string node_uuid_v4_buf libuuid_v4_string libuuid_v4_binary uuidjs_v1_string uuidjs_v4_string 140byte_es) 8 | INDICES=(2 3 2 3 2 2 2 2 2) 9 | VERSIONS=$( ls bench_*.log | sed -e 's/^bench_\([0-9\.]*\)\.log/\1/' | tr "\\n" " " ) 10 | TMPJOIN="tmp_join" 11 | OUTPUT="bench_results.txt" 12 | 13 | for I in ${!FILES[*]}; do 14 | F=${FILES[$I]} 15 | P=${PATTERNS[$I]} 16 | INDEX=${INDICES[$I]} 17 | echo "version $F" > $F 18 | for V in $VERSIONS; do 19 | (VAL=$( grep "$P" bench_$V.log | LC_ALL=en_US awk '{ sum += $'$INDEX' } END { print sum/NR }' ); echo $V $VAL) >> $F 20 | done 21 | if [ $I == 0 ]; then 22 | cat $F > $TMPJOIN 23 | else 24 | join $TMPJOIN $F > $OUTPUT 25 | cp $OUTPUT $TMPJOIN 26 | fi 27 | rm $F 28 | done 29 | 30 | rm $TMPJOIN 31 | 32 | gnuplot bench.gnu 33 | convert -density 200 -resize 800x560 -flatten bench.eps bench.png 34 | rm bench.eps 35 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/benchmark/benchmark-native.c: -------------------------------------------------------------------------------- 1 | /* 2 | Test performance of native C UUID generation 3 | 4 | To Compile: cc -luuid benchmark-native.c -o benchmark-native 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | int main() { 13 | uuid_t myid; 14 | char buf[36+1]; 15 | int i; 16 | struct timeval t; 17 | double start, finish; 18 | 19 | gettimeofday(&t, NULL); 20 | start = t.tv_sec + t.tv_usec/1e6; 21 | 22 | int n = 2e5; 23 | for (i = 0; i < n; i++) { 24 | uuid_generate(myid); 25 | uuid_unparse(myid, buf); 26 | } 27 | 28 | gettimeofday(&t, NULL); 29 | finish = t.tv_sec + t.tv_usec/1e6; 30 | double dur = finish - start; 31 | 32 | printf("%d uuids/sec", (int)(n/dur)); 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/benchmark/benchmark.js: -------------------------------------------------------------------------------- 1 | try { 2 | var nodeuuid = require('../uuid'); 3 | } catch (e) { 4 | console.error('node-uuid require failed - skipping tests'); 5 | } 6 | 7 | try { 8 | var uuid = require('uuid'); 9 | } catch (e) { 10 | console.error('uuid require failed - skipping tests'); 11 | } 12 | 13 | try { 14 | var uuidjs = require('uuid-js'); 15 | } catch (e) { 16 | console.error('uuid-js require failed - skipping tests'); 17 | } 18 | 19 | var N = 5e5; 20 | 21 | function rate(msg, t) { 22 | console.log(msg + ': ' + 23 | (N / (Date.now() - t) * 1e3 | 0) + 24 | ' uuids/second'); 25 | } 26 | 27 | console.log('# v4'); 28 | 29 | // node-uuid - string form 30 | if (nodeuuid) { 31 | for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4(); 32 | rate('nodeuuid.v4() - using node.js crypto RNG', t); 33 | 34 | for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4({rng: nodeuuid.mathRNG}); 35 | rate('nodeuuid.v4() - using Math.random() RNG', t); 36 | 37 | for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary'); 38 | rate('nodeuuid.v4(\'binary\')', t); 39 | 40 | var buffer = new nodeuuid.BufferClass(16); 41 | for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary', buffer); 42 | rate('nodeuuid.v4(\'binary\', buffer)', t); 43 | } 44 | 45 | // libuuid - string form 46 | if (uuid) { 47 | for (var i = 0, t = Date.now(); i < N; i++) uuid(); 48 | rate('uuid()', t); 49 | 50 | for (var i = 0, t = Date.now(); i < N; i++) uuid('binary'); 51 | rate('uuid(\'binary\')', t); 52 | } 53 | 54 | // uuid-js - string form 55 | if (uuidjs) { 56 | for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(4); 57 | rate('uuidjs.create(4)', t); 58 | } 59 | 60 | // 140byte.es 61 | for (var i = 0, t = Date.now(); i < N; i++) 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(s,r){r=Math.random()*16|0;return (s=='x'?r:r&0x3|0x8).toString(16)}); 62 | rate('140byte.es_v4', t); 63 | 64 | console.log(''); 65 | console.log('# v1'); 66 | 67 | // node-uuid - v1 string form 68 | if (nodeuuid) { 69 | for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1(); 70 | rate('nodeuuid.v1()', t); 71 | 72 | for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary'); 73 | rate('nodeuuid.v1(\'binary\')', t); 74 | 75 | var buffer = new nodeuuid.BufferClass(16); 76 | for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary', buffer); 77 | rate('nodeuuid.v1(\'binary\', buffer)', t); 78 | } 79 | 80 | // uuid-js - v1 string form 81 | if (uuidjs) { 82 | for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(1); 83 | rate('uuidjs.create(1)', t); 84 | } 85 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-uuid", 3 | "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", 4 | "url": "http://github.com/broofa/node-uuid", 5 | "keywords": [ 6 | "uuid", 7 | "guid", 8 | "rfc4122" 9 | ], 10 | "author": { 11 | "name": "Robert Kieffer", 12 | "email": "robert@broofa.com" 13 | }, 14 | "contributors": [ 15 | { 16 | "name": "Christoph Tavan", 17 | "email": "dev@tavan.de" 18 | } 19 | ], 20 | "lib": ".", 21 | "main": "./uuid.js", 22 | "repository": { 23 | "type": "git", 24 | "url": "https://github.com/broofa/node-uuid.git" 25 | }, 26 | "version": "1.4.0", 27 | "_id": "node-uuid@1.4.0", 28 | "dist": { 29 | "shasum": "07f9b2337572ff6275c775e1d48513f3a45d7a65", 30 | "tarball": "http://npm.oa.com/attachments/node-uuid/-/node-uuid-1.4.0.tgz" 31 | }, 32 | "maintainers": [ 33 | { 34 | "name": "broofa", 35 | "email": "robert@broofa.com" 36 | } 37 | ], 38 | "directories": {}, 39 | "_shasum": "07f9b2337572ff6275c775e1d48513f3a45d7a65", 40 | "_from": "node-uuid@1.4.0", 41 | "_resolved": "http://npm.oa.com/attachments/node-uuid/-/node-uuid-1.4.0.tgz" 42 | } 43 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/test/compare_v1.js: -------------------------------------------------------------------------------- 1 | var assert = require('assert'), 2 | nodeuuid = require('../uuid'), 3 | uuidjs = require('uuid-js'), 4 | libuuid = require('uuid').generate, 5 | util = require('util'), 6 | exec = require('child_process').exec, 7 | os = require('os'); 8 | 9 | // On Mac Os X / macports there's only the ossp-uuid package that provides uuid 10 | // On Linux there's uuid-runtime which provides uuidgen 11 | var uuidCmd = os.type() === 'Darwin' ? 'uuid -1' : 'uuidgen -t'; 12 | 13 | function compare(ids) { 14 | console.log(ids); 15 | for (var i = 0; i < ids.length; i++) { 16 | var id = ids[i].split('-'); 17 | id = [id[2], id[1], id[0]].join(''); 18 | ids[i] = id; 19 | } 20 | var sorted = ([].concat(ids)).sort(); 21 | 22 | if (sorted.toString() !== ids.toString()) { 23 | console.log('Warning: sorted !== ids'); 24 | } else { 25 | console.log('everything in order!'); 26 | } 27 | } 28 | 29 | // Test time order of v1 uuids 30 | var ids = []; 31 | while (ids.length < 10e3) ids.push(nodeuuid.v1()); 32 | 33 | var max = 10; 34 | console.log('node-uuid:'); 35 | ids = []; 36 | for (var i = 0; i < max; i++) ids.push(nodeuuid.v1()); 37 | compare(ids); 38 | 39 | console.log(''); 40 | console.log('uuidjs:'); 41 | ids = []; 42 | for (var i = 0; i < max; i++) ids.push(uuidjs.create(1).toString()); 43 | compare(ids); 44 | 45 | console.log(''); 46 | console.log('libuuid:'); 47 | ids = []; 48 | var count = 0; 49 | var last = function() { 50 | compare(ids); 51 | } 52 | var cb = function(err, stdout, stderr) { 53 | ids.push(stdout.substring(0, stdout.length-1)); 54 | count++; 55 | if (count < max) { 56 | return next(); 57 | } 58 | last(); 59 | }; 60 | var next = function() { 61 | exec(uuidCmd, cb); 62 | }; 63 | next(); 64 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/test/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/.jscs.json: -------------------------------------------------------------------------------- 1 | { 2 | "requireMultipleVarDecl": true, 3 | "requireCurlyBraces": ["if", "else", "for", "while", "do"], 4 | "disallowLeftStickedOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], 5 | "disallowRightStickedOperators": ["?", "+", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], 6 | "requireRightStickedOperators": ["!"], 7 | "requireLeftStickedOperators": [","], 8 | "disallowKeywords": ["with"], 9 | "disallowMulipleLineBreaks": true, 10 | "requireAlignedObjectValues": "skipWithLineBreak", 11 | "validateJSDoc": { 12 | "checkParamNames": true, 13 | "requireParamTypes": true 14 | }, 15 | "excludeFiles": [ 16 | "node_modules", 17 | "lib-cov", 18 | "html-report" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/.jshintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib-cov 3 | html-report 4 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "expr" : true, 3 | "undef" : true, 4 | "predef" : ["describe", "it", "beforeEach", "afterEach"], 5 | "node" : true, 6 | "boss" : true, 7 | "sub" : true, 8 | "supernew" : true, 9 | "loopfunc" : true, 10 | "onecase" : true, 11 | "quotmark" : "single" 12 | } 13 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/.npmignore: -------------------------------------------------------------------------------- 1 | .git* 2 | test/ 3 | .DS_Store 4 | lib-cov 5 | node_modules 6 | coverage.html 7 | html-report 8 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | node_js: 4 | - "0.10" 5 | - "0.8" 6 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Changelog 2 | ========= 3 | 4 | See [releases](https://github.com/dfilatov/vow-queue/releases). 5 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/CONTRIBUTION.md: -------------------------------------------------------------------------------- 1 | Contribution Guide 2 | ================== 3 | 4 | This document describes some points about contribution process for vow-queue package. 5 | 6 | The maintainer of the project is Dmitry Filatov (dfilatov@yandex-team.ru). 7 | 8 | The project is being developed within community. Maintainer merges pull-requests, fixes critical bugs. 9 | 10 | Pull-requests 11 | ------------- 12 | 13 | If you fixed or added something useful to the project, you can send pull-request. 14 | It will be reviewed by maintainer and accepted, or commented for rework, or declined. 15 | 16 | Bugs 17 | ---- 18 | 19 | If you found an error, mistype or any other flawback in the project, please report about it using github-issues. 20 | The more details you provide, the easier it can be reproduced and the faster can be fixed. 21 | Unfortunately, sometimes the bug can be only reproduced in your project or in your environment, 22 | so maintainers cannot reproduce it. In this case we believe you can fix the bug and send us the fix. 23 | 24 | Features 25 | -------- 26 | 27 | It you've got an idea about a new feature, it's most likely that you have do implement it on your own. 28 | If you cannot implement the feature, but it is very important, you can add a task in github-issues, 29 | but expect it be declined by the maintainer. 30 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2013 Dmitry Filatov and other contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/Makefile: -------------------------------------------------------------------------------- 1 | BIN = ./node_modules/.bin 2 | MOCHA = $(BIN)/mocha 3 | ISTANBUL = $(BIN)/istanbul 4 | JSHINT = $(BIN)/jshint 5 | JSCS = $(BIN)/jscs 6 | 7 | .PHONY: test 8 | test: 9 | $(MOCHA) -u bdd -R spec --recursive 10 | 11 | .PHONY: validate 12 | validate: lint test 13 | 14 | .PHONY: clean 15 | clean: 16 | -rm -rf lib-cov 17 | -rm -rf html-report 18 | 19 | .PHONY: lib-cov 20 | lib-cov: clean 21 | $(ISTANBUL) instrument --output lib-cov --no-compact --variable global.__coverage__ lib 22 | 23 | .PHONY: coverage 24 | coverage: lib-cov 25 | VOW_QUEUE_COVERAGE=1 $(MOCHA) -u bdd --reporter mocha-istanbul 26 | @echo 27 | @echo Open html-report/index.html file in your browser 28 | 29 | .PHONY: lint 30 | lint: 31 | $(JSHINT) . 32 | $(JSCS) . 33 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/README.md: -------------------------------------------------------------------------------- 1 | vow-queue [![NPM version](https://badge.fury.io/js/vow-queue.png)](http://badge.fury.io/js/vow-queue) [![Build Status](https://secure.travis-ci.org/dfilatov/vow-queue.png)](http://travis-ci.org/dfilatov/vow-queue) 2 | =============== 3 | 4 | vow-queue is a module for task queue with weights and priorities 5 | 6 | Installation 7 | ------------ 8 | 9 | Module can be installed using `npm`: 10 | 11 | ``` 12 | npm install vow-queue 13 | ``` 14 | 15 | or `bower`: 16 | 17 | ``` 18 | bower install vow-queue 19 | ``` 20 | 21 | Usage 22 | ----- 23 | 24 | ````javascript 25 | var Queue = require('vow-queue'), 26 | queue = new Queue({ weightLimit : 10 }); 27 | 28 | queue.enqueue(function() { // simple function 29 | return 2 * 2; 30 | }); 31 | 32 | queue.enqueue(function() { // function returns a promise 33 | // do job 34 | return promise; 35 | }); 36 | 37 | queue.enqueue( // task with custom priority and weight 38 | function() { 39 | // do job 40 | }, 41 | { 42 | priority : 3, // this task will be started before the previous two 43 | weight : 5 44 | }); 45 | 46 | queue.start(); // starts tasks processing 47 | 48 | queue.enqueue(function() { }); // and enqueue yet another task 49 | ```` 50 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "vow-queue", 3 | "version" : "0.3.1", 4 | "main" : "lib/queue.js", 5 | "ignore" : ["**/.*", "node_modules", "test", "utils", "Makefile", ".jshintrc", "package.json", "jscs.json"] 6 | } 7 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vow-queue", 3 | "author": { 4 | "name": "Dmitry Filatov", 5 | "email": "dfilatov@yandex-team.ru" 6 | }, 7 | "description": "Vow-based task queue", 8 | "version": "0.3.1", 9 | "contributors": [ 10 | { 11 | "name": "Dmitry Filatov", 12 | "email": "dfilatov@yandex-team.ru" 13 | } 14 | ], 15 | "engines": { 16 | "node": ">= 0.8.0" 17 | }, 18 | "main": "lib/queue", 19 | "dependencies": { 20 | "vow": "~0.4.0" 21 | }, 22 | "devDependencies": { 23 | "vow": "~0.4.0", 24 | "jshint": "2.1.3", 25 | "mocha": "1.11.0", 26 | "chai": "*", 27 | "jscs": "1.0.0", 28 | "istanbul": "0.1.39", 29 | "mocha-istanbul": "*" 30 | }, 31 | "scripts": { 32 | "test": "make validate", 33 | "lint": "make lint", 34 | "coverage": "make coverage", 35 | "clean": "make clean" 36 | }, 37 | "repository": { 38 | "type": "git", 39 | "url": "http://github.com/dfilatov/vow-queue.git" 40 | }, 41 | "bugs": { 42 | "url": "https://github.com/dfilatov/vow-queue/issues" 43 | }, 44 | "homepage": "https://github.com/dfilatov/vow-queue", 45 | "_id": "vow-queue@0.3.1", 46 | "dist": { 47 | "shasum": "598c51a15b0a81a6d5fc05f4761ceb462de1e868", 48 | "tarball": "http://npm.oa.com/attachments/vow-queue/-/vow-queue-0.3.1.tgz" 49 | }, 50 | "_from": "vow-queue@0.3.1", 51 | "_npmVersion": "1.3.21", 52 | "_npmUser": { 53 | "name": "dfilatov", 54 | "email": "dfilatov@yandex-team.ru" 55 | }, 56 | "maintainers": [ 57 | { 58 | "name": "dfilatov", 59 | "email": "dfilatov@yandex-team.ru" 60 | } 61 | ], 62 | "directories": {}, 63 | "_shasum": "598c51a15b0a81a6d5fc05f4761ceb462de1e868", 64 | "_resolved": "http://npm.oa.com/attachments/vow-queue/-/vow-queue-0.3.1.tgz", 65 | "readme": "ERROR: No README data found!" 66 | } 67 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vow-fs", 3 | "version": "0.3.2", 4 | "description": "File I/O by Vow", 5 | "homepage": "https://github.com/dfilatov/vow-fs", 6 | "keywords": [ 7 | "vow", 8 | "promise", 9 | "file system" 10 | ], 11 | "author": { 12 | "name": "Dmitry Filatov", 13 | "email": "dfilatov@yandex-team.ru" 14 | }, 15 | "contributors": [ 16 | { 17 | "name": "Dmitry Filatov", 18 | "email": "dfilatov@yandex-team.ru" 19 | } 20 | ], 21 | "repository": { 22 | "type": "git", 23 | "url": "http://github.com/dfilatov/vow-fs.git" 24 | }, 25 | "dependencies": { 26 | "node-uuid": "1.4.0", 27 | "vow": "0.4.4", 28 | "vow-queue": "0.3.1", 29 | "glob": "3.2.8" 30 | }, 31 | "devDependencies": { 32 | "nodeunit": "", 33 | "istanbul": "" 34 | }, 35 | "main": "lib/fs", 36 | "engines": { 37 | "node": ">= 0.6.0" 38 | }, 39 | "scripts": { 40 | "test": "./node_modules/istanbul/lib/cli.js test test/runner.js" 41 | }, 42 | "bugs": { 43 | "url": "https://github.com/dfilatov/vow-fs/issues" 44 | }, 45 | "_id": "vow-fs@0.3.2", 46 | "dist": { 47 | "shasum": "ea2b034d85e1db8c277eb2e9a86d1c15f5d38e7a", 48 | "tarball": "http://npm.oa.com/attachments/vow-fs/-/vow-fs-0.3.2.tgz" 49 | }, 50 | "_from": "vow-fs@0.3.2", 51 | "_npmVersion": "1.3.21", 52 | "_npmUser": { 53 | "name": "dfilatov", 54 | "email": "dfilatov@yandex-team.ru" 55 | }, 56 | "maintainers": [ 57 | { 58 | "name": "dfilatov", 59 | "email": "dfilatov@yandex-team.ru" 60 | } 61 | ], 62 | "directories": {}, 63 | "_shasum": "ea2b034d85e1db8c277eb2e9a86d1c15f5d38e7a", 64 | "_resolved": "http://npm.oa.com/attachments/vow-fs/-/vow-fs-0.3.2.tgz", 65 | "readme": "ERROR: No README data found!" 66 | } 67 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/copy.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'), 2 | path = require('path'), 3 | vfs = require('../lib/fs'), 4 | TEST_DIR = path.join(__dirname, 'test-dir'); 5 | 6 | module.exports = { 7 | setUp : function(done) { 8 | fs.mkdirSync(TEST_DIR); 9 | done(); 10 | }, 11 | 12 | tearDown : function(done) { 13 | fs.rmdirSync(TEST_DIR); 14 | done(); 15 | }, 16 | 17 | 'should copy file' : function(test) { 18 | var sourceFile = path.join(TEST_DIR, 'source-file'), 19 | targetFile = path.join(TEST_DIR, 'target-file'); 20 | fs.writeFileSync(sourceFile, 'source'); 21 | vfs.copy(sourceFile, targetFile) 22 | .then(function() { 23 | test.equal(fs.readFileSync(targetFile, 'utf8'), 'source'); 24 | }) 25 | .always(function() { 26 | fs.unlinkSync(sourceFile); 27 | fs.unlinkSync(targetFile); 28 | test.done(); 29 | }); 30 | }, 31 | 32 | 'should copy file if target exists' : function(test) { 33 | var sourceFile = path.join(TEST_DIR, 'source-file'), 34 | targetFile = path.join(TEST_DIR, 'target-file'); 35 | fs.writeFileSync(sourceFile, 'source'); 36 | fs.writeFileSync(targetFile, 'target'); 37 | vfs.copy(sourceFile, targetFile) 38 | .then(function() { 39 | test.equal(fs.readFileSync(targetFile, 'utf8'), 'source'); 40 | }) 41 | .always(function() { 42 | fs.unlinkSync(sourceFile); 43 | fs.unlinkSync(targetFile); 44 | test.done(); 45 | }); 46 | }, 47 | 48 | 'should not copy file if source is directory' : function(test) { 49 | var sourceDir = path.join(TEST_DIR, 'source-dir'), 50 | targetFile = path.join(TEST_DIR, 'target-file'); 51 | fs.mkdirSync(sourceDir); 52 | vfs.copy(sourceDir, targetFile) 53 | .then( 54 | function() { 55 | test.ok(false); 56 | }, 57 | function(err) { 58 | test.equal(err.code, 'EISDIR'); 59 | }) 60 | .always(function() { 61 | fs.rmdirSync(sourceDir); 62 | test.done(); 63 | }); 64 | }, 65 | 66 | 'should not copy file if target is directory' : function(test) { 67 | var sourceFile = path.join(TEST_DIR, 'source-file'), 68 | targetDir = path.join(TEST_DIR, 'target-dir'); 69 | fs.writeFileSync(sourceFile, 'source'); 70 | fs.mkdirSync(targetDir); 71 | vfs.copy(sourceFile, targetDir) 72 | .then( 73 | function() { 74 | test.ok(false); 75 | }, 76 | function(err) { 77 | test.equal(err.code, 'EISDIR'); 78 | }) 79 | .always(function() { 80 | fs.unlinkSync(sourceFile); 81 | fs.rmdirSync(targetDir); 82 | test.done(); 83 | }); 84 | }, 85 | 86 | 'should not copy if target not exists' : function(test) { 87 | var sourceFile = path.join(TEST_DIR, 'source-file'), 88 | targetFile = path.join(TEST_DIR, 'target-file'); 89 | vfs.copy(sourceFile, targetFile) 90 | .then( 91 | function() { 92 | test.ok(false); 93 | }, 94 | function(err) { 95 | test.equal(err.code, 'ENOENT'); 96 | }) 97 | .always(function() { 98 | test.done(); 99 | }); 100 | } 101 | }; -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/issymlink.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'), 2 | path = require('path'), 3 | vfs = require('../lib/fs'), 4 | TEST_DIR = path.join(__dirname, 'test-dir'); 5 | 6 | module.exports = { 7 | setUp : function(done) { 8 | fs.mkdirSync(TEST_DIR); 9 | done(); 10 | }, 11 | 12 | tearDown : function(done) { 13 | fs.rmdirSync(TEST_DIR); 14 | done(); 15 | }, 16 | 17 | 'should return true if the file is a symbolic link' : function(test) { 18 | var sourceFile = path.join(TEST_DIR, 'source-file'), 19 | targetFile = path.join(TEST_DIR, 'target-file'); 20 | fs.writeFileSync(sourceFile, 'source'); 21 | fs.symlinkSync(sourceFile, targetFile); 22 | vfs.isSymLink(targetFile) 23 | .then(function(isSymLink) { 24 | test.ok(isSymLink); 25 | }) 26 | .always(function() { 27 | fs.unlinkSync(sourceFile); 28 | fs.unlinkSync(targetFile); 29 | test.done(); 30 | }); 31 | }, 32 | 33 | 'should return false if the file is not a symbolic link' : function(test) { 34 | var sourceFile = path.join(TEST_DIR, 'source-file'); 35 | fs.writeFileSync(sourceFile, 'source'); 36 | vfs.isSymLink(sourceFile) 37 | .then(function(isSymLink) { 38 | test.ok(!isSymLink); 39 | }) 40 | .always(function() { 41 | fs.unlinkSync(sourceFile); 42 | test.done(); 43 | }); 44 | } 45 | }; -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/maketmpfile.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'), 2 | path = require('path'), 3 | os = require('os'), 4 | vfs = require('../lib/fs'), 5 | tmpDir = os.tmpdir || os.tmpDir || function() { return '/tmp'; }, 6 | TEST_DIR = path.join(__dirname, 'test-dir'); 7 | 8 | module.exports = { 9 | setUp : function(done) { 10 | fs.mkdirSync(TEST_DIR); 11 | done(); 12 | }, 13 | 14 | tearDown : function(done) { 15 | fs.rmdirSync(TEST_DIR); 16 | done(); 17 | }, 18 | 19 | 'should make temporary file with default options' : function(test) { 20 | var filePath; 21 | vfs.makeTmpFile() 22 | .then( 23 | function(_filePath) { 24 | return vfs.exists(filePath = _filePath); 25 | }, 26 | function() { 27 | test.ok(false); 28 | throw Error(); 29 | }) 30 | .then(function(exists) { 31 | fs.unlinkSync(filePath); 32 | test.strictEqual(path.dirname(filePath), path.resolve(tmpDir())); 33 | test.strictEqual(path.extname(filePath), '.tmp'); 34 | test.ok(exists); 35 | }) 36 | .always(function() { 37 | test.done(); 38 | }); 39 | }, 40 | 41 | 'should make temporary file in custom directory' : function(test) { 42 | var filePath; 43 | vfs.makeTmpFile({ dir : TEST_DIR }) 44 | .then( 45 | function(_filePath) { 46 | return vfs.exists(filePath = _filePath); 47 | }, 48 | function() { 49 | test.ok(false); 50 | throw Error(); 51 | }) 52 | .then(function(exists) { 53 | fs.unlinkSync(filePath); 54 | test.ok(exists); 55 | test.strictEqual(path.dirname(filePath), TEST_DIR); 56 | }) 57 | .always(function() { 58 | test.done(); 59 | }) 60 | }, 61 | 62 | 'should make temporary file with custom prefix' : function(test) { 63 | var filePath; 64 | vfs.makeTmpFile({ prefix : '__prefix' }) 65 | .then( 66 | function(_filePath) { 67 | return vfs.exists(filePath = _filePath); 68 | }, 69 | function() { 70 | test.ok(false); 71 | throw Error(); 72 | }) 73 | .then(function(exists) { 74 | fs.unlinkSync(filePath); 75 | test.ok(exists); 76 | test.ok(filePath.indexOf('__prefix') > -1); 77 | }) 78 | .always(function() { 79 | test.done(); 80 | }) 81 | }, 82 | 83 | 'should make temporary file with custom extension' : function(test) { 84 | var filePath; 85 | vfs.makeTmpFile({ ext : '.css' }) 86 | .then( 87 | function(_filePath) { 88 | return vfs.exists(filePath = _filePath); 89 | }, 90 | function() { 91 | test.ok(false); 92 | throw Error(); 93 | }) 94 | .then(function(exists) { 95 | fs.unlinkSync(filePath); 96 | test.ok(exists); 97 | test.strictEqual(path.extname(filePath), '.css'); 98 | }) 99 | .always(function() { 100 | test.done(); 101 | }) 102 | } 103 | }; -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/removedir.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'), 2 | path = require('path'), 3 | vfs = require('../lib/fs'), 4 | TEST_DIR = path.join(__dirname, 'test-dir'); 5 | 6 | module.exports = { 7 | setUp : function(done) { 8 | fs.mkdirSync(TEST_DIR); 9 | done(); 10 | }, 11 | 12 | tearDown : function(done) { 13 | fs.rmdirSync(TEST_DIR); 14 | done(); 15 | }, 16 | 17 | 'should remove empty directory' : function(test) { 18 | var dir = path.join(TEST_DIR, 'dir'); 19 | fs.mkdirSync(dir); 20 | vfs.removeDir(dir) 21 | .then( 22 | function() { 23 | return vfs.exists(dir); 24 | }, 25 | function() { 26 | test.ok(false); 27 | }) 28 | .always(function(promise) { 29 | test.ok(!promise.valueOf()); 30 | test.done(); 31 | }); 32 | }, 33 | 34 | 'should remove directory tree' : function(test) { 35 | var dir = path.join(TEST_DIR, 'dir'); 36 | fs.mkdirSync(dir); 37 | fs.mkdirSync(path.join(dir, 'a')); 38 | fs.writeFileSync(path.join(dir, 'a', 'file'), 'file'); 39 | fs.mkdirSync(path.join(dir, 'a', 'b')); 40 | fs.writeFileSync(path.join(dir, 'a', 'b', 'file1'), 'file1'); 41 | fs.writeFileSync(path.join(dir, 'a', 'b', 'file2'), 'file2'); 42 | vfs.removeDir(dir) 43 | .then( 44 | function() { 45 | return vfs.exists(dir); 46 | }, 47 | function() { 48 | test.ok(false); 49 | }) 50 | .always(function(promise) { 51 | test.ok(!promise.valueOf()); 52 | test.done(); 53 | }); 54 | }, 55 | 56 | 'should not remove file' : function(test) { 57 | var filePath = path.join(TEST_DIR, 'file'); 58 | fs.writeFileSync(filePath, 'file'); 59 | vfs.removeDir(filePath) 60 | .then( 61 | function() { 62 | test.ok(false); 63 | }, 64 | function(err) { 65 | test.equal(err.code, 'ENOTDIR'); 66 | return vfs.exists(filePath); 67 | }) 68 | .always(function(promise) { 69 | test.ok(promise.valueOf()); 70 | fs.unlinkSync(filePath); 71 | test.done(); 72 | }); 73 | } 74 | }; -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/runner.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'), 2 | path = require('path'); 3 | 4 | require('nodeunit').reporters.default.run( 5 | fs.readdirSync(__dirname) 6 | .filter(function(file){ 7 | return fs.statSync(path.join(__dirname, file)).isFile() && file !== 'runner.js'; 8 | }) 9 | .map(function(file) { 10 | return path.join('test', file); 11 | }), 12 | null, 13 | function(err) { 14 | err && process.exit(1); 15 | }); -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/csscomb-core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "csscomb-core", 3 | "version": "2.0.4", 4 | "description": "Framework for writing postprocessors", 5 | "dependencies": { 6 | "gonzales-pe": "3.0.0-10", 7 | "minimatch": "0.2.12", 8 | "vow": "0.4.4", 9 | "vow-fs": "0.3.2" 10 | }, 11 | "main": "lib/core.js", 12 | "maintainers": [ 13 | { 14 | "name": "tonyganch", 15 | "email": "tonyganch+github@gmail.com" 16 | } 17 | ], 18 | "license": "MIT", 19 | "repository": { 20 | "type": "git", 21 | "url": "https://github.com/csscomb/core" 22 | }, 23 | "gitHead": "bcd63daa16967c2a060391b894fa4b427c235a5d", 24 | "bugs": { 25 | "url": "https://github.com/csscomb/core/issues" 26 | }, 27 | "homepage": "https://github.com/csscomb/core", 28 | "_id": "csscomb-core@2.0.4", 29 | "scripts": {}, 30 | "_shasum": "fc1970e543f58df657d096c6d50e4dbd4f99e78f", 31 | "_from": "csscomb-core@>=2.0.0 <2.1.0", 32 | "_npmVersion": "1.5.0-alpha-1", 33 | "_npmUser": { 34 | "name": "tonyganch", 35 | "email": "tonyganch+github@gmail.com" 36 | }, 37 | "dist": { 38 | "shasum": "fc1970e543f58df657d096c6d50e4dbd4f99e78f", 39 | "tarball": "http://npm.oa.com/attachments/csscomb-core/-/csscomb-core-2.0.4.tgz" 40 | }, 41 | "directories": {}, 42 | "_resolved": "http://npm.oa.com/attachments/csscomb-core/-/csscomb-core-2.0.4.tgz", 43 | "readme": "ERROR: No README data found!" 44 | } 45 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/.npmignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .DS_Store 3 | GNUmakefile 4 | .idea/ 5 | benchmark/ 6 | log/ 7 | src/ 8 | test/ 9 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Gonzales changelog 2 | ================== 3 | 4 | 29.12.2013, Version 2.0.2 5 | ------------------------- 6 | 7 | - Sass includes can have both arguments list and content block, 8 | i.e. `@include nani() { color: tomato }` is valid syntax. 9 | 10 | 18.11.2013, Version 2.0.1 11 | ------------------------- 12 | - Bring back lost whitespaces and comments 13 | 14 | 11.11.2013, Version 2.0.0 15 | ------------------------- 16 | 17 | - Support preprocessors: Sass (both SCSS and indented syntax), LESS. 18 | - New node types: 19 | - `arguments` (less and sass only) 20 | - `commentML` 21 | - `commentSL` (less and sass only) 22 | - `condition` (sass only) 23 | - `default` (sass only) 24 | - `escapedString` (less only) 25 | - `include` (less and sass only) 26 | - `loop` (sass only) 27 | - `mixin` (less and sass only) 28 | - `parentselector` (less and sass only) 29 | - `placeholder` (sass only) 30 | - `propertyDelim` 31 | - `variable` (less and sass only) 32 | - `varialeList` (less and sass only) 33 | - Rename methods: 34 | - `srcToCSSP` -> `cssToAST` 35 | - `csspToSrc` -> `astToCSS` 36 | - `csspToTree` -> `astToTree` 37 | - Pass all arguments as one object: 38 | - `gonzales.cssToAST({css: a, syntax: b, rule: c, needInfo: d})` 39 | - `gonzales.astToCSS({ast: ast, syntax: syntax})` 40 | - Remove built files from VCS 41 | - Move test command from `make` to `npm` 42 | - Build files before running tests 43 | - Divide tests into groups according to syntax 44 | - Add script to test one specific css string 45 | - Add token's index number to info object 46 | 47 | 11.02.2013, Version 1.0.7 48 | ------------------------- 49 | 50 | - Identifiers like `_0` are identifiers now. 51 | - Throw error instead of console.error: https://github.com/css/csso/issues/109 52 | 53 | 25.11.2012, Version 1.0.6 54 | ------------------------- 55 | 56 | - Typo fix (global variable leak): https://github.com/css/csso/pull/110 57 | - Attribute selectors extended by `|`. 58 | - `not(..)` pseudo-class special support: https://github.com/css/csso/issues/111 59 | 60 | 28.10.2012, Version 1.0.5 61 | ------------------------- 62 | 63 | - Better error line numbering: https://github.com/css/gonzales/issues/2 64 | 65 | 11.10.2012, Version 1.0.4 66 | ------------------------- 67 | 68 | - CSSO issue (@page inside @media error): https://github.com/css/csso/issues/90 69 | 70 | 10.10.2012, Version 1.0.3 71 | ------------------------- 72 | 73 | - Both .t-1 and .t-01 should be idents: https://github.com/css/gonzales/issues/1 74 | 75 | 08.10.2012, Version 1.0.2 76 | ------------------------- 77 | 78 | - CSSO issue (filter + important breaks csso v1.3.1): https://github.com/css/csso/issues/87 79 | 80 | 08.10.2012, Version 1.0.1 81 | ------------------------- 82 | 83 | - CSSO issue ("filter" IE property breaks CSSO v1.3.0): https://github.com/css/csso/issues/86 84 | 85 | 03.10.2012, Version 1.0.0 86 | ------------------------- 87 | 88 | - First revision. 89 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/MIT-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2012 by Sergey Kryzhanovsky 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/README.md: -------------------------------------------------------------------------------- 1 | Gonzales is a fast CSS parser. 2 | Gonzales PE is a rework with support of preprocessors. 3 | 4 | Currently those are supported: SCSS, Sass, LESS. 5 | 6 | For a plan of future work see [issue #4](https://github.com/tonyganch/gonzales-pe/issues/4). 7 | 8 | ## Install 9 | 10 | To install globally: 11 | 12 | npm install gonzales-pe -g 13 | 14 | To install as a project dependency: 15 | 16 | npm install gonzales-pe 17 | 18 | To install dev branch: 19 | 20 | npm install git://github.com/tonyganch/gonzales-pe.git#dev 21 | 22 | To clone from github: 23 | 24 | git clone git@github.com:tonyganch/gonzales-pe.git 25 | 26 | ## Build 27 | 28 | If you installed/cloned the repo from GitHub, make sure to build library files 29 | first. 30 | It can be done by running `make` in the module's root directory. 31 | `make` will build both Node.js and web versions (all files are comments-free 32 | but not compressed). 33 | If you need a minified version for production, feel free to use uglifier of 34 | your choice. 35 | 36 | ## Use 37 | 38 | Require Gonzales in your project: 39 | 40 | var gonzales = require('gonzales-pe'); 41 | 42 | Do something: 43 | 44 | var css = 'a { color: tomato }'; 45 | console.log(gonzales.cssToAST(css)); 46 | 47 | You can learn more about available methods on [Gonzales usage](doc/Gonzales-Usage.md) page. 48 | 49 | AST is described on [Gonzales AST description](doc/AST-Description.md) page. 50 | 51 | You can also invoke gonzales via a shell command (if you globally install it via `npm install gonzales-pe -g`) 52 | 53 | ``` 54 | gonzales myFile.css 55 | ``` 56 | 57 | Outputs the AST for that file. Example output: 58 | 59 | ``` 60 | ['stylesheet', 61 | ['atrules', 62 | ['atkeyword', 63 | ['ident', 'import']], 64 | ['s', ' 65 | ']]] 66 | ``` 67 | 68 | ## Test 69 | 70 | To run tests: 71 | 72 | npm test 73 | 74 | This command will build library files from sources and run tests on all files 75 | in syntax directories. 76 | 77 | Every test has 3 files: source stylesheet, expected AST and expected string 78 | compiled back from AST to css. 79 | 80 | If some tests fail, you can find information in test logs: 81 | 82 | - `log/test.log` contains all information from stdout; 83 | - `log/expected.txt` contains only expected text; 84 | - `log/result.txt` contains only result text. 85 | 86 | The last two are made for your convenience: you can use any diff app to see 87 | the defference between them. 88 | 89 | If you want to test one specific string or get a general idea of how Gonzales 90 | works, you can use `test/ast.js` file. 91 | Simply change the first two strings (`css` and `syntax` vars) and run: 92 | 93 | node test/ast.js 94 | 95 | Please remember to also run `make` every time you modify any source files. 96 | 97 | ## Report 98 | 99 | If you find a bug or want to add a feature, welcome to [Issues](https://github.com/tonyganch/gonzales-pe/issues). 100 | 101 | If you are shy but have a question, feel free to [drop me a 102 | line](mailto:tonyganch+gonzales@gmail.com). 103 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/bin/gonzales.js: -------------------------------------------------------------------------------- 1 | var gonzales = require('../lib/gonzales'), 2 | fs = require('fs'), 3 | filename = process.argv[2]; 4 | 5 | if (!filename) { 6 | console.log('Please supply a filename. Usage "gonzales file"'); 7 | process.exit(); 8 | } 9 | 10 | console.log(gonzales.astToTree(gonzales.cssToAST(fs.readFileSync(filename).toString()))); 11 | 12 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/doc/Gonzales-Usage.md: -------------------------------------------------------------------------------- 1 | ### Gonzales usage 2 | 3 | #### 1. Sample 4 | 5 | With the help of this sample, you can check if Gonzales is installed correctly and if its (three) functions are working properly. 6 | 7 | It is assumed that in the production code you will change AST in a more intelligent way. 8 | 9 | Sample code: 10 | 11 | var gonzales = require('gonzales-pe'), 12 | src = 'a { color: red }', 13 | ast = gonzales.cssToAST(src); 14 | 15 | console.log('== CSS:'); 16 | console.log(src); 17 | 18 | console.log('\n== CSS -> AST:'); 19 | console.log(gonzales.astToTree(ast)); 20 | 21 | ast[1][1][1][1][1] = 'b'; 22 | 23 | console.log('\n== AST\':'); 24 | console.log(gonzales.astToTree(ast)); 25 | 26 | console.log('\n== AST\' -> CSS:'); 27 | console.log(gonzales.astToCSS(ast)); 28 | 29 | Result: 30 | 31 | == CSS: 32 | a { color: red } 33 | 34 | == CSS -> AST: 35 | ['stylesheet', 36 | ['ruleset', 37 | ['selector', 38 | ['simpleselector', 39 | ['ident', 'a'], 40 | ['s', ' ']]], 41 | ['block', 42 | ['s', ' '], 43 | ['declaration', 44 | ['property', 45 | ['ident', 'color']], 46 | ['propertyDelim'], 47 | ['value', 48 | ['s', ' '], 49 | ['ident', 'red'], 50 | ['s', ' ']]]]]] 51 | 52 | == AST': 53 | ['stylesheet', 54 | ['ruleset', 55 | ['selector', 56 | ['simpleselector', 57 | ['ident', 'b'], 58 | ['s', ' ']]], 59 | ['block', 60 | ['s', ' '], 61 | ['declaration', 62 | ['property', 63 | ['ident', 'color']], 64 | ['propertyDelim'], 65 | ['value', 66 | ['s', ' '], 67 | ['ident', 'red'], 68 | ['s', ' ']]]]]] 69 | 70 | == AST' -> CSS: 71 | b { color: red } 72 | 73 | #### 2. API 74 | 75 | In Node.js you can use Gonzales module this way: 76 | ``` 77 | gonzales = require('gonzales-pe'); 78 | ``` 79 | 80 | You can use AST through the next functions. 81 | 82 | ##### CSS -> AST 83 | 84 | It parses source style to AST: 85 | ``` 86 | gonzales.cssToAST({ 87 | css: css, 88 | rule: rule, 89 | needInfo: true, 90 | syntax: 'scss' 91 | }); 92 | ``` 93 | where: 94 | 95 | - `css` — a string with the CSS style; 96 | - `rule` — a string with the token type in case the style is not complete 97 | (`'stylesheet'` is default); 98 | - `needInfo` — whether to include info object into AST (`false` is default); 99 | - `syntax` — a string with syntax name (`css` is default, other supported 100 | syntaxes are: `scss`, `sass` and `less`). 101 | 102 | Example 1: if you want to parse only *declaration*, you have to call: 103 | ``` 104 | gonzales.cssToAST({ 105 | css: 'color: red', 106 | rule: 'declaration' 107 | }); 108 | ``` 109 | 110 | Example 2: in case the style is complete and you don't need an info object, 111 | the call is shortned to: 112 | ``` 113 | gonzales.cssToAST(css); 114 | ``` 115 | 116 | Example 3: if you want to parse a sass file: 117 | ``` 118 | gonzales.cssToAST({ 119 | css: css, 120 | syntax: 'sass' 121 | }); 122 | ``` 123 | 124 | ##### AST -> CSS 125 | 126 | Translates AST to style: 127 | ``` 128 | gonzales.astToCSS({ 129 | ast: ast, 130 | syntax: 'scss' 131 | }) 132 | ``` 133 | where: 134 | 135 | - `ast` — AST to be translated; 136 | - `syntax` — a string with syntax name (`css` is default). 137 | 138 | ##### AST -> TREE 139 | 140 | Translates AST to the string representation of the tree: 141 | ``` 142 | gonzales.astToTree(ast); 143 | ``` 144 | where: 145 | 146 | - `ast` — AST to be translated. 147 | 148 | This function is useful for debugging or learning purposes. 149 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/lib/ast-to-src.js: -------------------------------------------------------------------------------- 1 | module.exports = function astToSrc(options) { 2 | var ast, syntax, stringify; 3 | 4 | ast = typeof options === 'string' ? options : options.ast; 5 | syntax = options.syntax || 'css'; 6 | 7 | try { 8 | stringify = require('./' + syntax + '/stringify'); 9 | } catch (e) { 10 | return console.error('Syntax "' + syntax + '" is not supported yet, sorry'); 11 | } 12 | 13 | return stringify(ast); 14 | } 15 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/lib/ast-to-string.js: -------------------------------------------------------------------------------- 1 | module.exports = (function() { 2 | function dummySpaces(num) { 3 | return ' ' 4 | .substr(0, num * 2); 5 | } 6 | 7 | return function astToString(tree, level) { 8 | level = level || 0; 9 | var spaces, string; 10 | 11 | if (level) { 12 | spaces = dummySpaces(level); 13 | string = '\n' + spaces + '['; 14 | } else { 15 | string = '['; 16 | } 17 | 18 | tree.forEach(function(node) { 19 | if (typeof node.ln !== 'undefined') return; 20 | string += Array.isArray(node) ? 21 | astToString(node, level + 1) : 22 | ('\'' + node.toString() + '\''); 23 | string += ', '; 24 | }); 25 | 26 | return string.substr(0, string.length - 2) + ']'; 27 | }; 28 | })(); 29 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/lib/css/node-types.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ArgumentsType: 'arguments', 3 | AtkeywordType: 'atkeyword', 4 | AtrulebType: 'atruleb', 5 | AtrulerType: 'atruler', 6 | AtrulerqType: 'atrulerq', 7 | AtrulersType: 'atrulers', 8 | AtrulesType: 'atrules', 9 | AttribType: 'attrib', 10 | AttrselectorType: 'attrselector', 11 | BlockType: 'block', 12 | BracesType: 'braces', 13 | ClassType: 'class', 14 | CombinatorType: 'combinator', 15 | CommentMLType: 'commentML', 16 | DeclarationType: 'declaration', 17 | DeclDelimType: 'declDelim', 18 | DelimType: 'delim', 19 | DimensionType: 'dimension', 20 | FilterType: 'filter', 21 | FiltervType: 'filterv', 22 | FunctionType: 'function', 23 | FunctionExpressionType: 'functionExpression', 24 | IdentType: 'ident', 25 | ImportantType: 'important', 26 | NamespaceType: 'namespace', 27 | NthType: 'nth', 28 | NthselectorType: 'nthselector', 29 | NumberType: 'number', 30 | OperatorType: 'operator', 31 | PercentageType: 'percentage', 32 | ProgidType: 'progid', 33 | PropertyType: 'property', 34 | PropertyDelimType: 'propertyDelim', 35 | PseudocType: 'pseudoc', 36 | PseudoeType: 'pseudoe', 37 | RawType: 'raw', 38 | RulesetType: 'ruleset', 39 | SType: 's', 40 | SelectorType: 'selector', 41 | ShashType: 'shash', 42 | SimpleselectorType: 'simpleselector', 43 | StringType: 'string', 44 | StylesheetType: 'stylesheet', 45 | UnaryType: 'unary', 46 | UriType: 'uri', 47 | ValueType: 'value', 48 | VhashType: 'vhash' 49 | }; 50 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/lib/css/stringify.js: -------------------------------------------------------------------------------- 1 | module.exports = function stringify(tree) { 2 | // TODO: Better error message 3 | if (!tree) throw new Error('We need tree to translate'); 4 | 5 | var _m_simple = { 6 | 'attrselector': 1, 'combinator': 1, 'nth': 1, 'number': 1, 7 | 'operator': 1, 'raw': 1, 's': 1, 'string': 1, 'unary': 1 8 | }, 9 | _m_composite = { 10 | 'atruleb': 1, 'atrulerq': 1, 'atrulers': 1, 'atrules': 1, 11 | 'declaration': 1, 'dimension': 1, 'filterv': 1, 'function': 1, 12 | 'ident': 1, 'selector': 1, 'progid': 1, 'property': 1, 13 | 'ruleset': 1, 'simpleselector': 1, 'stylesheet': 1, 'value': 1 14 | }, 15 | _m_primitive = { 16 | 'declDelim': ';', 'delim': ',', 'namespace': '|', 17 | 'propertyDelim' : ':' 18 | }; 19 | 20 | function _t(tree) { 21 | var t = tree[0]; 22 | if (t in _m_primitive) return _m_primitive[t]; 23 | else if (t in _m_simple) return _simple(tree); 24 | else if (t in _m_composite) return _composite(tree); 25 | return _unique[t](tree); 26 | } 27 | 28 | function _composite(t, i) { 29 | var s = ''; 30 | i = i === undefined ? 1 : i; 31 | for (; i < t.length; i++) s += typeof t[i] === 'string' ? t[i] : _t(t[i]); 32 | return s; 33 | } 34 | 35 | function _simple(t) { 36 | return t[1]; 37 | } 38 | 39 | var _unique = { 40 | 'arguments': function(t) { 41 | return '(' + _composite(t) + ')'; 42 | }, 43 | 'atkeyword': function(t) { 44 | return '@' + _t(t[1]); 45 | }, 46 | 'atruler': function(t) { 47 | return _t(t[1]) + _t(t[2]) + '{' + _t(t[3]) + '}'; 48 | }, 49 | 'attrib': function(t) { 50 | return '[' + _composite(t) + ']'; 51 | }, 52 | 'block': function(t) { 53 | return '{' + _composite(t) + '}'; 54 | }, 55 | 'braces': function(t) { 56 | return t[1] + _composite(t, 3) + t[2]; 57 | }, 58 | 'class': function(t) { 59 | return '.' + _t(t[1]); 60 | }, 61 | 'commentML': function (t) { 62 | return '/*' + t[1] + '*/'; 63 | }, 64 | 'filter': function(t) { 65 | return _t(t[1]) + ':' + _t(t[2]); 66 | }, 67 | 'functionExpression': function(t) { 68 | return 'expression(' + t[1] + ')'; 69 | }, 70 | 'important': function(t) { 71 | return '!' + _composite(t) + 'important'; 72 | }, 73 | 'nthselector': function(t) { 74 | return ':' + _simple(t[1]) + '(' + _composite(t, 2) + ')'; 75 | }, 76 | 'percentage': function(t) { 77 | return _t(t[1]) + '%'; 78 | }, 79 | 'pseudoc': function(t) { 80 | return ':' + _t(t[1]); 81 | }, 82 | 'pseudoe': function(t) { 83 | return '::' + _t(t[1]); 84 | }, 85 | 'shash': function (t) { 86 | return '#' + t[1]; 87 | }, 88 | 'uri': function(t) { 89 | return 'url(' + _composite(t) + ')'; 90 | }, 91 | 'vhash': function(t) { 92 | return '#' + t[1]; 93 | } 94 | }; 95 | 96 | return _t(tree); 97 | } 98 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | astToSrc: require('./ast-to-src'), 3 | astToString: require('./ast-to-string'), 4 | srcToAST: require('./src-to-ast') 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/lib/js/node-types.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | FUNCTION_BODY: 'functionBody', 3 | FUNCTION_DECLARATION: 'functionDeclaration', 4 | PARAMS: 'params', 5 | PROGRAM: 'program', 6 | SPACE: 'space', 7 | TEXT: 'text' 8 | }; 9 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/lib/js/stringify.js: -------------------------------------------------------------------------------- 1 | module.exports = function stringify(tree) { 2 | // TODO: Better error message 3 | if (!tree) throw new Error('We need tree to translate'); 4 | 5 | var _m_simple = { 6 | 'ident': 1, 7 | 'space': 1, 8 | 'text': 1 9 | }, 10 | _m_composite = { 11 | 'program': 1, 12 | }, 13 | _m_primitive = { 14 | }; 15 | 16 | function _t(tree) { 17 | var t = tree[0]; 18 | if (t in _m_primitive) return _m_primitive[t]; 19 | else if (t in _m_simple) return _simple(tree); 20 | else if (t in _m_composite) return _composite(tree); 21 | return _unique[t](tree); 22 | } 23 | 24 | function _composite(t, i) { 25 | var s = ''; 26 | i = i === undefined ? 1 : i; 27 | for (; i < t.length; i++) s += typeof t[i] === 'string' ? t[i] : _t(t[i]); 28 | return s; 29 | } 30 | 31 | function _simple(t) { 32 | return t[1]; 33 | } 34 | 35 | var _unique = { 36 | 'functionBody': function(t) { 37 | return '{' + t[1] + '}'; 38 | }, 39 | 'functionDeclaration': function(t) { 40 | return 'function' + _composite(t); 41 | }, 42 | 'params': function(t) { 43 | return '(' + t[1] + ')'; 44 | } 45 | }; 46 | 47 | return _t(tree); 48 | }; 49 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/lib/less/node-types.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ArgumentsType: 'arguments', 3 | AtkeywordType: 'atkeyword', 4 | AtrulebType: 'atruleb', 5 | AtrulerType: 'atruler', 6 | AtrulerqType: 'atrulerq', 7 | AtrulersType: 'atrulers', 8 | AtrulesType: 'atrules', 9 | AttribType: 'attrib', 10 | AttrselectorType: 'attrselector', 11 | BlockType: 'block', 12 | BracesType: 'braces', 13 | ClassType: 'class', 14 | CombinatorType: 'combinator', 15 | CommentMLType: 'commentML', 16 | CommentSLType: 'commentSL', 17 | ConditionType: 'condition', 18 | DeclarationType: 'declaration', 19 | DeclDelimType: 'declDelim', 20 | DelimType: 'delim', 21 | DimensionType: 'dimension', 22 | EscapedStringType: 'escapedString', 23 | FilterType: 'filter', 24 | FiltervType: 'filterv', 25 | FunctionType: 'function', 26 | FunctionExpressionType: 'functionExpression', 27 | IdentType: 'ident', 28 | ImportantType: 'important', 29 | IncludeType :'include', 30 | InterpolatedVariableType: 'interpolatedVariable', 31 | MixinType: 'mixin', 32 | NamespaceType: 'namespace', 33 | NthType: 'nth', 34 | NthselectorType: 'nthselector', 35 | NumberType: 'number', 36 | OperatorType: 'operator', 37 | ParentSelectorType: 'parentselector', 38 | PercentageType: 'percentage', 39 | ProgidType: 'progid', 40 | PropertyType: 'property', 41 | PropertyDelimType: 'propertyDelim', 42 | PseudocType: 'pseudoc', 43 | PseudoeType: 'pseudoe', 44 | RawType: 'raw', 45 | RulesetType: 'ruleset', 46 | SType: 's', 47 | SelectorType: 'selector', 48 | ShashType: 'shash', 49 | SimpleselectorType: 'simpleselector', 50 | StringType: 'string', 51 | StylesheetType: 'stylesheet', 52 | UnaryType: 'unary', 53 | UriType: 'uri', 54 | ValueType: 'value', 55 | VariableType: 'variable', 56 | VariablesListType: 'variableslist', 57 | VhashType: 'vhash' 58 | }; 59 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/lib/less/stringify.js: -------------------------------------------------------------------------------- 1 | module.exports = function stringify(tree) { 2 | // TODO: Better error message 3 | if (!tree) throw new Error('We need tree to translate'); 4 | 5 | var _m_simple = { 6 | 'attrselector': 1, 'combinator': 1, 'nth': 1, 'number': 1, 7 | 'operator': 1, 'raw': 1, 's': 1, 'string': 1, 'unary': 1 8 | }, 9 | _m_composite = { 10 | 'atruleb': 1, 'atrulerq': 1, 'atrulers': 1, 'atrules': 1,'condition': 1, 11 | 'declaration': 1, 'dimension': 1, 'filterv': 1, 'function': 1, 12 | 'ident': 1, 'include': 1, 'mixin': 1, 'selector': 1, 'progid': 1, 13 | 'property': 1, 'ruleset': 1, 'simpleselector': 1, 'stylesheet': 1, 14 | 'value': 1 15 | }, 16 | _m_primitive = { 17 | 'declDelim': ';', 'delim': ',', 18 | 'namespace': '|', 'parentselector': '&', 'propertyDelim' : ':' 19 | }; 20 | 21 | function _t(tree) { 22 | var t = tree[0]; 23 | if (t in _m_primitive) return _m_primitive[t]; 24 | else if (t in _m_simple) return _simple(tree); 25 | else if (t in _m_composite) return _composite(tree); 26 | return _unique[t](tree); 27 | } 28 | 29 | function _composite(t, i) { 30 | var s = ''; 31 | i = i === undefined ? 1 : i; 32 | for (; i < t.length; i++) s += typeof t[i] === 'string' ? t[i] : _t(t[i]); 33 | return s; 34 | } 35 | 36 | function _simple(t) { 37 | return t[1]; 38 | } 39 | 40 | var _unique = { 41 | 'arguments': function(t) { 42 | return '(' + _composite(t) + ')'; 43 | }, 44 | 'atkeyword': function(t) { 45 | return '@' + _t(t[1]); 46 | }, 47 | 'atruler': function(t) { 48 | return _t(t[1]) + _t(t[2]) + '{' + _t(t[3]) + '}'; 49 | }, 50 | 'attrib': function(t) { 51 | return '[' + _composite(t) + ']'; 52 | }, 53 | 'block': function(t) { 54 | return '{' + _composite(t) + '}'; 55 | }, 56 | 'braces': function(t) { 57 | return t[1] + _composite(t, 3) + t[2]; 58 | }, 59 | 'class': function(t) { 60 | return '.' + _t(t[1]); 61 | }, 62 | 'commentML': function (t) { 63 | return '/*' + t[1] + '*/'; 64 | }, 65 | 'commentSL': function (t) { 66 | return '/' + '/' + t[1]; 67 | }, 68 | 'escapedString': function(t) { 69 | return '~' + t[1]; 70 | }, 71 | 'filter': function(t) { 72 | return _t(t[1]) + ':' + _t(t[2]); 73 | }, 74 | 'functionExpression': function(t) { 75 | return 'expression(' + t[1] + ')'; 76 | }, 77 | 'important': function(t) { 78 | return '!' + _composite(t) + 'important'; 79 | }, 80 | 'interpolatedVariable': function(t) { 81 | return '@{' + _t(t[1]) + '}'; 82 | }, 83 | 'nthselector': function(t) { 84 | return ':' + _simple(t[1]) + '(' + _composite(t, 2) + ')'; 85 | }, 86 | 'percentage': function(t) { 87 | return _t(t[1]) + '%'; 88 | }, 89 | 'pseudoc': function(t) { 90 | return ':' + _t(t[1]); 91 | }, 92 | 'pseudoe': function(t) { 93 | return '::' + _t(t[1]); 94 | }, 95 | 'shash': function (t) { 96 | return '#' + t[1]; 97 | }, 98 | 'uri': function(t) { 99 | return 'url(' + _composite(t) + ')'; 100 | }, 101 | 'variable': function(t) { 102 | return '@' + _t(t[1]); 103 | }, 104 | 'variableslist': function(t) { 105 | return _t(t[1]) + '...'; 106 | }, 107 | 'vhash': function(t) { 108 | return '#' + t[1]; 109 | } 110 | }; 111 | 112 | return _t(tree); 113 | } 114 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/node-types.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ArgumentsType: 'arguments', 3 | AtkeywordType: 'atkeyword', 4 | AtrulebType: 'atruleb', 5 | AtrulerType: 'atruler', 6 | AtrulerqType: 'atrulerq', 7 | AtrulersType: 'atrulers', 8 | AtrulesType: 'atrules', 9 | AttribType: 'attrib', 10 | AttrselectorType: 'attrselector', 11 | BlockType: 'block', 12 | BracesType: 'braces', 13 | ClassType: 'class', 14 | CombinatorType: 'combinator', 15 | CommentMLType: 'commentML', 16 | CommentSLType: 'commentSL', 17 | ConditionType: 'condition', 18 | ConditionalStatementType: 'conditionalStatement', 19 | DeclarationType: 'declaration', 20 | DeclDelimType: 'declDelim', 21 | DefaultType: 'default', 22 | DelimType: 'delim', 23 | DimensionType: 'dimension', 24 | FilterType: 'filter', 25 | FiltervType: 'filterv', 26 | FunctionType: 'function', 27 | FunctionExpressionType: 'functionExpression', 28 | IdentType: 'ident', 29 | ImportantType: 'important', 30 | IncludeType :'include', 31 | InterpolationType: 'interpolation', 32 | LoopType: 'loop', 33 | MixinType: 'mixin', 34 | NamespaceType: 'namespace', 35 | NthType: 'nth', 36 | NthselectorType: 'nthselector', 37 | NumberType: 'number', 38 | OperatorType: 'operator', 39 | ParentSelectorType: 'parentselector', 40 | PercentageType: 'percentage', 41 | PlaceholderType: 'placeholder', 42 | ProgidType: 'progid', 43 | PropertyType: 'property', 44 | PropertyDelimType: 'propertyDelim', 45 | PseudocType: 'pseudoc', 46 | PseudoeType: 'pseudoe', 47 | RawType: 'raw', 48 | RulesetType: 'ruleset', 49 | SType: 's', 50 | SelectorType: 'selector', 51 | ShashType: 'shash', 52 | SimpleselectorType: 'simpleselector', 53 | StringType: 'string', 54 | StylesheetType: 'stylesheet', 55 | UnaryType: 'unary', 56 | UriType: 'uri', 57 | ValueType: 'value', 58 | VariableType: 'variable', 59 | VariablesListType: 'variableslist', 60 | VhashType: 'vhash' 61 | }; 62 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/stringify.js: -------------------------------------------------------------------------------- 1 | module.exports = function stringify(tree) { 2 | // TODO: Better error message 3 | if (!tree) throw new Error('We need tree to translate'); 4 | 5 | var _m_simple = { 6 | 'attrselector': 1, 'combinator': 1, 'nth': 1, 'number': 1, 7 | 'operator': 1, 'raw': 1, 's': 1, 'string': 1, 'unary': 1 8 | }, 9 | _m_composite = { 10 | 'atruleb': 1, 'atrulerq': 1, 'atrulers': 1, 'atrules': 1,'condition': 1, 11 | 'conditionalStatement': 1, 12 | 'declaration': 1, 'dimension': 1, 'filterv': 1, 'function': 1, 13 | 'ident': 1, 'include': 1, 14 | 'loop': 1, 'mixin': 1, 'selector': 1, 'progid': 1, 'property': 1, 15 | 'ruleset': 1, 'simpleselector': 1, 'stylesheet': 1, 'value': 1 16 | }, 17 | _m_primitive = { 18 | 'declDelim': '\n', 'delim': ',', 19 | 'namespace': '|', 'parentselector': '&', 'propertyDelim' : ':' 20 | }; 21 | 22 | function _t(tree) { 23 | var t = tree[0]; 24 | if (t in _m_primitive) return _m_primitive[t]; 25 | else if (t in _m_simple) return _simple(tree); 26 | else if (t in _m_composite) return _composite(tree); 27 | return _unique[t](tree); 28 | } 29 | 30 | function _composite(t, i) { 31 | var s = ''; 32 | i = i === undefined ? 1 : i; 33 | for (; i < t.length; i++) s += typeof t[i] === 'string' ? t[i] : _t(t[i]); 34 | return s; 35 | } 36 | 37 | function _simple(t) { 38 | return t[1]; 39 | } 40 | 41 | var _unique = { 42 | 'arguments': function(t) { 43 | return '(' + _composite(t) + ')'; 44 | }, 45 | 'atkeyword': function(t) { 46 | return '@' + _t(t[1]); 47 | }, 48 | 'atruler': function(t) { 49 | return _t(t[1]) + _t(t[2]) + '{' + _t(t[3]) + '}'; 50 | }, 51 | 'attrib': function(t) { 52 | return '[' + _composite(t) + ']'; 53 | }, 54 | 'block': function(t) { 55 | return _composite(t); 56 | }, 57 | 'braces': function(t) { 58 | return t[1] + _composite(t, 3) + t[2]; 59 | }, 60 | 'class': function(t) { 61 | return '.' + _t(t[1]); 62 | }, 63 | 'commentML': function (t) { 64 | return '/*' + t[1]; 65 | }, 66 | 'commentSL': function (t) { 67 | return '/' + '/' + t[1]; 68 | }, 69 | 'default': function(t) { 70 | return '!' + _composite(t) + 'default'; 71 | }, 72 | 'filter': function(t) { 73 | return _t(t[1]) + ':' + _t(t[2]); 74 | }, 75 | 'functionExpression': function(t) { 76 | return 'expression(' + t[1] + ')'; 77 | }, 78 | 'important': function(t) { 79 | return '!' + _composite(t) + 'important'; 80 | }, 81 | 'interpolation': function(t) { 82 | return '#{' + _t(t[1]) + '}'; 83 | }, 84 | 'nthselector': function(t) { 85 | return ':' + _simple(t[1]) + '(' + _composite(t, 2) + ')'; 86 | }, 87 | 'percentage': function(t) { 88 | return _t(t[1]) + '%'; 89 | }, 90 | 'placeholder': function(t) { 91 | return '%' + _t(t[1]); 92 | }, 93 | 'pseudoc': function(t) { 94 | return ':' + _t(t[1]); 95 | }, 96 | 'pseudoe': function(t) { 97 | return '::' + _t(t[1]); 98 | }, 99 | 'shash': function (t) { 100 | return '#' + t[1]; 101 | }, 102 | 'uri': function(t) { 103 | return 'url(' + _composite(t) + ')'; 104 | }, 105 | 'variable': function(t) { 106 | return '$' + _t(t[1]); 107 | }, 108 | 'variableslist': function(t) { 109 | return _t(t[1]) + '...'; 110 | }, 111 | 'vhash': function(t) { 112 | return '#' + t[1]; 113 | } 114 | }; 115 | 116 | return _t(tree); 117 | } 118 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/node-types.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ArgumentsType: 'arguments', 3 | AtkeywordType: 'atkeyword', 4 | AtrulebType: 'atruleb', 5 | AtrulerType: 'atruler', 6 | AtrulerqType: 'atrulerq', 7 | AtrulersType: 'atrulers', 8 | AtrulesType: 'atrules', 9 | AttribType: 'attrib', 10 | AttrselectorType: 'attrselector', 11 | BlockType: 'block', 12 | BracesType: 'braces', 13 | ClassType: 'class', 14 | CombinatorType: 'combinator', 15 | CommentMLType: 'commentML', 16 | CommentSLType: 'commentSL', 17 | ConditionType: 'condition', 18 | ConditionalStatementType: 'conditionalStatement', 19 | DeclarationType: 'declaration', 20 | DeclDelimType: 'declDelim', 21 | DefaultType: 'default', 22 | DelimType: 'delim', 23 | DimensionType: 'dimension', 24 | FilterType: 'filter', 25 | FiltervType: 'filterv', 26 | FunctionType: 'function', 27 | FunctionExpressionType: 'functionExpression', 28 | IdentType: 'ident', 29 | ImportantType: 'important', 30 | IncludeType :'include', 31 | InterpolationType: 'interpolation', 32 | LoopType: 'loop', 33 | MixinType: 'mixin', 34 | NamespaceType: 'namespace', 35 | NthType: 'nth', 36 | NthselectorType: 'nthselector', 37 | NumberType: 'number', 38 | OperatorType: 'operator', 39 | ParentSelectorType: 'parentselector', 40 | PercentageType: 'percentage', 41 | PlaceholderType: 'placeholder', 42 | ProgidType: 'progid', 43 | PropertyType: 'property', 44 | PropertyDelimType: 'propertyDelim', 45 | PseudocType: 'pseudoc', 46 | PseudoeType: 'pseudoe', 47 | RawType: 'raw', 48 | RulesetType: 'ruleset', 49 | SType: 's', 50 | SelectorType: 'selector', 51 | ShashType: 'shash', 52 | SimpleselectorType: 'simpleselector', 53 | StringType: 'string', 54 | StylesheetType: 'stylesheet', 55 | UnaryType: 'unary', 56 | UriType: 'uri', 57 | ValueType: 'value', 58 | VariableType: 'variable', 59 | VariablesListType: 'variableslist', 60 | VhashType: 'vhash' 61 | }; 62 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/stringify.js: -------------------------------------------------------------------------------- 1 | module.exports = function stringify(tree) { 2 | // TODO: Better error message 3 | if (!tree) throw new Error('We need tree to translate'); 4 | 5 | var _m_simple = { 6 | 'attrselector': 1, 'combinator': 1, 'nth': 1, 'number': 1, 7 | 'operator': 1, 'raw': 1, 's': 1, 'string': 1, 'unary': 1 8 | }, 9 | _m_composite = { 10 | 'atruleb': 1, 'atrulerq': 1, 'atrulers': 1, 'atrules': 1,'condition': 1, 11 | 'conditionalStatement': 1, 12 | 'declaration': 1, 'dimension': 1, 'filterv': 1, 'function': 1, 13 | 'ident': 1, 'include': 1, 14 | 'loop': 1, 'mixin': 1, 'selector': 1, 'progid': 1, 'property': 1, 15 | 'ruleset': 1, 'simpleselector': 1, 'stylesheet': 1, 'value': 1 16 | }, 17 | _m_primitive = { 18 | 'declDelim': ';', 'delim': ',', 19 | 'namespace': '|', 'parentselector': '&', 'propertyDelim' : ':' 20 | }; 21 | 22 | function _t(tree) { 23 | var t = tree[0]; 24 | if (t in _m_primitive) return _m_primitive[t]; 25 | else if (t in _m_simple) return _simple(tree); 26 | else if (t in _m_composite) return _composite(tree); 27 | return _unique[t](tree); 28 | } 29 | 30 | function _composite(t, i) { 31 | var s = ''; 32 | i = i === undefined ? 1 : i; 33 | for (; i < t.length; i++) s += typeof t[i] === 'string' ? t[i] : _t(t[i]); 34 | return s; 35 | } 36 | 37 | function _simple(t) { 38 | return t[1]; 39 | } 40 | 41 | var _unique = { 42 | 'arguments': function(t) { 43 | return '(' + _composite(t) + ')'; 44 | }, 45 | 'atkeyword': function(t) { 46 | return '@' + _t(t[1]); 47 | }, 48 | 'atruler': function(t) { 49 | return _t(t[1]) + _t(t[2]) + '{' + _t(t[3]) + '}'; 50 | }, 51 | 'attrib': function(t) { 52 | return '[' + _composite(t) + ']'; 53 | }, 54 | 'block': function(t) { 55 | return '{' + _composite(t) + '}'; 56 | }, 57 | 'braces': function(t) { 58 | return t[1] + _composite(t, 3) + t[2]; 59 | }, 60 | 'class': function(t) { 61 | return '.' + _t(t[1]); 62 | }, 63 | 'commentML': function (t) { 64 | return '/*' + t[1] + '*/'; 65 | }, 66 | 'commentSL': function (t) { 67 | return '/' + '/' + t[1]; 68 | }, 69 | 'default': function(t) { 70 | return '!' + _composite(t) + 'default'; 71 | }, 72 | 'filter': function(t) { 73 | return _t(t[1]) + ':' + _t(t[2]); 74 | }, 75 | 'functionExpression': function(t) { 76 | return 'expression(' + t[1] + ')'; 77 | }, 78 | 'important': function(t) { 79 | return '!' + _composite(t) + 'important'; 80 | }, 81 | 'interpolation': function(t) { 82 | return '#{' + _t(t[1]) + '}'; 83 | }, 84 | 'nthselector': function(t) { 85 | return ':' + _simple(t[1]) + '(' + _composite(t, 2) + ')'; 86 | }, 87 | 'percentage': function(t) { 88 | return _t(t[1]) + '%'; 89 | }, 90 | 'placeholder': function(t) { 91 | return '%' + _t(t[1]); 92 | }, 93 | 'pseudoc': function(t) { 94 | return ':' + _t(t[1]); 95 | }, 96 | 'pseudoe': function(t) { 97 | return '::' + _t(t[1]); 98 | }, 99 | 'shash': function (t) { 100 | return '#' + t[1]; 101 | }, 102 | 'uri': function(t) { 103 | return 'url(' + _composite(t) + ')'; 104 | }, 105 | 'variable': function(t) { 106 | return '$' + _t(t[1]); 107 | }, 108 | 'variableslist': function(t) { 109 | return _t(t[1]) + '...'; 110 | }, 111 | 'vhash': function(t) { 112 | return '#' + t[1]; 113 | } 114 | }; 115 | 116 | return _t(tree); 117 | } 118 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/lib/src-to-ast.js: -------------------------------------------------------------------------------- 1 | module.exports = (function() { 2 | function throwError(e, src) { 3 | var line = e.line; 4 | var name = 'Parsing error'; 5 | var version = require('../package.json').version; 6 | var message = formatErrorMessage(src, line, version); 7 | var error = { 8 | line: line, 9 | syntax: e.syntax, 10 | version: version, 11 | name: name, 12 | message: message 13 | } 14 | error.toString = function() {return this.name + ': ' + this.message;}; 15 | throw error; 16 | } 17 | 18 | function formatErrorMessage(text, ln, version) { 19 | var message = ['Please check the validity of the block starting from line #' + ln]; 20 | 21 | message.push(''); 22 | var code = formatCodeFragment(text, ln); 23 | message = message.concat(code); 24 | message.push(''); 25 | 26 | message.push('Gonzales PE version: ' + version); 27 | 28 | return message.join('\n'); 29 | } 30 | 31 | function formatCodeFragment(text, lineNumber) { 32 | var lines = text.split(/\r\n|\r|\n/); 33 | var linesAround = 2; 34 | var result = []; 35 | 36 | for (var i = lineNumber - 1 - linesAround; i < lineNumber + linesAround; i++) { 37 | var line = lines[i]; 38 | if (!line) continue; 39 | var ln = i + 1; 40 | var mark = ln === lineNumber ? '*' : ' '; 41 | result.push(ln + mark + '| ' + line); 42 | } 43 | 44 | return result; 45 | } 46 | 47 | return function(options) { 48 | var src, rule, syntax, getTokens, mark, rules, tokens, ast; 49 | 50 | if (!options || !options.src) throw new Error('Please, pass a string to parse'); 51 | 52 | src = typeof options === 'string' ? options : options.src; 53 | syntax = options.syntax || 'css'; 54 | rule = options.rule || (syntax === 'js' ? 'program' : 'stylesheet'); 55 | 56 | var fs = require('fs'); 57 | if (!fs.existsSync(__dirname + '/' + syntax)) 58 | return console.error('Syntax "' + syntax + '" is not supported yet, sorry'); 59 | 60 | getTokens = require('./' + syntax + '/tokenizer'); 61 | mark = require('./' + syntax + '/mark'); 62 | rules = require('./' + syntax + '/rules'); 63 | 64 | tokens = getTokens(src); 65 | mark(tokens); 66 | 67 | try { 68 | ast = rules(tokens, rule); 69 | } catch (e) { 70 | throwError(e, src); 71 | } 72 | 73 | return ast; 74 | } 75 | })(); 76 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/lib/token-types.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | StringSQ: 'StringSQ', 3 | StringDQ: 'StringDQ', 4 | CommentML: 'CommentML', 5 | CommentSL: 'CommentSL', 6 | 7 | Newline: 'Newline', 8 | Space: 'Space', 9 | Tab: 'Tab', 10 | 11 | ExclamationMark: 'ExclamationMark', // ! 12 | QuotationMark: 'QuotationMark', // " 13 | NumberSign: 'NumberSign', // # 14 | DollarSign: 'DollarSign', // $ 15 | PercentSign: 'PercentSign', // % 16 | Ampersand: 'Ampersand', // & 17 | Apostrophe: 'Apostrophe', // ' 18 | LeftParenthesis: 'LeftParenthesis', // ( 19 | RightParenthesis: 'RightParenthesis', // ) 20 | Asterisk: 'Asterisk', // * 21 | PlusSign: 'PlusSign', // + 22 | Comma: 'Comma', // , 23 | HyphenMinus: 'HyphenMinus', // - 24 | FullStop: 'FullStop', // . 25 | Solidus: 'Solidus', // / 26 | Colon: 'Colon', // : 27 | Semicolon: 'Semicolon', // ; 28 | LessThanSign: 'LessThanSign', // < 29 | EqualsSign: 'EqualsSign', // = 30 | GreaterThanSign: 'GreaterThanSign', // > 31 | QuestionMark: 'QuestionMark', // ? 32 | CommercialAt: 'CommercialAt', // @ 33 | LeftSquareBracket: 'LeftSquareBracket', // [ 34 | ReverseSolidus: 'ReverseSolidus', // \ 35 | RightSquareBracket: 'RightSquareBracket', // ] 36 | CircumflexAccent: 'CircumflexAccent', // ^ 37 | LowLine: 'LowLine', // _ 38 | LeftCurlyBracket: 'LeftCurlyBracket', // { 39 | VerticalLine: 'VerticalLine', // | 40 | RightCurlyBracket: 'RightCurlyBracket', // } 41 | Tilde: 'Tilde', // ~ 42 | 43 | Identifier: 'Identifier', 44 | DecimalNumber: 'DecimalNumber' 45 | }; 46 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/gonzales-pe/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gonzales-pe", 3 | "description": "Gonzales Preprocessor Edition (fast CSS parser)", 4 | "version": "3.0.0-10", 5 | "homepage": "http://github.com/tonyganch/gonzales-pe", 6 | "bugs": { 7 | "url": "http://github.com/tonyganch/gonzales-pe/issues" 8 | }, 9 | "license": "MIT", 10 | "author": { 11 | "name": "Tony Ganch", 12 | "email": "tonyganch+github@gmail.com", 13 | "url": "http://tonyganch.com" 14 | }, 15 | "main": "./lib/gonzales", 16 | "repository": { 17 | "type": "git", 18 | "url": "http://github.com/tonyganch/gonzales-pe.git" 19 | }, 20 | "scripts": { 21 | "test": "(mkdir -p log && node ./test/mocha.js) | tee ./log/test.log" 22 | }, 23 | "bin": { 24 | "gonzales": "./bin/gonzales.js" 25 | }, 26 | "devDependencies": { 27 | "benchmark": "~1.0.0", 28 | "coffee-script": "~1.7.1", 29 | "microtime": "~0.3.3", 30 | "mocha": "~1.20.0" 31 | }, 32 | "engines": { 33 | "node": ">=0.6.0" 34 | }, 35 | "gitHead": "8d860d993f2a645644c0e5bc0d59951cdb64990b", 36 | "_id": "gonzales-pe@3.0.0-10", 37 | "_shasum": "6dac1b7e4070118042de92c6ff7a8fc346255dde", 38 | "_from": "gonzales-pe@3.0.0-10", 39 | "_npmVersion": "1.5.0-alpha-1", 40 | "_npmUser": { 41 | "name": "tonyganch", 42 | "email": "tonyganch+github@gmail.com" 43 | }, 44 | "maintainers": [ 45 | { 46 | "name": "tonyganch", 47 | "email": "tonyganch@gmail.com" 48 | } 49 | ], 50 | "dist": { 51 | "shasum": "6dac1b7e4070118042de92c6ff7a8fc346255dde", 52 | "tarball": "http://npm.oa.com/attachments/gonzales-pe/-/gonzales-pe-3.0.0-10.tgz" 53 | }, 54 | "directories": {}, 55 | "_resolved": "http://npm.oa.com/attachments/gonzales-pe/-/gonzales-pe-3.0.0-10.tgz" 56 | } 57 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/node_modules/vow/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vow", 3 | "version": "0.4.4", 4 | "description": "DOM Promise and Promises/A+ implementation for Node.js and browsers", 5 | "homepage": "https://github.com/dfilatov/vow", 6 | "keywords": [ 7 | "nodejs", 8 | "browser", 9 | "async", 10 | "promise", 11 | "dom", 12 | "a+" 13 | ], 14 | "author": { 15 | "name": "Dmitry Filatov", 16 | "email": "dfilatov@yandex-team.ru" 17 | }, 18 | "contributors": [ 19 | { 20 | "name": "Dmitry Filatov", 21 | "email": "dfilatov@yandex-team.ru" 22 | } 23 | ], 24 | "repository": { 25 | "type": "git", 26 | "url": "http://github.com/dfilatov/vow.git" 27 | }, 28 | "dependencies": {}, 29 | "devDependencies": { 30 | "nodeunit": "", 31 | "istanbul": "", 32 | "uglify-js": "1.3.4", 33 | "promises-aplus-tests": "2.0.3", 34 | "marked": "0.2.10", 35 | "jspath": "0.2.11", 36 | "yate": "0.0.65", 37 | "highlight.js": "7.5.0", 38 | "bem-jsd": "1.3.1" 39 | }, 40 | "main": "lib/vow", 41 | "engines": { 42 | "node": ">= 0.4.0" 43 | }, 44 | "scripts": { 45 | "test": "./node_modules/istanbul/lib/cli.js test test/utils/runner.js" 46 | }, 47 | "enb": { 48 | "sources": [ 49 | "lib/vow.js" 50 | ] 51 | }, 52 | "bugs": { 53 | "url": "https://github.com/dfilatov/vow/issues" 54 | }, 55 | "_id": "vow@0.4.4", 56 | "dist": { 57 | "shasum": "c9fe4609129d7f5aa621508ebe64b51c95bc7b98", 58 | "tarball": "http://npm.oa.com/attachments/vow/-/vow-0.4.4.tgz" 59 | }, 60 | "_from": "vow@0.4.4", 61 | "_npmVersion": "1.3.21", 62 | "_npmUser": { 63 | "name": "dfilatov", 64 | "email": "dfilatov@yandex-team.ru" 65 | }, 66 | "maintainers": [ 67 | { 68 | "name": "dfilatov", 69 | "email": "dfilatov@yandex-team.ru" 70 | } 71 | ], 72 | "directories": {}, 73 | "_shasum": "c9fe4609129d7f5aa621508ebe64b51c95bc7b98", 74 | "_resolved": "http://npm.oa.com/attachments/vow/-/vow-0.4.4.tgz" 75 | } 76 | -------------------------------------------------------------------------------- /node_modules/cssorder/node_modules/csscomb/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "csscomb", 3 | "description": "CSS coding style formatter", 4 | "version": "3.0.4", 5 | "homepage": "http://csscomb.com/", 6 | "author": { 7 | "name": "Mikhail Troshev", 8 | "email": "mishanga@yandex-team.ru" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/csscomb/csscomb.js" 13 | }, 14 | "maintainers": [ 15 | { 16 | "name": "csscomb", 17 | "email": "hello@csscomb.com" 18 | }, 19 | { 20 | "name": "miripiruni", 21 | "email": "miripiruni@gmail.com" 22 | }, 23 | { 24 | "name": "mishanga", 25 | "email": "mishanga@yandex-team.ru" 26 | }, 27 | { 28 | "name": "tonyganch", 29 | "email": "tonyganch+github@gmail.com" 30 | } 31 | ], 32 | "contributors": [ 33 | { 34 | "name": "Sergey Puzankov", 35 | "email": "puzankov@yandex-team.ru" 36 | }, 37 | { 38 | "name": "Denis Payase", 39 | "email": "lostsoul@yandex-team.ru" 40 | }, 41 | { 42 | "name": "Igor Novak", 43 | "email": "bezengi@gmail.com" 44 | }, 45 | { 46 | "name": "Roman Komarov", 47 | "email": "kizmarh@ya.ru" 48 | } 49 | ], 50 | "engines": { 51 | "node": ">= 0.10.0" 52 | }, 53 | "dependencies": { 54 | "commander": "2.0.0", 55 | "csscomb-core": "~2.0.0", 56 | "gonzales-pe": "3.0.0-10", 57 | "vow": "0.4.4" 58 | }, 59 | "devDependencies": { 60 | "jshint-groups": "0.5.3", 61 | "jshint": "2.3.0", 62 | "jscs": "1.4.5", 63 | "mocha": "1.14.0" 64 | }, 65 | "main": "./lib/csscomb.js", 66 | "files": [ 67 | "bin", 68 | "config", 69 | "lib" 70 | ], 71 | "bin": { 72 | "csscomb": "./bin/csscomb" 73 | }, 74 | "scripts": { 75 | "test": "jshint-groups && ./node_modules/.bin/jscs . && node test/mocha", 76 | "test-cov": "rm -rf lib-cov && jscoverage lib lib-cov && TEST_COV=true node test/mocha > ./test/test-coverage.html" 77 | }, 78 | "gitHead": "8f26d8e44d0c44c2f73aaa8cb7598df63d737eea", 79 | "bugs": { 80 | "url": "https://github.com/csscomb/csscomb.js/issues" 81 | }, 82 | "_id": "csscomb@3.0.4", 83 | "_shasum": "a476e734256870fdb895b0747950b722668cbec6", 84 | "_from": "csscomb@>=3.0.4 <3.1.0", 85 | "_npmVersion": "1.5.0-alpha-1", 86 | "_npmUser": { 87 | "name": "tonyganch", 88 | "email": "tonyganch+github@gmail.com" 89 | }, 90 | "dist": { 91 | "shasum": "a476e734256870fdb895b0747950b722668cbec6", 92 | "tarball": "http://npm.oa.com/attachments/csscomb/-/csscomb-3.0.4.tgz" 93 | }, 94 | "directories": {}, 95 | "_resolved": "http://npm.oa.com/attachments/csscomb/-/csscomb-3.0.4.tgz", 96 | "readme": "ERROR: No README data found!" 97 | } 98 | -------------------------------------------------------------------------------- /node_modules/cssorder/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cssorder", 3 | "description": "Auto formatting css code tool", 4 | "version": "0.2.0", 5 | "homepage": "https://github.com/lightningtgc/cssorder", 6 | "author": "gctang ", 7 | "repository": "https://github.com/lightningtgc/cssorder", 8 | "engines": { 9 | "node": ">= 0.10.0" 10 | }, 11 | "dependencies": { 12 | "csscomb": "~3.0.4", 13 | "commander": "2.0.0", 14 | "csscomb-core": "~2.0.0", 15 | "gonzales-pe": "3.0.0-10", 16 | "vow": "0.4.4" 17 | }, 18 | "main": "./src/cssorder.js", 19 | "bin": { 20 | "cssorder": "./bin/cssorder" 21 | }, 22 | "files": [ 23 | "bin", 24 | "src" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /node_modules/cssorder/src/cli.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Command line implementation for CSSOrder 3 | * 4 | * Usage example: 5 | * ./node_modules/.bin/cssorder [options] file1 [dir1 [fileN [dirN]]] 6 | */ 7 | var fs = require('fs'); 8 | var path = require('path'); 9 | var program = require('commander'); 10 | var vow = require('vow'); 11 | var CSSOrder = require('./cssorder'); 12 | 13 | program 14 | .version(require('../package.json').version) 15 | .usage('[options] ') 16 | .option('-v, --verbose', 'verbose mode') 17 | .option('-c, --config [path]', 'configuration file path') 18 | .option('-d, --detect', 'detect mode (would return detected options)') 19 | .option('-l, --lint', 'in case some fixes needed returns an error') 20 | .parse(process.argv); 21 | 22 | if (!program.args.length) { 23 | console.log('No input paths specified'); 24 | program.help(); 25 | } 26 | 27 | var cssorder = new CSSOrder(); 28 | 29 | if (program.detect) { 30 | console.log(JSON.stringify(CSSOrder.detectInFile(program.args[0]), false, 4)); 31 | process.exit(0); 32 | } 33 | 34 | var config; 35 | var configPath = program.config && 36 | path.resolve(process.cwd(), program.config) || 37 | CSSOrder.getCustomConfigPath(); 38 | 39 | if (!fs.existsSync(configPath)) { 40 | config = require('./config/config.json'); 41 | } else if (configPath.match(/\.css$/)) { 42 | config = CSSOrder.detectInFile(configPath); 43 | } else { 44 | config = CSSOrder.getCustomConfig(configPath); 45 | } 46 | 47 | if (!config) { 48 | console.log('Configuration file ' + configPath + ' was not found.'); 49 | process.exit(1); 50 | } 51 | 52 | if (config.template) { 53 | if (fs.existsSync(config.template)) { 54 | var templateConfig = CSSOrder.detectInFile(config.template); 55 | for (var attrname in templateConfig) { 56 | if (!config[attrname]) { 57 | config[attrname] = templateConfig[attrname]; 58 | } 59 | } 60 | } else { 61 | console.log('Template configuration file ' + config.template + ' was not found.'); 62 | process.exit(1); 63 | } 64 | } 65 | 66 | console.time('spent'); 67 | 68 | config.verbose = program.verbose === true || config.verbose; 69 | config.lint = program.lint; 70 | 71 | cssorder.configure(config); 72 | 73 | vow.all(program.args.map(cssorder.processPath.bind(cssorder))) 74 | .then(function(changedFiles) { 75 | changedFiles = [].concat.apply([], changedFiles) 76 | .filter(function(isChanged) { 77 | return isChanged !== undefined; 78 | }); 79 | 80 | for (var i = changedFiles.length, tbchanged = 0; i--;) { 81 | tbchanged += changedFiles[i]; 82 | } 83 | 84 | var changed = config.lint ? 0 : tbchanged; 85 | 86 | if (config.verbose) { 87 | console.log(''); 88 | console.log(changedFiles.length + ' file' + (changedFiles.length === 1 ? '' : 's') + ' processed'); 89 | console.log(changed + ' file' + (changed === 1 ? '' : 's') + ' fixed'); 90 | console.timeEnd('spent'); 91 | } 92 | 93 | if (config.lint && tbchanged) { 94 | process.exit(1); 95 | } 96 | }) 97 | .fail(function(e) { 98 | console.log('stack: ', e.stack); 99 | process.exit(1); 100 | }); 101 | 102 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sublime-cssorder", 3 | "version": "0.5.0", 4 | "author": "gctang", 5 | "description": "Alloyteam CSS coding style formatter.", 6 | "homepage": "https://github.com/lightningtgc/sublime-cssorder", 7 | "dependencies": { 8 | "cssorder": "0.2.0" 9 | }, 10 | "license": "MIT" 11 | } 12 | --------------------------------------------------------------------------------