├── .editorconfig ├── .gitattributes ├── .no-sublime-package ├── Context.sublime-menu ├── Default (Linux).sublime-keymap ├── Default (OSX).sublime-keymap ├── Default (Windows).sublime-keymap ├── Main.sublime-menu ├── Readme.md ├── license ├── messages.json ├── messages ├── changelog.txt └── install.txt ├── node_bridge.py ├── node_modules ├── .bin │ └── perfectionist ├── get-stdin │ ├── index.js │ ├── package.json │ └── readme.md ├── perfectionist │ ├── CHANGELOG.md │ ├── LICENSE-MIT │ ├── README.md │ ├── bin │ │ ├── cmd.js │ │ └── usage.txt │ ├── dist │ │ ├── deeplyNested.js │ │ ├── getIndent.js │ │ ├── index.js │ │ ├── longest.js │ │ ├── maxSelectorLength.js │ │ ├── prefixedDecls.js │ │ ├── sameLine.js │ │ └── space.js │ ├── node_modules │ │ ├── comment-regex │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ └── readme.md │ │ ├── minimist │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── example │ │ │ │ └── parse.js │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ ├── readme.markdown │ │ │ └── test │ │ │ │ ├── all_bool.js │ │ │ │ ├── bool.js │ │ │ │ ├── dash.js │ │ │ │ ├── default_bool.js │ │ │ │ ├── dotted.js │ │ │ │ ├── kv_short.js │ │ │ │ ├── long.js │ │ │ │ ├── num.js │ │ │ │ ├── parse.js │ │ │ │ ├── parse_modified.js │ │ │ │ ├── short.js │ │ │ │ ├── stop_early.js │ │ │ │ ├── unknown.js │ │ │ │ └── whitespace.js │ │ ├── object-assign │ │ │ ├── index.js │ │ │ ├── license │ │ │ ├── package.json │ │ │ └── readme.md │ │ ├── read-file-stdin │ │ │ ├── .npmignore │ │ │ ├── History.md │ │ │ ├── Makefile │ │ │ ├── Readme.md │ │ │ ├── index.js │ │ │ ├── node_modules │ │ │ │ └── gather-stream │ │ │ │ │ ├── README.md │ │ │ │ │ ├── index.js │ │ │ │ │ └── package.json │ │ │ ├── package.json │ │ │ └── test │ │ │ │ ├── fixtures │ │ │ │ ├── big.txt │ │ │ │ └── simple.txt │ │ │ │ └── index.js │ │ ├── string.prototype.repeat │ │ │ ├── LICENSE-MIT.txt │ │ │ ├── README.md │ │ │ ├── package.json │ │ │ └── repeat.js │ │ └── write-file-stdout │ │ │ ├── .npmignore │ │ │ ├── History.md │ │ │ ├── Makefile │ │ │ ├── Readme.md │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ └── test │ │ │ └── index.js │ └── package.json ├── postcss-safe-parser │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── safe-parse.js │ │ ├── safe-parser.js │ │ └── safe-tokenize.js │ └── package.json ├── postcss-scss │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── scss-parse.js │ │ ├── scss-parser.js │ │ ├── scss-stringifier.js │ │ ├── scss-stringify.js │ │ ├── scss-syntax.js │ │ └── scss-tokenize.js │ └── package.json └── postcss │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── d.ts │ ├── at-rule.d.ts │ ├── comment.d.ts │ ├── container.d.ts │ ├── css-syntax-error.d.ts │ ├── declaration.d.ts │ ├── input.d.ts │ ├── lazy-result.d.ts │ ├── list.d.ts │ ├── map-generator.d.ts │ ├── node.d.ts │ ├── parse.d.ts │ ├── parser.d.ts │ ├── postcss.d.ts │ ├── previous-map.d.ts │ ├── processor.d.ts │ ├── result.d.ts │ ├── root.d.ts │ ├── rule.d.ts │ ├── stringifier.d.ts │ ├── stringify.d.ts │ ├── tokenize.d.ts │ ├── vendor.d.ts │ ├── warn-once.d.ts │ └── warning.d.ts │ ├── docs │ ├── api.md │ ├── guidelines │ │ ├── plugin.md │ │ └── runner.md │ └── syntax.md │ ├── lib │ ├── at-rule.js │ ├── comment.js │ ├── container.js │ ├── css-syntax-error.js │ ├── declaration.js │ ├── input.js │ ├── lazy-result.js │ ├── list.js │ ├── map-generator.js │ ├── node.js │ ├── parse.js │ ├── parser.js │ ├── postcss.js │ ├── previous-map.js │ ├── processor.js │ ├── result.js │ ├── root.js │ ├── rule.js │ ├── stringifier.js │ ├── stringify.js │ ├── tokenize.js │ ├── vendor.js │ ├── warn-once.js │ └── warning.js │ ├── node_modules │ ├── js-base64 │ │ ├── .npmignore │ │ ├── .travis.yml │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── base64.html │ │ ├── base64.js │ │ ├── base64.min.js │ │ ├── base64_utf8 │ │ ├── bower.json │ │ ├── old │ │ │ └── base64-1.7.js │ │ ├── package.js │ │ ├── package.json │ │ └── test │ │ │ ├── dankogai.js │ │ │ ├── es5.js │ │ │ ├── index.html │ │ │ ├── large.js │ │ │ └── yoshinoya.js │ ├── source-map │ │ ├── README.md │ │ ├── build │ │ │ ├── assert-shim.js │ │ │ ├── mini-require.js │ │ │ ├── prefix-source-map.jsm │ │ │ ├── prefix-utils.jsm │ │ │ ├── suffix-browser.js │ │ │ ├── suffix-source-map.jsm │ │ │ ├── suffix-utils.jsm │ │ │ ├── test-prefix.js │ │ │ └── test-suffix.js │ │ ├── lib │ │ │ ├── source-map.js │ │ │ └── source-map │ │ │ │ ├── array-set.js │ │ │ │ ├── base64-vlq.js │ │ │ │ ├── base64.js │ │ │ │ ├── binary-search.js │ │ │ │ ├── mapping-list.js │ │ │ │ ├── quick-sort.js │ │ │ │ ├── source-map-consumer.js │ │ │ │ ├── source-map-generator.js │ │ │ │ ├── source-node.js │ │ │ │ └── util.js │ │ ├── node_modules │ │ │ └── amdefine │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── amdefine.js │ │ │ │ ├── intercept.js │ │ │ │ └── package.json │ │ └── package.json │ └── supports-color │ │ ├── browser.js │ │ ├── index.js │ │ ├── license │ │ ├── node_modules │ │ └── has-flag │ │ │ ├── index.js │ │ │ ├── license │ │ │ ├── package.json │ │ │ └── readme.md │ │ ├── package.json │ │ └── readme.md │ ├── package.json │ └── postcss.d.ts ├── package.json ├── perfectionist.js ├── perfectionist.py ├── perfectionist.sublime-commands ├── perfectionist.sublime-settings └── shot.gif /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [package.json] 11 | indent_style = space 12 | indent_size = 2 13 | 14 | [*.py] 15 | indent_size = 4 16 | 17 | [*.md] 18 | trim_trailing_whitespace = false 19 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.no-sublime-package: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yisibl/sublime-perfectionist/cfe7007d4105439c68bac58e827ee16de3f35d9d/.no-sublime-package -------------------------------------------------------------------------------- /Context.sublime-menu: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "caption": "CSS Perfectionist", 4 | "children": [ 5 | { 6 | "caption": "Expanded", 7 | "command": "perfectionist", 8 | "args": { 9 | "action": "expanded" 10 | } 11 | }, 12 | { 13 | "caption": "Compact", 14 | "command": "perfectionist", 15 | "args": { 16 | "action": "compact" 17 | } 18 | }, 19 | { 20 | "caption": "Compressed", 21 | "command": "perfectionist", 22 | "args": { 23 | "action": "compressed" 24 | } 25 | }, 26 | { 27 | "caption": "-" 28 | }, 29 | { 30 | "command": "open_file", 31 | "args": { 32 | "file": "${packages}/perfectionist/perfectionist.sublime-settings" 33 | }, 34 | "caption": "Settings – Default" 35 | }, 36 | { 37 | "command": "open_file", 38 | "args": { 39 | "file": "${packages}/User/perfectionist.sublime-settings" 40 | }, 41 | "caption": "Settings – User" 42 | }, 43 | { 44 | "caption": "-" 45 | }, 46 | { 47 | "command": "open_file", 48 | "args": { 49 | "file": "${packages}/perfectionist/Default (OSX).sublime-keymap", 50 | "platform": "OSX" 51 | }, 52 | "caption": "Key Bindings – Default" 53 | }, 54 | { 55 | "command": "open_file", 56 | "args": { 57 | "file": "${packages}/perfectionist/Default (Linux).sublime-keymap", 58 | "platform": "Linux" 59 | }, 60 | "caption": "Key Bindings – Default" 61 | }, 62 | { 63 | "command": "open_file", 64 | "args": { 65 | "file": "${packages}/perfectionist/Default (Windows).sublime-keymap", 66 | "platform": "Windows" 67 | }, 68 | "caption": "Key Bindings – Default" 69 | }, 70 | { 71 | "command": "open_file", 72 | "args": { 73 | "file": "${packages}/User/Default (OSX).sublime-keymap", 74 | "platform": "OSX" 75 | }, 76 | "caption": "Key Bindings – User" 77 | }, 78 | { 79 | "command": "open_file", 80 | "args": { 81 | "file": "${packages}/User/Default (Linux).sublime-keymap", 82 | "platform": "Linux" 83 | }, 84 | "caption": "Key Bindings – User" 85 | }, 86 | { 87 | "command": "open_file", 88 | "args": { 89 | "file": "${packages}/User/Default (Windows).sublime-keymap", 90 | "platform": "Windows" 91 | }, 92 | "caption": "Key Bindings – User" 93 | }, 94 | { 95 | "caption": "-" 96 | } 97 | ] 98 | } 99 | ] 100 | -------------------------------------------------------------------------------- /Default (Linux).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "keys": [ 4 | "ctrl+shift+e" 5 | ], 6 | "command": "perfectionist", 7 | "args": { 8 | "action": "auto" 9 | } 10 | } 11 | ] 12 | -------------------------------------------------------------------------------- /Default (OSX).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "keys": [ 4 | "super+shift+e" 5 | ], 6 | "command": "perfectionist", 7 | "args": { 8 | "action": "auto" 9 | } 10 | } 11 | ] 12 | -------------------------------------------------------------------------------- /Default (Windows).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "keys": [ 4 | "ctrl+shift+e" 5 | ], 6 | "command": "perfectionist", 7 | "args": { 8 | "action": "auto" 9 | } 10 | } 11 | ] 12 | -------------------------------------------------------------------------------- /Main.sublime-menu: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "caption": "Preferences", 4 | "mnemonic": "n", 5 | "id": "preferences", 6 | "children": [ 7 | { 8 | "caption": "Package Settings", 9 | "mnemonic": "P", 10 | "id": "package-settings", 11 | "children": [ 12 | { 13 | "caption": "Perfectionist", 14 | "children": [ 15 | { 16 | "command": "open_file", 17 | "args": { 18 | "file": "${packages}/perfectionist/perfectionist.sublime-settings" 19 | }, 20 | "caption": "Settings – Default" 21 | }, 22 | { 23 | "command": "open_file", 24 | "args": { 25 | "file": "${packages}/User/perfectionist.sublime-settings" 26 | }, 27 | "caption": "Settings – User" 28 | }, 29 | { 30 | "caption": "-" 31 | }, 32 | { 33 | "command": "open_file", 34 | "args": { 35 | "file": "${packages}/perfectionist/Default (OSX).sublime-keymap", 36 | "platform": "OSX" 37 | }, 38 | "caption": "Key Bindings – Default" 39 | }, 40 | { 41 | "command": "open_file", 42 | "args": { 43 | "file": "${packages}/perfectionist/Default (Linux).sublime-keymap", 44 | "platform": "Linux" 45 | }, 46 | "caption": "Key Bindings – Default" 47 | }, 48 | { 49 | "command": "open_file", 50 | "args": { 51 | "file": "${packages}/perfectionist/Default (Windows).sublime-keymap", 52 | "platform": "Windows" 53 | }, 54 | "caption": "Key Bindings – Default" 55 | }, 56 | { 57 | "command": "open_file", 58 | "args": { 59 | "file": "${packages}/User/Default (OSX).sublime-keymap", 60 | "platform": "OSX" 61 | }, 62 | "caption": "Key Bindings – User" 63 | }, 64 | { 65 | "command": "open_file", 66 | "args": { 67 | "file": "${packages}/User/Default (Linux).sublime-keymap", 68 | "platform": "Linux" 69 | }, 70 | "caption": "Key Bindings – User" 71 | }, 72 | { 73 | "command": "open_file", 74 | "args": { 75 | "file": "${packages}/User/Default (Windows).sublime-keymap", 76 | "platform": "Windows" 77 | }, 78 | "caption": "Key Bindings – User" 79 | }, 80 | { 81 | "caption": "-" 82 | } 83 | ] 84 | } 85 | ] 86 | } 87 | ] 88 | } 89 | ] 90 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "install": "messages/install.txt", 3 | "1.2.0": "messages/changelog.txt" 4 | } 5 | -------------------------------------------------------------------------------- /messages/changelog.txt: -------------------------------------------------------------------------------- 1 | # 2.0.0 2015-09-07 2 | 3 | * Add: Support SCSS syntax. 4 | * Change: html/htm file is disabled by default. 5 | 6 | # 1.2.2 2015-09-02 7 | 8 | * Add: Use the shortcut key format reads the configuration file. 9 | 10 | # 1.2.1 2015-09-02 11 | 12 | * Add: Context menu add open settings file and shortcut key file. 13 | * Fix: Can not correctly read the file filter list. 14 | 15 | 16 | # 1.2.0 2015-09-01 17 | 18 | * Add: The filter file. 19 | * Change: The shortcut key only for expanded. 20 | 21 | 22 | # 1.1.0 2015-09-01 23 | 24 | * Add: More compression options for context menu and Command Palette. 25 | 26 | 27 | # 1.0.1 2015-09-01 28 | 29 | * Released to Control Package. 30 | * Improve documentation. 31 | * Add installation message. 32 | -------------------------------------------------------------------------------- /messages/install.txt: -------------------------------------------------------------------------------- 1 | Thank you for installing sublime-perfectionist(^ω^). 2 | 3 | 4 | ## Usage 5 | 6 | * Open the Command Palette: `Cmd+Shift+P`(OSX) or `Ctrl+Shift+P`(Linux/Window), entry `CSS Perfectionist`. 7 | * Context Menu: `CSS perfectionist`. 8 | * Shortcut keys: `Cmd+Shift+E`(OS X)/`Ctrl+Shift+E`(Linux/Window). 9 | 10 | ## Issues 11 | 12 | Please report issues here: https://github.com/yisibl/sublime-perfectionist/issues 13 | 14 | Created by yisibl ([Weibo](http://weibo.com/jieorlin)) 15 | -------------------------------------------------------------------------------- /node_bridge.py: -------------------------------------------------------------------------------- 1 | import os 2 | import platform 3 | import subprocess 4 | 5 | IS_OSX = platform.system() == 'Darwin' 6 | IS_WINDOWS = platform.system() == 'Windows' 7 | 8 | def node_bridge(data, bin, args=[]): 9 | env = None 10 | startupinfo = None 11 | if IS_OSX: 12 | # GUI apps in OS X doesn't contain .bashrc/.zshrc set paths 13 | env = os.environ.copy() 14 | env['PATH'] += ':/usr/local/bin' 15 | if IS_WINDOWS: 16 | startupinfo = subprocess.STARTUPINFO() 17 | startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW 18 | try: 19 | p = subprocess.Popen(['node', bin] + args, 20 | stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE, 21 | env=env, startupinfo=startupinfo) 22 | except OSError: 23 | raise Exception('Couldn\'t find Node.js. Make sure it\'s in your $PATH by running `node -v` in your command-line.') 24 | stdout, stderr = p.communicate(input=data.encode('utf-8')) 25 | stdout = stdout.decode('utf-8') 26 | stderr = stderr.decode('utf-8') 27 | if stderr: 28 | raise Exception('Error: %s' % stderr) 29 | else: 30 | return stdout 31 | -------------------------------------------------------------------------------- /node_modules/.bin/perfectionist: -------------------------------------------------------------------------------- 1 | ../perfectionist/bin/cmd.js -------------------------------------------------------------------------------- /node_modules/get-stdin/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function (cb) { 4 | var stdin = process.stdin; 5 | var ret = ''; 6 | 7 | if (stdin.isTTY) { 8 | setImmediate(cb, ''); 9 | return; 10 | } 11 | 12 | stdin.setEncoding('utf8'); 13 | 14 | stdin.on('readable', function () { 15 | var chunk; 16 | 17 | while (chunk = stdin.read()) { 18 | ret += chunk; 19 | } 20 | }); 21 | 22 | stdin.on('end', function () { 23 | cb(ret); 24 | }); 25 | }; 26 | 27 | module.exports.buffer = function (cb) { 28 | var stdin = process.stdin; 29 | var ret = []; 30 | var len = 0; 31 | 32 | if (stdin.isTTY) { 33 | setImmediate(cb, new Buffer('')); 34 | return; 35 | } 36 | 37 | stdin.on('readable', function () { 38 | var chunk; 39 | 40 | while (chunk = stdin.read()) { 41 | ret.push(chunk); 42 | len += chunk.length; 43 | } 44 | }); 45 | 46 | stdin.on('end', function () { 47 | cb(Buffer.concat(ret, len)); 48 | }); 49 | }; 50 | -------------------------------------------------------------------------------- /node_modules/get-stdin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "get-stdin", 3 | "version": "4.0.1", 4 | "description": "Easier stdin", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/sindresorhus/get-stdin" 9 | }, 10 | "author": { 11 | "name": "Sindre Sorhus", 12 | "email": "sindresorhus@gmail.com", 13 | "url": "http://sindresorhus.com" 14 | }, 15 | "engines": { 16 | "node": ">=0.10.0" 17 | }, 18 | "scripts": { 19 | "test": "node test.js && node test-buffer.js && echo unicorns | node test-real.js" 20 | }, 21 | "files": [ 22 | "index.js" 23 | ], 24 | "keywords": [ 25 | "std", 26 | "stdin", 27 | "stdio", 28 | "concat", 29 | "buffer", 30 | "stream", 31 | "process", 32 | "stream" 33 | ], 34 | "devDependencies": { 35 | "ava": "0.0.4", 36 | "buffer-equal": "0.0.1" 37 | }, 38 | "gitHead": "65c744975229b25d6cc5c7546f49b6ad9099553f", 39 | "bugs": { 40 | "url": "https://github.com/sindresorhus/get-stdin/issues" 41 | }, 42 | "homepage": "https://github.com/sindresorhus/get-stdin", 43 | "_id": "get-stdin@4.0.1", 44 | "_shasum": "b968c6b0a04384324902e8bf1a5df32579a450fe", 45 | "_from": "get-stdin@>=4.0.1 <5.0.0", 46 | "_npmVersion": "1.4.28", 47 | "_npmUser": { 48 | "name": "sindresorhus", 49 | "email": "sindresorhus@gmail.com" 50 | }, 51 | "maintainers": [ 52 | { 53 | "name": "sindresorhus", 54 | "email": "sindresorhus@gmail.com" 55 | } 56 | ], 57 | "dist": { 58 | "shasum": "b968c6b0a04384324902e8bf1a5df32579a450fe", 59 | "tarball": "http://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz" 60 | }, 61 | "directories": {}, 62 | "_resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", 63 | "readme": "ERROR: No README data found!" 64 | } 65 | -------------------------------------------------------------------------------- /node_modules/get-stdin/readme.md: -------------------------------------------------------------------------------- 1 | # get-stdin [![Build Status](https://travis-ci.org/sindresorhus/get-stdin.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stdin) 2 | 3 | > Easier stdin 4 | 5 | 6 | ## Install 7 | 8 | ```sh 9 | $ npm install --save get-stdin 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | // example.js 17 | var stdin = require('get-stdin'); 18 | 19 | stdin(function (data) { 20 | console.log(data); 21 | //=> unicorns 22 | }); 23 | ``` 24 | 25 | ```sh 26 | $ echo unicorns | node example.js 27 | unicorns 28 | ``` 29 | 30 | 31 | ## API 32 | 33 | ### stdin(callback) 34 | 35 | Get `stdin` as a string. 36 | 37 | ### stdin.buffer(callback) 38 | 39 | Get `stdin` as a buffer. 40 | 41 | 42 | ## License 43 | 44 | MIT © [Sindre Sorhus](http://sindresorhus.com) 45 | -------------------------------------------------------------------------------- /node_modules/perfectionist/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 2.0.0 2 | 3 | * Upgrade to PostCSS 5.x. 4 | 5 | # 1.4.1 6 | 7 | * Fixed an issue where perfectionist would add an extra space in between 8 | at rules with no child nodes (for example, `@import`). 9 | 10 | # 1.4.0 11 | 12 | * Added an option to disable the visual cascade of properties. 13 | * Fixed an issue where at-rules were not getting an appropriate amount of 14 | newlines following the rule. 15 | * Fixed an issue where comments in values were being removed. 16 | * Where possible, perfectionist will condense multi-line selectors into 17 | a single line. 18 | 19 | # 1.3.1 20 | 21 | * perfectionist will now not remove comments within selector strings. 22 | 23 | # 1.3.0 24 | 25 | * Better formatting of comments inside rules. 26 | * Better formatting of selectors inside at-rules. 27 | * Added an option to configure the indent size. 28 | 29 | # 1.2.2 30 | 31 | * Fixes a crash when a comment ended the file. 32 | 33 | # 1.2.1 34 | 35 | * Fixes an issue where comments were being removed from inside nodes. 36 | 37 | # 1.2.0 38 | 39 | * Adds support for configurable wrapping of property values over multiple lines. 40 | * Adds support for configurable wrapping of at-rule parameters. 41 | 42 | # 1.1.0 43 | 44 | * Adds support for newlines around block comments in both `expanded` and 45 | `compact` formats. 46 | 47 | # 1.0.2 48 | 49 | * Fixes a crash on comments inside rules. 50 | 51 | # 1.0.1 52 | 53 | * Fixes a behaviour where the module was trying to add negative space to a 54 | property when re-aligning. 55 | 56 | # 1.0.0 57 | 58 | * Initial release. 59 | -------------------------------------------------------------------------------- /node_modules/perfectionist/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) (http://beneb.info) 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/perfectionist/bin/cmd.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var fs = require('fs'); 4 | var perfectionist = require('../dist'); 5 | var read = require('read-file-stdin'); 6 | var write = require('write-file-stdout'); 7 | 8 | var opts = require('minimist')(process.argv.slice(2), { 9 | alias: { 10 | f: 'format', 11 | h: 'help', 12 | s: 'sourcemap', 13 | v: 'version' 14 | } 15 | }); 16 | 17 | if (opts.version) { 18 | return console.log(require('../package.json').version); 19 | } 20 | 21 | var file = opts._[0]; 22 | var out = opts._[1]; 23 | 24 | if (file === 'help' || opts.help) { 25 | return fs.createReadStream(__dirname + '/usage.txt') 26 | .pipe(process.stdout) 27 | .on('close', function () { process.exit(1); }); 28 | } 29 | 30 | read(file, function (err, buf) { 31 | if (err) { 32 | throw err; 33 | } 34 | if (file) { 35 | opts.from = file; 36 | } 37 | if (out) { 38 | opts.to = out; 39 | } 40 | write(out, String(perfectionist.process(String(buf), opts))); 41 | }); 42 | -------------------------------------------------------------------------------- /node_modules/perfectionist/bin/usage.txt: -------------------------------------------------------------------------------- 1 | Usage: perfectionist [input] [output] {OPTIONS} 2 | 3 | Options: 4 | 5 | --format -f Choose how the CSS should be formatted: 6 | expanded (default), compact, compressed 7 | 8 | --sourcemap -s Output a sourcemap with the CSS. 9 | 10 | --version, -v Outputs the version number. 11 | 12 | --help, -h Outputs this help screen. 13 | -------------------------------------------------------------------------------- /node_modules/perfectionist/dist/deeplyNested.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, '__esModule', { 4 | value: true 5 | }); 6 | exports['default'] = deeplyNested; 7 | 8 | function deeplyNested(_ref) { 9 | var nodes = _ref.nodes; 10 | 11 | return nodes && nodes.some(function (_ref2) { 12 | var nodes = _ref2.nodes; 13 | return nodes; 14 | }); 15 | } 16 | 17 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/perfectionist/dist/getIndent.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, '__esModule', { 4 | value: true 5 | }); 6 | exports['default'] = getIndent; 7 | 8 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 9 | 10 | var _space = require('./space'); 11 | 12 | var _space2 = _interopRequireDefault(_space); 13 | 14 | function getIndent(node) { 15 | var base = arguments.length <= 1 || arguments[1] === undefined ? 4 : arguments[1]; 16 | 17 | var level = 0; 18 | var parent = node.parent; 19 | while (parent && parent.type !== 'root') { 20 | level++; 21 | parent = parent.parent; 22 | } 23 | return (0, _space2['default'])(level * base); 24 | } 25 | 26 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/perfectionist/dist/longest.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, '__esModule', { 4 | value: true 5 | }); 6 | 7 | exports['default'] = function (a, b) { 8 | return b.prop.length - a.prop.length; 9 | }; 10 | 11 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/perfectionist/dist/maxSelectorLength.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, '__esModule', { 4 | value: true 5 | }); 6 | exports.maxAtRuleLength = maxAtRuleLength; 7 | exports.maxSelectorLength = maxSelectorLength; 8 | exports.maxValueLength = maxValueLength; 9 | 10 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 11 | 12 | var _postcss = require('postcss'); 13 | 14 | var _space = require('./space'); 15 | 16 | var _space2 = _interopRequireDefault(_space); 17 | 18 | var _getIndent = require('./getIndent'); 19 | 20 | var _getIndent2 = _interopRequireDefault(_getIndent); 21 | 22 | var _objectAssign = require('object-assign'); 23 | 24 | var _objectAssign2 = _interopRequireDefault(_objectAssign); 25 | 26 | function splitProperty(rule, prop, opts) { 27 | opts = (0, _objectAssign2['default'])({ 28 | reindent: false 29 | }, opts); 30 | var max = opts.max; 31 | var property = rule[prop]; 32 | if (!max || !property) { 33 | return; 34 | } 35 | var exploded = _postcss.list.comma(property); 36 | if (property.length > max || opts.reduce) { 37 | (function () { 38 | var indent = 0; 39 | if (typeof opts.reindent === 'function') { 40 | indent = opts.reindent(rule); 41 | } 42 | rule[prop] = exploded.reduce(function (lines, chunk) { 43 | if (opts.breakEvery) { 44 | lines.push(chunk); 45 | return lines; 46 | } 47 | if (lines[lines.length - 1].length + indent <= max) { 48 | var merged = lines[lines.length - 1] + ', ' + chunk; 49 | if (indent + merged.length <= max) { 50 | lines[lines.length - 1] = merged; 51 | return lines; 52 | } 53 | } 54 | lines.push(chunk); 55 | return lines; 56 | }, [exploded.shift()]).join(',\n' + (0, _space2['default'])(indent)); 57 | })(); 58 | } 59 | } 60 | 61 | function maxAtRuleLength(rule, _ref) { 62 | var max = _ref.maxAtRuleLength; 63 | 64 | return splitProperty(rule, 'params', { 65 | max: max, 66 | breakEvery: true, 67 | reindent: function reindent(rule) { 68 | return rule.name.length + 2; 69 | } 70 | }); 71 | } 72 | 73 | function maxSelectorLength(rule, opts) { 74 | return splitProperty(rule, 'selector', { 75 | max: opts.maxSelectorLength, 76 | reduce: true, // where possible reduce to one line 77 | reindent: function reindent(rule) { 78 | return (0, _getIndent2['default'])(rule, opts.indentSize).length; 79 | } 80 | }); 81 | } 82 | 83 | function maxValueLength(rule, _ref2) { 84 | var max = _ref2.maxValueLength; 85 | 86 | if (rule.raws.value && rule.raws.value.raw) { 87 | rule.value = rule.raws.value.raw; 88 | } 89 | return splitProperty(rule, 'value', { 90 | max: max, 91 | breakEvery: true, 92 | reindent: function reindent(rule) { 93 | return (0, _getIndent2['default'])(rule).length + rule.prop.length + 2; 94 | } 95 | }); 96 | } -------------------------------------------------------------------------------- /node_modules/perfectionist/dist/prefixedDecls.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, '__esModule', { 4 | value: true 5 | }); 6 | exports['default'] = prefixedDeclarations; 7 | var prefixes = ['-webkit-', '-moz-', '-ms-', '-o-']; 8 | 9 | function prefixedDeclarations(rule) { 10 | var prefix = function prefix(node) { 11 | return prefixes.some(function (p) { 12 | return node.prop && !node.prop.indexOf(p); 13 | }); 14 | }; 15 | return rule.nodes.filter(prefix); 16 | } 17 | 18 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/perfectionist/dist/sameLine.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, '__esModule', { 4 | value: true 5 | }); 6 | 7 | exports['default'] = function (a, b) { 8 | return a.source.end.line === b.source.start.line; 9 | }; 10 | 11 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/perfectionist/dist/space.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, '__esModule', { 4 | value: true 5 | }); 6 | exports['default'] = space; 7 | 8 | require('string.prototype.repeat'); 9 | 10 | function space() { 11 | var amount = arguments.length <= 0 || arguments[0] === undefined ? 1 : arguments[0]; 12 | 13 | return ' '.repeat(amount); 14 | } 15 | 16 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/comment-regex/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var comment = module.exports = function () { 4 | return new RegExp('(?:' + comment.line().source + ')|(?:' + comment.block().source + ')', 'gm'); 5 | }; 6 | 7 | comment.line = function () { 8 | return /(?:^|\s)\/\/(.+?)$/gm; 9 | }; 10 | 11 | comment.block = function () { 12 | return /\/\*([\S\s]*?)\*\//gm; 13 | }; 14 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/comment-regex/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "comment-regex", 3 | "version": "1.0.0", 4 | "description": "Regular expression for matching JavaScript comments", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/sindresorhus/comment-regex.git" 9 | }, 10 | "author": { 11 | "name": "Sindre Sorhus", 12 | "email": "sindresorhus@gmail.com", 13 | "url": "http://sindresorhus.com" 14 | }, 15 | "engines": { 16 | "node": ">=0.10.0" 17 | }, 18 | "scripts": { 19 | "test": "node test.js" 20 | }, 21 | "files": [ 22 | "index.js" 23 | ], 24 | "keywords": [ 25 | "text", 26 | "string", 27 | "regex", 28 | "regexp", 29 | "re", 30 | "match", 31 | "test", 32 | "find", 33 | "pattern", 34 | "comment", 35 | "comments", 36 | "js", 37 | "javascript", 38 | "line", 39 | "block" 40 | ], 41 | "devDependencies": { 42 | "ava": "0.0.4" 43 | }, 44 | "gitHead": "a3d4222bef18d8b09993542738a28d7916d60405", 45 | "bugs": { 46 | "url": "https://github.com/sindresorhus/comment-regex/issues" 47 | }, 48 | "homepage": "https://github.com/sindresorhus/comment-regex", 49 | "_id": "comment-regex@1.0.0", 50 | "_shasum": "7dd70268c83648a9c4cc19bf472d52e64f63918d", 51 | "_from": "comment-regex@>=1.0.0 <2.0.0", 52 | "_npmVersion": "1.4.23", 53 | "_npmUser": { 54 | "name": "sindresorhus", 55 | "email": "sindresorhus@gmail.com" 56 | }, 57 | "maintainers": [ 58 | { 59 | "name": "sindresorhus", 60 | "email": "sindresorhus@gmail.com" 61 | } 62 | ], 63 | "dist": { 64 | "shasum": "7dd70268c83648a9c4cc19bf472d52e64f63918d", 65 | "tarball": "http://registry.npmjs.org/comment-regex/-/comment-regex-1.0.0.tgz" 66 | }, 67 | "directories": {}, 68 | "_resolved": "https://registry.npmjs.org/comment-regex/-/comment-regex-1.0.0.tgz", 69 | "readme": "ERROR: No README data found!" 70 | } 71 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/comment-regex/readme.md: -------------------------------------------------------------------------------- 1 | # comment-regex [![Build Status](https://travis-ci.org/sindresorhus/comment-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/comment-regex) 2 | 3 | > Regular expression for matching JavaScript comments 4 | 5 | *This is pretty fragile and created for perf reasons where a using real parser would be overkill.* 6 | 7 | 8 | ## Install 9 | 10 | ```sh 11 | $ npm install --save comment-regex 12 | ``` 13 | 14 | 15 | ## Usage 16 | 17 | ```js 18 | var commentRegex = require('comment-regex'); 19 | 20 | // contains a comment 21 | commentRegex().test('/* unicorn */\nvar foo = true;'); 22 | //=> true 23 | 24 | // get the contents of a comment 25 | commentRegex().exec('/* unicorn */\nvar foo = true;')[2].trim(); 26 | 27 | // get all the comments 28 | '/* unicorn */\nvar foo = true;\nvar unicorn = "rainbows"; // rainbow'.match(commentRegex()); 29 | //=> ['/* unicorn */', ' // rainbow'] 30 | ``` 31 | 32 | 33 | ## API 34 | 35 | The contents of the comment is in the first submatch. 36 | 37 | ### commentRegex() 38 | 39 | Returns a regex for matching line and block comments. 40 | 41 | ### commentRegex.line() 42 | 43 | Returns a regex for matching line comments. 44 | 45 | ### commentRegex.block() 46 | 47 | Returns a regex for matching block comments. 48 | 49 | 50 | ## License 51 | 52 | MIT © [Sindre Sorhus](http://sindresorhus.com) 53 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/minimist/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.8" 4 | - "0.10" 5 | - "0.12" 6 | - "iojs" 7 | before_install: 8 | - npm install -g npm@~1.4.6 9 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/minimist/LICENSE: -------------------------------------------------------------------------------- 1 | This software is released under the MIT license: 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | 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, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/minimist/example/parse.js: -------------------------------------------------------------------------------- 1 | var argv = require('../')(process.argv.slice(2)); 2 | console.dir(argv); 3 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/minimist/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "minimist", 3 | "version": "1.2.0", 4 | "description": "parse argument options", 5 | "main": "index.js", 6 | "devDependencies": { 7 | "covert": "^1.0.0", 8 | "tap": "~0.4.0", 9 | "tape": "^3.5.0" 10 | }, 11 | "scripts": { 12 | "test": "tap test/*.js", 13 | "coverage": "covert test/*.js" 14 | }, 15 | "testling": { 16 | "files": "test/*.js", 17 | "browsers": [ 18 | "ie/6..latest", 19 | "ff/5", 20 | "firefox/latest", 21 | "chrome/10", 22 | "chrome/latest", 23 | "safari/5.1", 24 | "safari/latest", 25 | "opera/12" 26 | ] 27 | }, 28 | "repository": { 29 | "type": "git", 30 | "url": "git://github.com/substack/minimist.git" 31 | }, 32 | "homepage": "https://github.com/substack/minimist", 33 | "keywords": [ 34 | "argv", 35 | "getopt", 36 | "parser", 37 | "optimist" 38 | ], 39 | "author": { 40 | "name": "James Halliday", 41 | "email": "mail@substack.net", 42 | "url": "http://substack.net" 43 | }, 44 | "license": "MIT", 45 | "gitHead": "dc624482fcfec5bc669c68cdb861f00573ed4e64", 46 | "bugs": { 47 | "url": "https://github.com/substack/minimist/issues" 48 | }, 49 | "_id": "minimist@1.2.0", 50 | "_shasum": "a35008b20f41383eec1fb914f4cd5df79a264284", 51 | "_from": "minimist@>=1.1.3 <2.0.0", 52 | "_npmVersion": "3.2.2", 53 | "_nodeVersion": "2.4.0", 54 | "_npmUser": { 55 | "name": "substack", 56 | "email": "substack@gmail.com" 57 | }, 58 | "dist": { 59 | "shasum": "a35008b20f41383eec1fb914f4cd5df79a264284", 60 | "tarball": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz" 61 | }, 62 | "maintainers": [ 63 | { 64 | "name": "substack", 65 | "email": "mail@substack.net" 66 | } 67 | ], 68 | "directories": {}, 69 | "_resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", 70 | "readme": "ERROR: No README data found!" 71 | } 72 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/minimist/readme.markdown: -------------------------------------------------------------------------------- 1 | # minimist 2 | 3 | parse argument options 4 | 5 | This module is the guts of optimist's argument parser without all the 6 | fanciful decoration. 7 | 8 | [![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist) 9 | 10 | [![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist) 11 | 12 | # example 13 | 14 | ``` js 15 | var argv = require('minimist')(process.argv.slice(2)); 16 | console.dir(argv); 17 | ``` 18 | 19 | ``` 20 | $ node example/parse.js -a beep -b boop 21 | { _: [], a: 'beep', b: 'boop' } 22 | ``` 23 | 24 | ``` 25 | $ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz 26 | { _: [ 'foo', 'bar', 'baz' ], 27 | x: 3, 28 | y: 4, 29 | n: 5, 30 | a: true, 31 | b: true, 32 | c: true, 33 | beep: 'boop' } 34 | ``` 35 | 36 | # methods 37 | 38 | ``` js 39 | var parseArgs = require('minimist') 40 | ``` 41 | 42 | ## var argv = parseArgs(args, opts={}) 43 | 44 | Return an argument object `argv` populated with the array arguments from `args`. 45 | 46 | `argv._` contains all the arguments that didn't have an option associated with 47 | them. 48 | 49 | Numeric-looking arguments will be returned as numbers unless `opts.string` or 50 | `opts.boolean` is set for that argument name. 51 | 52 | Any arguments after `'--'` will not be parsed and will end up in `argv._`. 53 | 54 | options can be: 55 | 56 | * `opts.string` - a string or array of strings argument names to always treat as 57 | strings 58 | * `opts.boolean` - a boolean, string or array of strings to always treat as 59 | booleans. if `true` will treat all double hyphenated arguments without equal signs 60 | as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`) 61 | * `opts.alias` - an object mapping string names to strings or arrays of string 62 | argument names to use as aliases 63 | * `opts.default` - an object mapping string argument names to default values 64 | * `opts.stopEarly` - when true, populate `argv._` with everything after the 65 | first non-option 66 | * `opts['--']` - when true, populate `argv._` with everything before the `--` 67 | and `argv['--']` with everything after the `--`. Here's an example: 68 | * `opts.unknown` - a function which is invoked with a command line parameter not 69 | defined in the `opts` configuration object. If the function returns `false`, the 70 | unknown option is not added to `argv`. 71 | 72 | ``` 73 | > require('./')('one two three -- four five --six'.split(' '), { '--': true }) 74 | { _: [ 'one', 'two', 'three' ], 75 | '--': [ 'four', 'five', '--six' ] } 76 | ``` 77 | 78 | Note that with `opts['--']` set, parsing for arguments still stops after the 79 | `--`. 80 | 81 | # install 82 | 83 | With [npm](https://npmjs.org) do: 84 | 85 | ``` 86 | npm install minimist 87 | ``` 88 | 89 | # license 90 | 91 | MIT 92 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/minimist/test/all_bool.js: -------------------------------------------------------------------------------- 1 | var parse = require('../'); 2 | var test = require('tape'); 3 | 4 | test('flag boolean true (default all --args to boolean)', function (t) { 5 | var argv = parse(['moo', '--honk', 'cow'], { 6 | boolean: true 7 | }); 8 | 9 | t.deepEqual(argv, { 10 | honk: true, 11 | _: ['moo', 'cow'] 12 | }); 13 | 14 | t.deepEqual(typeof argv.honk, 'boolean'); 15 | t.end(); 16 | }); 17 | 18 | test('flag boolean true only affects double hyphen arguments without equals signs', function (t) { 19 | var argv = parse(['moo', '--honk', 'cow', '-p', '55', '--tacos=good'], { 20 | boolean: true 21 | }); 22 | 23 | t.deepEqual(argv, { 24 | honk: true, 25 | tacos: 'good', 26 | p: 55, 27 | _: ['moo', 'cow'] 28 | }); 29 | 30 | t.deepEqual(typeof argv.honk, 'boolean'); 31 | t.end(); 32 | }); 33 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/minimist/test/dash.js: -------------------------------------------------------------------------------- 1 | var parse = require('../'); 2 | var test = require('tape'); 3 | 4 | test('-', function (t) { 5 | t.plan(5); 6 | t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); 7 | t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); 8 | t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); 9 | t.deepEqual( 10 | parse([ '-b', '-' ], { boolean: 'b' }), 11 | { b: true, _: [ '-' ] } 12 | ); 13 | t.deepEqual( 14 | parse([ '-s', '-' ], { string: 's' }), 15 | { s: '-', _: [] } 16 | ); 17 | }); 18 | 19 | test('-a -- b', function (t) { 20 | t.plan(3); 21 | t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); 22 | t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); 23 | t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); 24 | }); 25 | 26 | test('move arguments after the -- into their own `--` array', function(t) { 27 | t.plan(1); 28 | t.deepEqual( 29 | parse([ '--name', 'John', 'before', '--', 'after' ], { '--': true }), 30 | { name: 'John', _: [ 'before' ], '--': [ 'after' ] }); 31 | }); 32 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/minimist/test/default_bool.js: -------------------------------------------------------------------------------- 1 | var test = require('tape'); 2 | var parse = require('../'); 3 | 4 | test('boolean default true', function (t) { 5 | var argv = parse([], { 6 | boolean: 'sometrue', 7 | default: { sometrue: true } 8 | }); 9 | t.equal(argv.sometrue, true); 10 | t.end(); 11 | }); 12 | 13 | test('boolean default false', function (t) { 14 | var argv = parse([], { 15 | boolean: 'somefalse', 16 | default: { somefalse: false } 17 | }); 18 | t.equal(argv.somefalse, false); 19 | t.end(); 20 | }); 21 | 22 | test('boolean default to null', function (t) { 23 | var argv = parse([], { 24 | boolean: 'maybe', 25 | default: { maybe: null } 26 | }); 27 | t.equal(argv.maybe, null); 28 | var argv = parse(['--maybe'], { 29 | boolean: 'maybe', 30 | default: { maybe: null } 31 | }); 32 | t.equal(argv.maybe, true); 33 | t.end(); 34 | 35 | }) 36 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/minimist/test/dotted.js: -------------------------------------------------------------------------------- 1 | var parse = require('../'); 2 | var test = require('tape'); 3 | 4 | test('dotted alias', function (t) { 5 | var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); 6 | t.equal(argv.a.b, 22); 7 | t.equal(argv.aa.bb, 22); 8 | t.end(); 9 | }); 10 | 11 | test('dotted default', function (t) { 12 | var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); 13 | t.equal(argv.a.b, 11); 14 | t.equal(argv.aa.bb, 11); 15 | t.end(); 16 | }); 17 | 18 | test('dotted default with no alias', function (t) { 19 | var argv = parse('', {default: {'a.b': 11}}); 20 | t.equal(argv.a.b, 11); 21 | t.end(); 22 | }); 23 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/minimist/test/kv_short.js: -------------------------------------------------------------------------------- 1 | var parse = require('../'); 2 | var test = require('tape'); 3 | 4 | test('short -k=v' , function (t) { 5 | t.plan(1); 6 | 7 | var argv = parse([ '-b=123' ]); 8 | t.deepEqual(argv, { b: 123, _: [] }); 9 | }); 10 | 11 | test('multi short -k=v' , function (t) { 12 | t.plan(1); 13 | 14 | var argv = parse([ '-a=whatever', '-b=robots' ]); 15 | t.deepEqual(argv, { a: 'whatever', b: 'robots', _: [] }); 16 | }); 17 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/minimist/test/long.js: -------------------------------------------------------------------------------- 1 | var test = require('tape'); 2 | var parse = require('../'); 3 | 4 | test('long opts', function (t) { 5 | t.deepEqual( 6 | parse([ '--bool' ]), 7 | { bool : true, _ : [] }, 8 | 'long boolean' 9 | ); 10 | t.deepEqual( 11 | parse([ '--pow', 'xixxle' ]), 12 | { pow : 'xixxle', _ : [] }, 13 | 'long capture sp' 14 | ); 15 | t.deepEqual( 16 | parse([ '--pow=xixxle' ]), 17 | { pow : 'xixxle', _ : [] }, 18 | 'long capture eq' 19 | ); 20 | t.deepEqual( 21 | parse([ '--host', 'localhost', '--port', '555' ]), 22 | { host : 'localhost', port : 555, _ : [] }, 23 | 'long captures sp' 24 | ); 25 | t.deepEqual( 26 | parse([ '--host=localhost', '--port=555' ]), 27 | { host : 'localhost', port : 555, _ : [] }, 28 | 'long captures eq' 29 | ); 30 | t.end(); 31 | }); 32 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/minimist/test/num.js: -------------------------------------------------------------------------------- 1 | var parse = require('../'); 2 | var test = require('tape'); 3 | 4 | test('nums', function (t) { 5 | var argv = parse([ 6 | '-x', '1234', 7 | '-y', '5.67', 8 | '-z', '1e7', 9 | '-w', '10f', 10 | '--hex', '0xdeadbeef', 11 | '789' 12 | ]); 13 | t.deepEqual(argv, { 14 | x : 1234, 15 | y : 5.67, 16 | z : 1e7, 17 | w : '10f', 18 | hex : 0xdeadbeef, 19 | _ : [ 789 ] 20 | }); 21 | t.deepEqual(typeof argv.x, 'number'); 22 | t.deepEqual(typeof argv.y, 'number'); 23 | t.deepEqual(typeof argv.z, 'number'); 24 | t.deepEqual(typeof argv.w, 'string'); 25 | t.deepEqual(typeof argv.hex, 'number'); 26 | t.deepEqual(typeof argv._[0], 'number'); 27 | t.end(); 28 | }); 29 | 30 | test('already a number', function (t) { 31 | var argv = parse([ '-x', 1234, 789 ]); 32 | t.deepEqual(argv, { x : 1234, _ : [ 789 ] }); 33 | t.deepEqual(typeof argv.x, 'number'); 34 | t.deepEqual(typeof argv._[0], 'number'); 35 | t.end(); 36 | }); 37 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/minimist/test/parse_modified.js: -------------------------------------------------------------------------------- 1 | var parse = require('../'); 2 | var test = require('tape'); 3 | 4 | test('parse with modifier functions' , function (t) { 5 | t.plan(1); 6 | 7 | var argv = parse([ '-b', '123' ], { boolean: 'b' }); 8 | t.deepEqual(argv, { b: true, _: [123] }); 9 | }); 10 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/minimist/test/short.js: -------------------------------------------------------------------------------- 1 | var parse = require('../'); 2 | var test = require('tape'); 3 | 4 | test('numeric short args', function (t) { 5 | t.plan(2); 6 | t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); 7 | t.deepEqual( 8 | parse([ '-123', '456' ]), 9 | { 1: true, 2: true, 3: 456, _: [] } 10 | ); 11 | }); 12 | 13 | test('short', function (t) { 14 | t.deepEqual( 15 | parse([ '-b' ]), 16 | { b : true, _ : [] }, 17 | 'short boolean' 18 | ); 19 | t.deepEqual( 20 | parse([ 'foo', 'bar', 'baz' ]), 21 | { _ : [ 'foo', 'bar', 'baz' ] }, 22 | 'bare' 23 | ); 24 | t.deepEqual( 25 | parse([ '-cats' ]), 26 | { c : true, a : true, t : true, s : true, _ : [] }, 27 | 'group' 28 | ); 29 | t.deepEqual( 30 | parse([ '-cats', 'meow' ]), 31 | { c : true, a : true, t : true, s : 'meow', _ : [] }, 32 | 'short group next' 33 | ); 34 | t.deepEqual( 35 | parse([ '-h', 'localhost' ]), 36 | { h : 'localhost', _ : [] }, 37 | 'short capture' 38 | ); 39 | t.deepEqual( 40 | parse([ '-h', 'localhost', '-p', '555' ]), 41 | { h : 'localhost', p : 555, _ : [] }, 42 | 'short captures' 43 | ); 44 | t.end(); 45 | }); 46 | 47 | test('mixed short bool and capture', function (t) { 48 | t.same( 49 | parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), 50 | { 51 | f : true, p : 555, h : 'localhost', 52 | _ : [ 'script.js' ] 53 | } 54 | ); 55 | t.end(); 56 | }); 57 | 58 | test('short and long', function (t) { 59 | t.deepEqual( 60 | parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), 61 | { 62 | f : true, p : 555, h : 'localhost', 63 | _ : [ 'script.js' ] 64 | } 65 | ); 66 | t.end(); 67 | }); 68 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/minimist/test/stop_early.js: -------------------------------------------------------------------------------- 1 | var parse = require('../'); 2 | var test = require('tape'); 3 | 4 | test('stops parsing on the first non-option when stopEarly is set', function (t) { 5 | var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], { 6 | stopEarly: true 7 | }); 8 | 9 | t.deepEqual(argv, { 10 | aaa: 'bbb', 11 | _: ['ccc', '--ddd'] 12 | }); 13 | 14 | t.end(); 15 | }); 16 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/minimist/test/unknown.js: -------------------------------------------------------------------------------- 1 | var parse = require('../'); 2 | var test = require('tape'); 3 | 4 | test('boolean and alias is not unknown', function (t) { 5 | var unknown = []; 6 | function unknownFn(arg) { 7 | unknown.push(arg); 8 | return false; 9 | } 10 | var aliased = [ '-h', 'true', '--derp', 'true' ]; 11 | var regular = [ '--herp', 'true', '-d', 'true' ]; 12 | var opts = { 13 | alias: { h: 'herp' }, 14 | boolean: 'h', 15 | unknown: unknownFn 16 | }; 17 | var aliasedArgv = parse(aliased, opts); 18 | var propertyArgv = parse(regular, opts); 19 | 20 | t.same(unknown, ['--derp', '-d']); 21 | t.end(); 22 | }); 23 | 24 | test('flag boolean true any double hyphen argument is not unknown', function (t) { 25 | var unknown = []; 26 | function unknownFn(arg) { 27 | unknown.push(arg); 28 | return false; 29 | } 30 | var argv = parse(['--honk', '--tacos=good', 'cow', '-p', '55'], { 31 | boolean: true, 32 | unknown: unknownFn 33 | }); 34 | t.same(unknown, ['--tacos=good', 'cow', '-p']); 35 | t.same(argv, { 36 | honk: true, 37 | _: [] 38 | }); 39 | t.end(); 40 | }); 41 | 42 | test('string and alias is not unknown', function (t) { 43 | var unknown = []; 44 | function unknownFn(arg) { 45 | unknown.push(arg); 46 | return false; 47 | } 48 | var aliased = [ '-h', 'hello', '--derp', 'goodbye' ]; 49 | var regular = [ '--herp', 'hello', '-d', 'moon' ]; 50 | var opts = { 51 | alias: { h: 'herp' }, 52 | string: 'h', 53 | unknown: unknownFn 54 | }; 55 | var aliasedArgv = parse(aliased, opts); 56 | var propertyArgv = parse(regular, opts); 57 | 58 | t.same(unknown, ['--derp', '-d']); 59 | t.end(); 60 | }); 61 | 62 | test('default and alias is not unknown', function (t) { 63 | var unknown = []; 64 | function unknownFn(arg) { 65 | unknown.push(arg); 66 | return false; 67 | } 68 | var aliased = [ '-h', 'hello' ]; 69 | var regular = [ '--herp', 'hello' ]; 70 | var opts = { 71 | default: { 'h': 'bar' }, 72 | alias: { 'h': 'herp' }, 73 | unknown: unknownFn 74 | }; 75 | var aliasedArgv = parse(aliased, opts); 76 | var propertyArgv = parse(regular, opts); 77 | 78 | t.same(unknown, []); 79 | t.end(); 80 | unknownFn(); // exercise fn for 100% coverage 81 | }); 82 | 83 | test('value following -- is not unknown', function (t) { 84 | var unknown = []; 85 | function unknownFn(arg) { 86 | unknown.push(arg); 87 | return false; 88 | } 89 | var aliased = [ '--bad', '--', 'good', 'arg' ]; 90 | var opts = { 91 | '--': true, 92 | unknown: unknownFn 93 | }; 94 | var argv = parse(aliased, opts); 95 | 96 | t.same(unknown, ['--bad']); 97 | t.same(argv, { 98 | '--': ['good', 'arg'], 99 | '_': [] 100 | }) 101 | t.end(); 102 | }); 103 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/minimist/test/whitespace.js: -------------------------------------------------------------------------------- 1 | var parse = require('../'); 2 | var test = require('tape'); 3 | 4 | test('whitespace should be whitespace' , function (t) { 5 | t.plan(1); 6 | var x = parse([ '-x', '\t' ]).x; 7 | t.equal(x, '\t'); 8 | }); 9 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/object-assign/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var propIsEnumerable = Object.prototype.propertyIsEnumerable; 3 | 4 | function ToObject(val) { 5 | if (val == null) { 6 | throw new TypeError('Object.assign cannot be called with null or undefined'); 7 | } 8 | 9 | return Object(val); 10 | } 11 | 12 | function ownEnumerableKeys(obj) { 13 | var keys = Object.getOwnPropertyNames(obj); 14 | 15 | if (Object.getOwnPropertySymbols) { 16 | keys = keys.concat(Object.getOwnPropertySymbols(obj)); 17 | } 18 | 19 | return keys.filter(function (key) { 20 | return propIsEnumerable.call(obj, key); 21 | }); 22 | } 23 | 24 | module.exports = Object.assign || function (target, source) { 25 | var from; 26 | var keys; 27 | var to = ToObject(target); 28 | 29 | for (var s = 1; s < arguments.length; s++) { 30 | from = arguments[s]; 31 | keys = ownEnumerableKeys(Object(from)); 32 | 33 | for (var i = 0; i < keys.length; i++) { 34 | to[keys[i]] = from[keys[i]]; 35 | } 36 | } 37 | 38 | return to; 39 | }; 40 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/object-assign/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/object-assign/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "object-assign", 3 | "version": "3.0.0", 4 | "description": "ES6 Object.assign() ponyfill", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/sindresorhus/object-assign.git" 9 | }, 10 | "author": { 11 | "name": "Sindre Sorhus", 12 | "email": "sindresorhus@gmail.com", 13 | "url": "http://sindresorhus.com" 14 | }, 15 | "engines": { 16 | "node": ">=0.10.0" 17 | }, 18 | "scripts": { 19 | "test": "mocha" 20 | }, 21 | "files": [ 22 | "index.js" 23 | ], 24 | "keywords": [ 25 | "object", 26 | "assign", 27 | "extend", 28 | "properties", 29 | "es6", 30 | "ecmascript", 31 | "harmony", 32 | "ponyfill", 33 | "prollyfill", 34 | "polyfill", 35 | "shim", 36 | "browser" 37 | ], 38 | "devDependencies": { 39 | "mocha": "*" 40 | }, 41 | "gitHead": "02622dcb0d82bd81a071ed0b04fedf5e5eea7059", 42 | "bugs": { 43 | "url": "https://github.com/sindresorhus/object-assign/issues" 44 | }, 45 | "homepage": "https://github.com/sindresorhus/object-assign", 46 | "_id": "object-assign@3.0.0", 47 | "_shasum": "9bedd5ca0897949bca47e7ff408062d549f587f2", 48 | "_from": "object-assign@>=3.0.0 <4.0.0", 49 | "_npmVersion": "2.10.1", 50 | "_nodeVersion": "0.12.4", 51 | "_npmUser": { 52 | "name": "sindresorhus", 53 | "email": "sindresorhus@gmail.com" 54 | }, 55 | "dist": { 56 | "shasum": "9bedd5ca0897949bca47e7ff408062d549f587f2", 57 | "tarball": "http://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz" 58 | }, 59 | "maintainers": [ 60 | { 61 | "name": "sindresorhus", 62 | "email": "sindresorhus@gmail.com" 63 | } 64 | ], 65 | "directories": {}, 66 | "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", 67 | "readme": "ERROR: No README data found!" 68 | } 69 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/object-assign/readme.md: -------------------------------------------------------------------------------- 1 | # object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) 2 | 3 | > ES6 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) ponyfill 4 | 5 | > Ponyfill: A polyfill that doesn't overwrite the native method 6 | 7 | 8 | ## Install 9 | 10 | ```sh 11 | $ npm install --save object-assign 12 | ``` 13 | 14 | 15 | ## Usage 16 | 17 | ```js 18 | var objectAssign = require('object-assign'); 19 | 20 | objectAssign({foo: 0}, {bar: 1}); 21 | //=> {foo: 0, bar: 1} 22 | 23 | // multiple sources 24 | objectAssign({foo: 0}, {bar: 1}, {baz: 2}); 25 | //=> {foo: 0, bar: 1, baz: 2} 26 | 27 | // overwrites equal keys 28 | objectAssign({foo: 0}, {foo: 1}, {foo: 2}); 29 | //=> {foo: 2} 30 | 31 | // ignores null and undefined sources 32 | objectAssign({foo: 0}, null, {bar: 1}, undefined); 33 | //=> {foo: 0, bar: 1} 34 | ``` 35 | 36 | 37 | ## API 38 | 39 | ### objectAssign(target, source, [source, ...]) 40 | 41 | Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. 42 | 43 | 44 | ## Resources 45 | 46 | - [ES6 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) 47 | 48 | 49 | ## License 50 | 51 | MIT © [Sindre Sorhus](http://sindresorhus.com) 52 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/read-file-stdin/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/read-file-stdin/History.md: -------------------------------------------------------------------------------- 1 | 0.1.0 - October 15, 2014 2 | ------------------------- 3 | * returning a single buffer rather than an array (better for large inputs) 4 | 5 | 0.0.4 - May 7, 2014 6 | ------------------------- 7 | * switch from `node-concat-stream` to `stream-to-array` 8 | 9 | 0.0.3 - December 19, 2013 10 | ------------------------- 11 | * add repository to package.json 12 | 13 | 0.0.2 - December 19, 2013 14 | ------------------------- 15 | * peg node-concat-stream 16 | 17 | 0.0.1 - December 18, 2013 18 | ------------------------- 19 | :sparkles: 20 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/read-file-stdin/Makefile: -------------------------------------------------------------------------------- 1 | 2 | node_modules: package.json 3 | @npm install 4 | 5 | test: node_modules 6 | @mocha --reporter spec 7 | 8 | .PHONY: test -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/read-file-stdin/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # read-file-stdin 3 | 4 | Read from a file, falling back to stdin. 5 | 6 | ## Installation 7 | 8 | $ npm install read-file-stdin 9 | 10 | ## API 11 | 12 | ### read ([file], callback) 13 | 14 | Read from a `file`, falling back to stdin, and `callback(err, buffer)`. 15 | 16 | ## License 17 | 18 | MIT -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/read-file-stdin/index.js: -------------------------------------------------------------------------------- 1 | 2 | var gather = require('gather-stream'); 3 | var fs = require('fs'); 4 | 5 | /** 6 | * Expose `read`. 7 | */ 8 | 9 | module.exports = read; 10 | 11 | /** 12 | * Read from a `file`, falling back to stdin, and `callback(err, buffer)`. 13 | * 14 | * @param {String} file 15 | * @param {Function} callback 16 | */ 17 | 18 | function read (file, callback) { 19 | if ('function' == typeof file) callback = file, file = null; 20 | var stream = file ? fs.createReadStream(file) : process.stdin; 21 | stream.pipe(gather(callback)); 22 | } 23 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/read-file-stdin/node_modules/gather-stream/README.md: -------------------------------------------------------------------------------- 1 | # gather-stream 2 | 3 | Basically [concat-stream](https://github.com/maxogden/concat-stream) but minimaller implementation, and/but also with error handling. 4 | 5 | 6 | ## Usage 7 | 8 | Here's a simple example: 9 | 10 | var concat2 = require('gather-stream'), 11 | fs = require('fs'); 12 | 13 | fs.createReadStream('README.md').pipe(concat2(function (error,buffer) { 14 | if (error) console.error(error); 15 | else console.log("Read file, it was %s bytes long.", buffer.length); 16 | }); 17 | 18 | 19 | ## API 20 | 21 | * `var concat2 = require('gather-stream')` — the module exports a single wrapper function 22 | * `concat2([opts, ]cb)` — returns a Writable stream you can pipe into. If an error occurs on this stream *or* its source, `cb(error)` will be called; otherwise `cb(null, buffer)` will get you. You can provide `{maxLength:someNumberOfBytes}` as `opts` to limit memory mayhem if you wish — if the limit is about to be exceeded, an error will be fired instead. 23 | * that's about it 24 | 25 | 26 | ## License 27 | 28 | Copyright © 2014, Nathan Vander Wilt 29 | 30 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. 31 | 32 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 33 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/read-file-stdin/node_modules/gather-stream/index.js: -------------------------------------------------------------------------------- 1 | var Writable = require('stream').Writable, 2 | util = require('util'); 3 | 4 | function Gatherer(opts) { 5 | opts.decodeStrings = true; 6 | Writable.call(this, opts); 7 | this._length = 0; 8 | this._chunks = []; 9 | this._maxLength = ('maxLength' in opts) ? opts.maxLength : Infinity; 10 | } 11 | 12 | util.inherits(Gatherer, Writable); 13 | 14 | Gatherer.prototype._write = function (d, _enc, cb) { 15 | if (this._length + d.length > this._maxLength) { 16 | return cb(new Error("Maximum length exceeded!")); 17 | } 18 | this._chunks.push(d); 19 | this._length += d.length; 20 | cb(); 21 | } 22 | 23 | Gatherer.prototype.getBuffer = function () { 24 | return Buffer.concat(this._chunks, this._length); 25 | } 26 | 27 | module.exports = function (opts, cb) { 28 | if (typeof opts === 'function') { 29 | cb = opts; 30 | opts = {}; 31 | } 32 | var target = new Gatherer(opts); 33 | target.on('error', cb); 34 | target.on('pipe', function (source) { 35 | source.on('error', cb); 36 | }); 37 | target.on('unpipe', function (source) { 38 | source.removeListener('error', cb); 39 | }); 40 | target.on('finish', function () { 41 | cb(null, target.getBuffer()); 42 | }); 43 | return target; 44 | } 45 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/read-file-stdin/node_modules/gather-stream/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gather-stream", 3 | "version": "1.0.0", 4 | "description": "Gather a stream, callback with buffer (or error) when done", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git://github.com/natevw/gather-stream.git" 12 | }, 13 | "keywords": [ 14 | "stream", 15 | "buffer", 16 | "pipe" 17 | ], 18 | "author": { 19 | "name": "Nathan Vander Wilt" 20 | }, 21 | "license": "ISC", 22 | "bugs": { 23 | "url": "https://github.com/natevw/gather-stream/issues" 24 | }, 25 | "homepage": "https://github.com/natevw/gather-stream", 26 | "gitHead": "fedfa6499830ee8d38347d95603c057094650b35", 27 | "_id": "gather-stream@1.0.0", 28 | "_shasum": "b33994af457a8115700d410f317733cbe7a0904b", 29 | "_from": "gather-stream@>=1.0.0 <2.0.0", 30 | "_npmVersion": "1.4.20", 31 | "_npmUser": { 32 | "name": "natevw", 33 | "email": "natevw@yahoo.com" 34 | }, 35 | "maintainers": [ 36 | { 37 | "name": "natevw", 38 | "email": "natevw@yahoo.com" 39 | } 40 | ], 41 | "dist": { 42 | "shasum": "b33994af457a8115700d410f317733cbe7a0904b", 43 | "tarball": "http://registry.npmjs.org/gather-stream/-/gather-stream-1.0.0.tgz" 44 | }, 45 | "directories": {}, 46 | "_resolved": "https://registry.npmjs.org/gather-stream/-/gather-stream-1.0.0.tgz", 47 | "readme": "ERROR: No README data found!" 48 | } 49 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/read-file-stdin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "read-file-stdin", 3 | "repository": { 4 | "type": "git", 5 | "url": "git://github.com/ianstormtaylor/read-file-stdin.git" 6 | }, 7 | "description": "Read from a file, falling back to stdin.", 8 | "keywords": [ 9 | "read", 10 | "file", 11 | "stdin", 12 | "buffer" 13 | ], 14 | "version": "0.2.0", 15 | "license": "MIT", 16 | "dependencies": { 17 | "gather-stream": "^1.0.0" 18 | }, 19 | "devDependencies": { 20 | "mocha": "^1.15.1" 21 | }, 22 | "bugs": { 23 | "url": "https://github.com/ianstormtaylor/read-file-stdin/issues" 24 | }, 25 | "homepage": "https://github.com/ianstormtaylor/read-file-stdin", 26 | "_id": "read-file-stdin@0.2.0", 27 | "_shasum": "536bec6f17e0059ca37bc5bc7e39e97109a84166", 28 | "_from": "read-file-stdin@>=0.2.0 <0.3.0", 29 | "_npmVersion": "1.4.9", 30 | "_npmUser": { 31 | "name": "dominicbarnes", 32 | "email": "dominic@dbarnes.info" 33 | }, 34 | "maintainers": [ 35 | { 36 | "name": "ianstormtaylor", 37 | "email": "ian@ianstormtaylor.com" 38 | }, 39 | { 40 | "name": "dominicbarnes", 41 | "email": "dominic@dbarnes.info" 42 | } 43 | ], 44 | "dist": { 45 | "shasum": "536bec6f17e0059ca37bc5bc7e39e97109a84166", 46 | "tarball": "http://registry.npmjs.org/read-file-stdin/-/read-file-stdin-0.2.0.tgz" 47 | }, 48 | "directories": {}, 49 | "_resolved": "https://registry.npmjs.org/read-file-stdin/-/read-file-stdin-0.2.0.tgz", 50 | "readme": "ERROR: No README data found!" 51 | } 52 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/read-file-stdin/test/fixtures/simple.txt: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/read-file-stdin/test/index.js: -------------------------------------------------------------------------------- 1 | 2 | var assert = require('assert'); 3 | var fs = require('fs'); 4 | var read = require('..'); 5 | var Stream = require('stream').Readable; 6 | 7 | describe('read-file-stdin', function () { 8 | it('should read from a file', function (done) { 9 | read(__dirname + '/fixtures/simple.txt', function (err, buffer) { 10 | if (err) return done(err); 11 | assert.equal('test', buffer.toString()); 12 | done(); 13 | }); 14 | }); 15 | 16 | it('should read from stdin', function (done) { 17 | process.stdin = new Stream(); 18 | 19 | read(function (err, buffer) { 20 | if (err) return done(err); 21 | assert.equal('test', buffer.toString()); 22 | done(); 23 | }); 24 | 25 | process.stdin.emit('data', new Buffer('test')); 26 | process.stdin.emit('end'); 27 | }); 28 | 29 | it('should not return an array', function (done) { 30 | read(__dirname + '/fixtures/simple.txt', function (err, buffer) { 31 | if (err) return done(err); 32 | assert(!Array.isArray(buffer)); 33 | done(); 34 | }); 35 | }); 36 | 37 | it('should work with larger files', function (done) { 38 | read(__dirname + '/fixtures/big.txt', function (err, buffer) { 39 | if (err) return done(err); 40 | var expected = fs.readFileSync(__dirname + '/fixtures/big.txt', 'utf8'); 41 | assert.equal(expected, buffer.toString()); 42 | done(); 43 | }); 44 | }); 45 | }); 46 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/string.prototype.repeat/LICENSE-MIT.txt: -------------------------------------------------------------------------------- 1 | Copyright Mathias Bynens 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/string.prototype.repeat/README.md: -------------------------------------------------------------------------------- 1 | # ES6 `String.prototype.repeat` polyfill [![Build status](https://travis-ci.org/mathiasbynens/String.prototype.repeat.svg?branch=master)](https://travis-ci.org/mathiasbynens/String.prototype.repeat) 2 | 3 | A robust & optimized ES3-compatible polyfill for [the `String.prototype.repeat` method in ECMAScript 6](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.repeat). 4 | 5 | Other polyfills for `String.prototype.repeat` are available: 6 | 7 | * by [Paul Miller](http://paulmillr.com/) (~~[fails 8 tests](https://github.com/paulmillr/es6-shim/issues/164)~~ now passes all tests) 8 | 9 | ## Installation 10 | 11 | In a browser: 12 | 13 | ```html 14 | 15 | ``` 16 | 17 | Via [npm](http://npmjs.org/): 18 | 19 | ```bash 20 | npm install string.prototype.repeat 21 | ``` 22 | 23 | Then, in [Node.js](http://nodejs.org/): 24 | 25 | ```js 26 | require('string.prototype.repeat'); 27 | 28 | // On Windows and on Mac systems with default settings, case doesn’t matter, 29 | // which allows you to do this instead: 30 | require('String.prototype.repeat'); 31 | ``` 32 | 33 | ## Author 34 | 35 | | [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | 36 | |---| 37 | | [Mathias Bynens](http://mathiasbynens.be/) | 38 | 39 | ## License 40 | 41 | This polyfill is available under the [MIT](http://mths.be/mit) license. 42 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/string.prototype.repeat/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "string.prototype.repeat", 3 | "version": "0.2.0", 4 | "description": "A robust & optimized `String.prototype.repeat` polyfill, based on the ECMAScript 6 specification.", 5 | "homepage": "http://mths.be/repeat", 6 | "main": "repeat.js", 7 | "keywords": [ 8 | "string", 9 | "repeat", 10 | "es6", 11 | "ecmascript", 12 | "polyfill" 13 | ], 14 | "licenses": [ 15 | { 16 | "type": "MIT", 17 | "url": "http://mths.be/mit" 18 | } 19 | ], 20 | "author": { 21 | "name": "Mathias Bynens", 22 | "url": "http://mathiasbynens.be/" 23 | }, 24 | "repository": { 25 | "type": "git", 26 | "url": "git+https://github.com/mathiasbynens/String.prototype.repeat.git" 27 | }, 28 | "bugs": { 29 | "url": "https://github.com/mathiasbynens/String.prototype.repeat/issues" 30 | }, 31 | "files": [ 32 | "LICENSE-MIT.txt", 33 | "repeat.js" 34 | ], 35 | "directories": { 36 | "test": "tests" 37 | }, 38 | "scripts": { 39 | "test": "node tests/tests.js", 40 | "cover": "istanbul cover --report html --verbose --dir coverage tests/tests.js" 41 | }, 42 | "_id": "string.prototype.repeat@0.2.0", 43 | "dist": { 44 | "shasum": "aba36de08dcee6a5a337d49b2ea1da1b28fc0ecf", 45 | "tarball": "http://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-0.2.0.tgz" 46 | }, 47 | "_from": "string.prototype.repeat@>=0.2.0 <0.3.0", 48 | "_npmVersion": "1.4.3", 49 | "_npmUser": { 50 | "name": "mathias", 51 | "email": "mathias@qiwi.be" 52 | }, 53 | "maintainers": [ 54 | { 55 | "name": "mathias", 56 | "email": "mathias@qiwi.be" 57 | } 58 | ], 59 | "_shasum": "aba36de08dcee6a5a337d49b2ea1da1b28fc0ecf", 60 | "_resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-0.2.0.tgz", 61 | "readme": "ERROR: No README data found!" 62 | } 63 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/string.prototype.repeat/repeat.js: -------------------------------------------------------------------------------- 1 | /*! http://mths.be/repeat v0.2.0 by @mathias */ 2 | if (!String.prototype.repeat) { 3 | (function() { 4 | 'use strict'; // needed to support `apply`/`call` with `undefined`/`null` 5 | var defineProperty = (function() { 6 | // IE 8 only supports `Object.defineProperty` on DOM elements 7 | try { 8 | var object = {}; 9 | var $defineProperty = Object.defineProperty; 10 | var result = $defineProperty(object, object, object) && $defineProperty; 11 | } catch(error) {} 12 | return result; 13 | }()); 14 | var repeat = function(count) { 15 | if (this == null) { 16 | throw TypeError(); 17 | } 18 | var string = String(this); 19 | // `ToInteger` 20 | var n = count ? Number(count) : 0; 21 | if (n != n) { // better `isNaN` 22 | n = 0; 23 | } 24 | // Account for out-of-bounds indices 25 | if (n < 0 || n == Infinity) { 26 | throw RangeError(); 27 | } 28 | var result = ''; 29 | while (n) { 30 | if (n % 2 == 1) { 31 | result += string; 32 | } 33 | if (n > 1) { 34 | string += string; 35 | } 36 | n >>= 1; 37 | } 38 | return result; 39 | }; 40 | if (defineProperty) { 41 | defineProperty(String.prototype, 'repeat', { 42 | 'value': repeat, 43 | 'configurable': true, 44 | 'writable': true 45 | }); 46 | } else { 47 | String.prototype.repeat = repeat; 48 | } 49 | }()); 50 | } 51 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/write-file-stdout/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/write-file-stdout/History.md: -------------------------------------------------------------------------------- 1 | 0.0.2 - December 19, 2013 2 | ------------------------- 3 | * add repository to package.json 4 | 5 | 0.0.1 - December 18, 2013 6 | ------------------------- 7 | :sparkles: -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/write-file-stdout/Makefile: -------------------------------------------------------------------------------- 1 | 2 | node_modules: package.json 3 | @npm install 4 | 5 | test: node_modules 6 | @mocha --reporter spec 7 | 8 | .PHONY: test -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/write-file-stdout/Readme.md: -------------------------------------------------------------------------------- 1 | # write-file-stdout 2 | 3 | Write to a file, falling back to stdout. 4 | 5 | ## Installation 6 | 7 | $ npm install write-file-stdout 8 | 9 | ## API 10 | 11 | ### write ([file], contents) 12 | 13 | Write `contents` to a `file`, falling back to stdout. 14 | 15 | ## License 16 | 17 | MIT 18 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/write-file-stdout/index.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | 3 | /** 4 | * Expose `write`. 5 | */ 6 | 7 | module.exports = write; 8 | 9 | /** 10 | * Write `contents` to a `file`, falling back to stdout. 11 | * 12 | * @param {String} file 13 | * @param {String} contents 14 | */ 15 | 16 | function write (file, contents) { 17 | if (1 == arguments.length) contents = file, file = null; 18 | if (file) return fs.writeFileSync(file, contents); 19 | process.stdout.write(contents); 20 | } 21 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/write-file-stdout/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "write-file-stdout", 3 | "repository": { 4 | "type": "git", 5 | "url": "git://github.com/ianstormtaylor/write-file-stdout.git" 6 | }, 7 | "description": "Write to a file, falling back to stdout.", 8 | "keywords": [ 9 | "write", 10 | "file", 11 | "stdout" 12 | ], 13 | "version": "0.0.2", 14 | "license": "MIT", 15 | "devDependencies": { 16 | "mocha": "~1.15.1" 17 | }, 18 | "readme": "# write-file-stdout\n\n Write to a file, falling back to stdout.\n\n## Installation\n\n $ npm install write-file-stdout\n\n## API\n\n### write ([file], contents)\n\n Write `contents` to a `file`, falling back to stdout.\n\n## License\n\n MIT\n", 19 | "readmeFilename": "Readme.md", 20 | "bugs": { 21 | "url": "https://github.com/ianstormtaylor/write-file-stdout/issues" 22 | }, 23 | "homepage": "https://github.com/ianstormtaylor/write-file-stdout", 24 | "_id": "write-file-stdout@0.0.2", 25 | "dist": { 26 | "shasum": "c252d7c7c5b1b402897630e3453c7bfe690d9ca1", 27 | "tarball": "http://registry.npmjs.org/write-file-stdout/-/write-file-stdout-0.0.2.tgz" 28 | }, 29 | "_from": "write-file-stdout@0.0.2", 30 | "_npmVersion": "1.3.15", 31 | "_npmUser": { 32 | "name": "ianstormtaylor", 33 | "email": "ian@ianstormtaylor.com" 34 | }, 35 | "maintainers": [ 36 | { 37 | "name": "ianstormtaylor", 38 | "email": "ian@ianstormtaylor.com" 39 | } 40 | ], 41 | "directories": {}, 42 | "_shasum": "c252d7c7c5b1b402897630e3453c7bfe690d9ca1", 43 | "_resolved": "https://registry.npmjs.org/write-file-stdout/-/write-file-stdout-0.0.2.tgz" 44 | } 45 | -------------------------------------------------------------------------------- /node_modules/perfectionist/node_modules/write-file-stdout/test/index.js: -------------------------------------------------------------------------------- 1 | 2 | var assert = require('assert'); 3 | var fs = require('fs'); 4 | var write = require('..'); 5 | 6 | describe('write-file-stdout', function () { 7 | afterEach(function () { 8 | if (fs.existsSync('fixture.txt')) fs.unlinkSync('fixture.txt'); 9 | }); 10 | 11 | it('should write to a file', function () { 12 | write('fixture.txt', 'test'); 13 | assert.equal('test', fs.readFileSync('fixture.txt')); 14 | }); 15 | 16 | it('should write to stdout', function (done) { 17 | process.stdout.write = function (data) { 18 | assert.equal('test', data); 19 | done(); 20 | }; 21 | write('test'); 22 | }); 23 | }); -------------------------------------------------------------------------------- /node_modules/perfectionist/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "perfectionist", 3 | "version": "2.0.0", 4 | "description": "Beautify CSS files.", 5 | "main": "dist/index.js", 6 | "bin": { 7 | "perfectionist": "bin/cmd.js" 8 | }, 9 | "files": [ 10 | "bin", 11 | "LICENSE-MIT", 12 | "dist" 13 | ], 14 | "scripts": { 15 | "prepublish": "babel src --out-dir dist --ignore /__tests__/", 16 | "test-unformatted": "babel-tape-runner \"src/**/__tests__/*.js\"", 17 | "test": "npm run test-unformatted | faucet" 18 | }, 19 | "keywords": [ 20 | "beautify", 21 | "css", 22 | "format", 23 | "postcss", 24 | "postcss-plugin", 25 | "pretty" 26 | ], 27 | "license": "MIT", 28 | "homepage": "https://github.com/ben-eb/perfectionist", 29 | "author": { 30 | "name": "Ben Briggs", 31 | "email": "beneb.info@gmail.com", 32 | "url": "http://beneb.info" 33 | }, 34 | "repository": { 35 | "type": "git", 36 | "url": "git+https://github.com/ben-eb/perfectionist.git" 37 | }, 38 | "dependencies": { 39 | "comment-regex": "^1.0.0", 40 | "minimist": "^1.1.3", 41 | "object-assign": "^3.0.0", 42 | "postcss": "^5.0.4", 43 | "read-file-stdin": "^0.2.0", 44 | "string.prototype.repeat": "^0.2.0", 45 | "write-file-stdout": "0.0.2" 46 | }, 47 | "devDependencies": { 48 | "babel": "^5.8.21", 49 | "babel-tape-runner": "^1.2.0", 50 | "faucet": "0.0.1", 51 | "tape": "^4.0.3" 52 | }, 53 | "gitHead": "8459afe77f96c493328a29bd07762fe1615c0af8", 54 | "bugs": { 55 | "url": "https://github.com/ben-eb/perfectionist/issues" 56 | }, 57 | "_id": "perfectionist@2.0.0", 58 | "_shasum": "e676985353d418fe49f8ffd415c54c34a9c12f9c", 59 | "_from": "perfectionist@>=2.0.0 <3.0.0", 60 | "_npmVersion": "2.12.1", 61 | "_nodeVersion": "2.3.4", 62 | "_npmUser": { 63 | "name": "beneb", 64 | "email": "beneb.info@gmail.com" 65 | }, 66 | "dist": { 67 | "shasum": "e676985353d418fe49f8ffd415c54c34a9c12f9c", 68 | "tarball": "http://registry.npmjs.org/perfectionist/-/perfectionist-2.0.0.tgz" 69 | }, 70 | "maintainers": [ 71 | { 72 | "name": "beneb", 73 | "email": "beneb.info@gmail.com" 74 | } 75 | ], 76 | "directories": {}, 77 | "_resolved": "https://registry.npmjs.org/perfectionist/-/perfectionist-2.0.0.tgz" 78 | } 79 | -------------------------------------------------------------------------------- /node_modules/postcss-safe-parser/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.1 2 | * Fix `url()` parsing. 3 | 4 | ## 1.0 5 | 6 | * Initial release from PostCSS sources. 7 | -------------------------------------------------------------------------------- /node_modules/postcss-safe-parser/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright 2013 Andrey Sitnik 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /node_modules/postcss-safe-parser/README.md: -------------------------------------------------------------------------------- 1 | # PostCSS Safe Parser [![Build Status][ci-img]][ci] 2 | 3 | 6 | 7 | A fault-tolerant CSS parser for [PostCSS], which will find & fix syntax errors, 8 | capable of parsing any input. It is useful for: 9 | 10 | * Parse legacy code with many hacks. For example, it can parse all examples 11 | from [Browserhacks]. 12 | * Works with demo tools with live input like [Autoprefixer demo]. 13 | 14 | [Autoprefixer demo]: http://simevidas.jsbin.com/gufoko/quiet 15 | [Browserhacks]: http://browserhacks.com/ 16 | [PostCSS]: https://github.com/postcss/postcss 17 | [ci-img]: https://img.shields.io/travis/postcss/postcss-safe-parser.svg 18 | [ci]: https://travis-ci.org/postcss/postcss-safe-parser 19 | 20 | 21 | Sponsored by Evil Martians 22 | 23 | 24 | ## Usage 25 | 26 | ```js 27 | var safe = require('postcss-safe-parser'); 28 | var badCss = 'a {'; 29 | 30 | postcss(plugins).process(badCss, { parser: safe }).then(function (result) { 31 | result.css //= 'a {}' 32 | }); 33 | ``` 34 | -------------------------------------------------------------------------------- /node_modules/postcss-safe-parser/lib/safe-parse.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | exports['default'] = safeParse; 5 | 6 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 7 | 8 | var _postcssLibInput = require('postcss/lib/input'); 9 | 10 | var _postcssLibInput2 = _interopRequireDefault(_postcssLibInput); 11 | 12 | var _safeParser = require('./safe-parser'); 13 | 14 | var _safeParser2 = _interopRequireDefault(_safeParser); 15 | 16 | function safeParse(css, opts) { 17 | var input = new _postcssLibInput2['default'](css, opts); 18 | 19 | var parser = new _safeParser2['default'](input); 20 | parser.tokenize(); 21 | parser.loop(); 22 | 23 | return parser.root; 24 | } 25 | 26 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss-safe-parser/lib/safe-parser.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | 5 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 6 | 7 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } 8 | 9 | function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 10 | 11 | var _postcssLibParser = require('postcss/lib/parser'); 12 | 13 | var _postcssLibParser2 = _interopRequireDefault(_postcssLibParser); 14 | 15 | var _safeTokenize = require('./safe-tokenize'); 16 | 17 | var _safeTokenize2 = _interopRequireDefault(_safeTokenize); 18 | 19 | var SafeParser = (function (_Parser) { 20 | _inherits(SafeParser, _Parser); 21 | 22 | function SafeParser() { 23 | _classCallCheck(this, SafeParser); 24 | 25 | _Parser.apply(this, arguments); 26 | } 27 | 28 | SafeParser.prototype.tokenize = function tokenize() { 29 | this.tokens = _safeTokenize2['default'](this.input); 30 | }; 31 | 32 | SafeParser.prototype.unknownDecl = function unknownDecl(node, token) { 33 | node.source.start = { line: token[2], column: token[3] }; 34 | node.raws.before += node.prop + node.raws.between; 35 | node.raws.between = ''; 36 | node.prop = token[1]; 37 | }; 38 | 39 | SafeParser.prototype.unclosedBracket = function unclosedBracket() {}; 40 | 41 | SafeParser.prototype.unknownWord = function unknownWord(start) { 42 | var buffer = this.tokens.slice(start, this.pos + 1); 43 | this.spaces += buffer.map(function (i) { 44 | return i[1]; 45 | }).join(''); 46 | }; 47 | 48 | SafeParser.prototype.unexpectedClose = function unexpectedClose() { 49 | this.current.raws.after += '}'; 50 | }; 51 | 52 | SafeParser.prototype.unclosedBlock = function unclosedBlock() {}; 53 | 54 | SafeParser.prototype.doubleColon = function doubleColon() {}; 55 | 56 | SafeParser.prototype.unnamedAtrule = function unnamedAtrule(node) { 57 | node.name = ''; 58 | }; 59 | 60 | SafeParser.prototype.precheckMissedSemicolon = function precheckMissedSemicolon(tokens) { 61 | var colon = this.colon(tokens); 62 | if (colon === false) return; 63 | 64 | var split = undefined; 65 | for (split = colon - 1; split >= 0; split--) { 66 | if (tokens[split][0] === 'word') break; 67 | } 68 | for (split -= 1; split >= 0; split--) { 69 | if (tokens[split][0] !== 'space') { 70 | split += 1; 71 | break; 72 | } 73 | } 74 | var other = tokens.splice(split, tokens.length - split); 75 | this.decl(other); 76 | }; 77 | 78 | SafeParser.prototype.checkMissedSemicolon = function checkMissedSemicolon() {}; 79 | 80 | return SafeParser; 81 | })(_postcssLibParser2['default']); 82 | 83 | exports['default'] = SafeParser; 84 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss-safe-parser/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "postcss-safe-parser", 3 | "version": "1.0.1", 4 | "description": "Fault-tolerant CSS parser for PostCSS", 5 | "keywords": [ 6 | "css", 7 | "postcss", 8 | "postcss-syntax", 9 | "parser", 10 | "fault tolerant" 11 | ], 12 | "author": { 13 | "name": "Andrey Sitnik", 14 | "email": "andrey@sitnik.ru" 15 | }, 16 | "license": "MIT", 17 | "repository": { 18 | "type": "git", 19 | "url": "git+https://github.com/postcss/postcss-safe-parser.git" 20 | }, 21 | "dependencies": { 22 | "postcss": "^5.0.3" 23 | }, 24 | "devDependencies": { 25 | "postcss-parser-tests": "5.0.1", 26 | "gulp-json-editor": "2.2.1", 27 | "babel-eslint": "4.1.0", 28 | "gulp-eslint": "1.0.0", 29 | "gulp-babel": "5.2.1", 30 | "gulp-mocha": "2.1.3", 31 | "mocha": "2.2.5", 32 | "gulp": "3.9.0", 33 | "chai": "3.2.0", 34 | "del": "1.2.1", 35 | "babel-core": "5.8.23" 36 | }, 37 | "scripts": { 38 | "test": "gulp" 39 | }, 40 | "main": "lib/safe-parse", 41 | "bugs": { 42 | "url": "https://github.com/postcss/postcss-safe-parser/issues" 43 | }, 44 | "homepage": "https://github.com/postcss/postcss-safe-parser#readme", 45 | "_id": "postcss-safe-parser@1.0.1", 46 | "_shasum": "c11b9d8c90bf83c20394aa032c79fb5a0dc2334d", 47 | "_from": "postcss-safe-parser@*", 48 | "_npmVersion": "2.13.0", 49 | "_nodeVersion": "2.4.0", 50 | "_npmUser": { 51 | "name": "ai", 52 | "email": "andrey@sitnik.ru" 53 | }, 54 | "dist": { 55 | "shasum": "c11b9d8c90bf83c20394aa032c79fb5a0dc2334d", 56 | "tarball": "http://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-1.0.1.tgz" 57 | }, 58 | "maintainers": [ 59 | { 60 | "name": "ai", 61 | "email": "andrey@sitnik.ru" 62 | } 63 | ], 64 | "directories": {}, 65 | "_resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-1.0.1.tgz", 66 | "readme": "ERROR: No README data found!" 67 | } 68 | -------------------------------------------------------------------------------- /node_modules/postcss-scss/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.1.2 2 | * Fix interpolation inside string. 3 | 4 | ## 0.1.1 5 | * Fix `url()` parsing. 6 | 7 | ## 0.1 8 | * Initial release. 9 | -------------------------------------------------------------------------------- /node_modules/postcss-scss/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright 2013 Andrey Sitnik 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /node_modules/postcss-scss/README.md: -------------------------------------------------------------------------------- 1 | # PostCSS SCSS Syntax [![Build Status][ci-img]][ci] 2 | 3 | 6 | 7 | A [SCSS] parser for [PostCSS]. 8 | 9 | **This module does not compile SCSS.** It simply parses mixins as custom 10 | at-rules & variables as properties, so that PostCSS plugins can then transform 11 | SCSS source code alongside CSS. 12 | 13 | [PostCSS]: https://github.com/postcss/postcss 14 | [ci-img]: https://img.shields.io/travis/postcss/postcss-scss.svg 15 | [SCSS]: http://sass-lang.com/ 16 | [ci]: https://travis-ci.org/postcss/postcss-scss 17 | 18 | 19 | Sponsored by Evil Martians 20 | 21 | 22 | ## Usage 23 | 24 | ### SCSS Transformations 25 | 26 | The main use case of this plugin is to apply PostCSS transformations directly 27 | to SCSS source code. For example, if you ship a theme written in SCSS and need 28 | [Autoprefixer] to add the appropriate vendor prefixes to it; or you need to 29 | lint SCSS with a plugin such as [Stylelint]. 30 | 31 | ```js 32 | var syntax = require('postcss-scss'); 33 | postcss(plugins).process(scss, { syntax: syntax }).then(function (result) { 34 | result.content // SCSS with transformations 35 | }); 36 | ``` 37 | 38 | [Autoprefixer]: https://github.com/postcss/autoprefixer 39 | [Stylelint]: http://stylelint.io/ 40 | 41 | ### Inline Comments for PostCSS 42 | 43 | This module also enables parsing of single-line comments in CSS source code. 44 | 45 | ```scss 46 | :root { 47 | // Main theme color 48 | --color: red; 49 | } 50 | ``` 51 | 52 | Note that you don't need a special stringifier to handle the output; the default 53 | one will automatically convert single line comments into block comments. 54 | 55 | ```js 56 | var syntax = require('postcss-scss'); 57 | postcss(plugins).process(scss, { parser: syntax }).then(function (result) { 58 | result.css // CSS with normal comments 59 | }); 60 | ``` 61 | -------------------------------------------------------------------------------- /node_modules/postcss-scss/lib/scss-parse.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | exports['default'] = scssParse; 5 | 6 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 7 | 8 | var _postcssLibInput = require('postcss/lib/input'); 9 | 10 | var _postcssLibInput2 = _interopRequireDefault(_postcssLibInput); 11 | 12 | var _scssParser = require('./scss-parser'); 13 | 14 | var _scssParser2 = _interopRequireDefault(_scssParser); 15 | 16 | function scssParse(scss, opts) { 17 | var input = new _postcssLibInput2['default'](scss, opts); 18 | 19 | var parser = new _scssParser2['default'](input); 20 | parser.tokenize(); 21 | parser.loop(); 22 | 23 | return parser.root; 24 | } 25 | 26 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss-scss/lib/scss-parser.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | 5 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 6 | 7 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } 8 | 9 | function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 10 | 11 | var _postcssLibComment = require('postcss/lib/comment'); 12 | 13 | var _postcssLibComment2 = _interopRequireDefault(_postcssLibComment); 14 | 15 | var _postcssLibParser = require('postcss/lib/parser'); 16 | 17 | var _postcssLibParser2 = _interopRequireDefault(_postcssLibParser); 18 | 19 | var _scssTokenize = require('./scss-tokenize'); 20 | 21 | var _scssTokenize2 = _interopRequireDefault(_scssTokenize); 22 | 23 | var ScssParser = (function (_Parser) { 24 | _inherits(ScssParser, _Parser); 25 | 26 | function ScssParser() { 27 | _classCallCheck(this, ScssParser); 28 | 29 | _Parser.apply(this, arguments); 30 | } 31 | 32 | ScssParser.prototype.tokenize = function tokenize() { 33 | this.tokens = _scssTokenize2['default'](this.input); 34 | }; 35 | 36 | ScssParser.prototype.comment = function comment(token) { 37 | if (token[6] === 'inline') { 38 | var node = new _postcssLibComment2['default'](); 39 | this.init(node, token[2], token[3]); 40 | node.raws.inline = true; 41 | node.source.end = { line: token[4], column: token[5] }; 42 | 43 | var text = token[1].slice(2); 44 | if (/^\s*$/.test(text)) { 45 | node.text = ''; 46 | node.raws.left = text; 47 | node.raws.right = ''; 48 | } else { 49 | var match = text.match(/^(\s*)([^]*[^\s])(\s*)$/); 50 | node.text = match[2]; 51 | node.raws.left = match[1]; 52 | node.raws.right = match[3]; 53 | } 54 | } else { 55 | _Parser.prototype.comment.call(this, token); 56 | } 57 | }; 58 | 59 | return ScssParser; 60 | })(_postcssLibParser2['default']); 61 | 62 | exports['default'] = ScssParser; 63 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss-scss/lib/scss-stringifier.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | 5 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 6 | 7 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } 8 | 9 | function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 10 | 11 | var _postcssLibStringifier = require('postcss/lib/stringifier'); 12 | 13 | var _postcssLibStringifier2 = _interopRequireDefault(_postcssLibStringifier); 14 | 15 | var ScssStringifier = (function (_Stringifier) { 16 | _inherits(ScssStringifier, _Stringifier); 17 | 18 | function ScssStringifier() { 19 | _classCallCheck(this, ScssStringifier); 20 | 21 | _Stringifier.apply(this, arguments); 22 | } 23 | 24 | ScssStringifier.prototype.comment = function comment(node) { 25 | var left = this.raw(node, 'left', 'commentLeft'); 26 | var right = this.raw(node, 'right', 'commentRight'); 27 | 28 | if (node.raws.inline) { 29 | this.builder('//' + left + node.text + right, node); 30 | } else { 31 | this.builder('/*' + left + node.text + right + '*/', node); 32 | } 33 | }; 34 | 35 | return ScssStringifier; 36 | })(_postcssLibStringifier2['default']); 37 | 38 | exports['default'] = ScssStringifier; 39 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss-scss/lib/scss-stringify.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | exports['default'] = scssStringify; 5 | 6 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 7 | 8 | var _scssStringifier = require('./scss-stringifier'); 9 | 10 | var _scssStringifier2 = _interopRequireDefault(_scssStringifier); 11 | 12 | function scssStringify(node, builder) { 13 | var str = new _scssStringifier2['default'](builder); 14 | str.stringify(node); 15 | } 16 | 17 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss-scss/lib/scss-syntax.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | 5 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 6 | 7 | var _scssStringify = require('./scss-stringify'); 8 | 9 | var _scssStringify2 = _interopRequireDefault(_scssStringify); 10 | 11 | var _scssParse = require('./scss-parse'); 12 | 13 | var _scssParse2 = _interopRequireDefault(_scssParse); 14 | 15 | exports.parse = _scssParse2['default']; 16 | exports.stringify = _scssStringify2['default']; -------------------------------------------------------------------------------- /node_modules/postcss-scss/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "postcss-scss", 3 | "version": "0.1.2", 4 | "description": "SCSS parser for PostCSS", 5 | "keywords": [ 6 | "css", 7 | "postcss", 8 | "postcss-syntax", 9 | "parser", 10 | "scss", 11 | "sass" 12 | ], 13 | "author": { 14 | "name": "Andrey Sitnik", 15 | "email": "andrey@sitnik.ru" 16 | }, 17 | "license": "MIT", 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/postcss/postcss-scss.git" 21 | }, 22 | "dependencies": { 23 | "postcss": "^5.0.3" 24 | }, 25 | "devDependencies": { 26 | "postcss-parser-tests": "5.0.1", 27 | "gulp-json-editor": "2.2.1", 28 | "babel-eslint": "4.1.0", 29 | "gulp-eslint": "1.0.0", 30 | "gulp-babel": "5.2.1", 31 | "gulp-mocha": "2.1.3", 32 | "mocha": "2.2.5", 33 | "gulp": "3.9.0", 34 | "chai": "3.2.0", 35 | "del": "1.2.1", 36 | "babel-core": "5.8.23" 37 | }, 38 | "scripts": { 39 | "test": "gulp" 40 | }, 41 | "main": "lib/scss-syntax", 42 | "bugs": { 43 | "url": "https://github.com/postcss/postcss-scss/issues" 44 | }, 45 | "homepage": "https://github.com/postcss/postcss-scss#readme", 46 | "_id": "postcss-scss@0.1.2", 47 | "_shasum": "2a15b513a839a99e188b520b54d88ff74b4edf79", 48 | "_from": "postcss-scss@>=0.1.2 <0.2.0", 49 | "_npmVersion": "2.13.0", 50 | "_nodeVersion": "2.4.0", 51 | "_npmUser": { 52 | "name": "ai", 53 | "email": "andrey@sitnik.ru" 54 | }, 55 | "dist": { 56 | "shasum": "2a15b513a839a99e188b520b54d88ff74b4edf79", 57 | "tarball": "http://registry.npmjs.org/postcss-scss/-/postcss-scss-0.1.2.tgz" 58 | }, 59 | "maintainers": [ 60 | { 61 | "name": "ai", 62 | "email": "andrey@sitnik.ru" 63 | } 64 | ], 65 | "directories": {}, 66 | "_resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-0.1.2.tgz", 67 | "readme": "ERROR: No README data found!" 68 | } 69 | -------------------------------------------------------------------------------- /node_modules/postcss/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright 2013 Andrey Sitnik 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/at-rule.d.ts: -------------------------------------------------------------------------------- 1 | import Container from './container'; 2 | import postcss from './postcss'; 3 | export default class AtRule extends Container implements postcss.AtRule { 4 | /** 5 | * Returns a string representing the node's type. Possible values are 6 | * root, atrule, rule, decl or comment. 7 | */ 8 | type: string; 9 | /** 10 | * Contains information to generate byte-to-byte equal node string as it 11 | * was in origin input. 12 | */ 13 | raws: postcss.AtRuleRaws; 14 | /** 15 | * The identifier that immediately follows the @. 16 | */ 17 | name: string; 18 | /** 19 | * These are the values that follow the at-rule's name, but precede any {} 20 | * block. The spec refers to this area as the at-rule's "prelude". 21 | */ 22 | params: string; 23 | /** 24 | * Represents an at-rule. This node will have a nodes property, 25 | * representing its children, if it is followed in the CSS by a {} block. 26 | */ 27 | constructor(defaults?: postcss.AtRuleNewProps); 28 | /** 29 | * @param overrides New properties to override in the clone. 30 | * @returns A clone of this node. The node and its (cloned) children will 31 | * have a clean parent and code style properties. 32 | */ 33 | clone(overrides?: Object): AtRule; 34 | toJSON(): postcss.JsonAtRule; 35 | append(...children: any[]): Container; 36 | prepend(...children: any[]): Container; 37 | insertBefore(oldNode: any, newNode: any): Container; 38 | insertAfter(oldNode: any, newNode: any): Container; 39 | afterName: string; 40 | _params: string; 41 | } 42 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/comment.d.ts: -------------------------------------------------------------------------------- 1 | import postcss from './postcss'; 2 | import Node from './node'; 3 | export default class Comment extends Node implements postcss.Comment { 4 | /** 5 | * Returns a string representing the node's type. Possible values are 6 | * root, atrule, rule, decl or comment. 7 | */ 8 | type: string; 9 | /** 10 | * The comment's text. 11 | */ 12 | text: string; 13 | /** 14 | * Represents a comment between declarations or statements (rule and at-rules). 15 | * Comments inside selectors, at-rules parameters, or declaration values will 16 | * be stored in the Node#raws properties. 17 | */ 18 | constructor(defaults?: postcss.CommentNewProps); 19 | /** 20 | * @param overrides New properties to override in the clone. 21 | * @returns A clone of this node. The node and its (cloned) children will 22 | * have a clean parent and code style properties. 23 | */ 24 | clone(overrides?: Object): any; 25 | toJSON(): postcss.JsonComment; 26 | left: string; 27 | right: string; 28 | } 29 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/declaration.d.ts: -------------------------------------------------------------------------------- 1 | import postcss from './postcss'; 2 | import Node from './node'; 3 | export default class Declaration extends Node implements postcss.Declaration { 4 | /** 5 | * Returns a string representing the node's type. Possible values are 6 | * root, atrule, rule, decl or comment. 7 | */ 8 | type: string; 9 | /** 10 | * Contains information to generate byte-to-byte equal node string as it 11 | * was in origin input. 12 | */ 13 | raws: postcss.DeclarationRaws; 14 | /** 15 | * The declaration's property name. 16 | */ 17 | prop: string; 18 | /** 19 | * The declaration's value. This value will be cleaned of comments. If the 20 | * source value contained comments, those comments will be available in the 21 | * _value.raws property. If you have not changed the value, the result of 22 | * decl.toString() will include the original raws value (comments and all). 23 | */ 24 | value: string; 25 | /** 26 | * True if the declaration has an !important annotation. 27 | */ 28 | important: boolean; 29 | /** 30 | * Represents a CSS declaration. 31 | */ 32 | constructor(defaults?: postcss.DeclarationNewProps); 33 | /** 34 | * @param overrides New properties to override in the clone. 35 | * @returns A clone of this node. The node and its (cloned) children will 36 | * have a clean parent and code style properties. 37 | */ 38 | clone(overrides?: Object): any; 39 | toJSON(): postcss.JsonDeclaration; 40 | _value: string; 41 | _important: string; 42 | } 43 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/input.d.ts: -------------------------------------------------------------------------------- 1 | import CssSyntaxError from './css-syntax-error'; 2 | import PreviousMap from './previous-map'; 3 | import LazyResult from './lazy-result'; 4 | import postcss from './postcss'; 5 | import Result from './result'; 6 | export default class Input implements postcss.Input { 7 | /** 8 | * The absolute path to the CSS source file defined with the "from" option. 9 | */ 10 | file: string; 11 | /** 12 | * The unique ID of the CSS source. Used if "from" option is not provided 13 | * (because PostCSS does not know the file path). 14 | */ 15 | id: string; 16 | /** 17 | * Represents the input source map passed from a compilation step before 18 | * PostCSS (for example, from the Sass compiler). 19 | */ 20 | map: PreviousMap; 21 | css: string; 22 | /** 23 | * Represents the source CSS. 24 | */ 25 | constructor(css: string | { 26 | toString(): string; 27 | } | LazyResult | Result, opts?: { 28 | safe?: boolean | any; 29 | from?: string; 30 | }); 31 | /** 32 | * The CSS source identifier. Contains input.file if the user set the "from" 33 | * option, or input.id if he/she did not. 34 | */ 35 | from: string; 36 | error(message: string, line: number, column: number, opts?: { 37 | plugin?: string; 38 | }): CssSyntaxError; 39 | /** 40 | * Reads the input source map. 41 | * @returns A symbol position in the input source (e.g., in a Sass file 42 | * that was compiled to CSS before being passed to PostCSS): 43 | */ 44 | origin(line: number, column: number): postcss.InputOrigin; 45 | private mapResolve(file); 46 | } 47 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/lazy-result.d.ts: -------------------------------------------------------------------------------- 1 | import Processor from './processor'; 2 | import postcss from './postcss'; 3 | import Result from './result'; 4 | import Root from './root'; 5 | export default class LazyResult implements postcss.LazyResult { 6 | private stringified; 7 | private processed; 8 | private result; 9 | private error; 10 | private plugin; 11 | private processing; 12 | /** 13 | * Promise proxy for result of PostCSS transformations. 14 | */ 15 | constructor(processor: Processor, 16 | /** 17 | * String with input CSS or any object with toString() method, like file stream. 18 | * Optionally, send Result instance and the processor will take the existing 19 | * [Root] parser from it. 20 | */ 21 | css: string | { 22 | toString(): string; 23 | } | LazyResult | Result, opts?: postcss.ProcessOptions); 24 | /** 25 | * @returns A processor used for CSS transformations. 26 | */ 27 | processor: Processor; 28 | /** 29 | * @returns Options from the Processor#process(css, opts) call that produced 30 | * this Result instance. 31 | */ 32 | opts: postcss.ResultOptions; 33 | /** 34 | * Processes input CSS through synchronous plugins and converts Root to 35 | * CSS string. This property will work only with synchronous plugins. If 36 | * processor contains any asynchronous plugins it will throw a error. You 37 | * should use LazyResult#then() instead. 38 | */ 39 | css: string; 40 | /** 41 | * Alias for css property to use when syntaxes generate non-CSS output. 42 | */ 43 | content: string; 44 | /** 45 | * Processes input CSS through synchronous plugins. This property will 46 | * work only with synchronous plugins. If processor contains any 47 | * asynchronous plugins it will throw an error. You should use 48 | * LazyResult#then() instead. 49 | */ 50 | map: postcss.ResultMap; 51 | /** 52 | * Processes input CSS through synchronous plugins. This property will work 53 | * only with synchronous plugins. If processor contains any asynchronous 54 | * plugins it will throw an error. You should use LazyResult#then() instead. 55 | */ 56 | root: Root; 57 | /** 58 | * Processes input CSS through synchronous plugins. This property will work 59 | * only with synchronous plugins. If processor contains any asynchronous 60 | * plugins it will throw an error. You should use LazyResult#then() instead. 61 | */ 62 | messages: postcss.ResultMessage[]; 63 | /** 64 | * Processes input CSS through synchronous plugins and calls Result#warnings(). 65 | * This property will work only with synchronous plugins. If processor 66 | * contains any asynchronous plugins it will throw a error. You should use 67 | * LazyResult#then() instead. 68 | */ 69 | warnings(): postcss.ResultMessage[]; 70 | /** 71 | * Alias for css property. 72 | */ 73 | toString(): string; 74 | /** 75 | * Processes input CSS through synchronous and asynchronous plugins. 76 | * @param onRejected Called if any plugin throws an error. 77 | */ 78 | then(onFulfilled: (result: Result) => void, onRejected?: (error: Error) => void): Function | any; 79 | /** 80 | * Processes input CSS through synchronous and asynchronous plugins. 81 | * @param onRejected Called if any plugin throws an error. 82 | */ 83 | catch(onRejected: (error: Error) => void): Function | any; 84 | private handleError(error, plugin); 85 | private asyncTick(resolve, reject); 86 | private async(); 87 | sync(): Result; 88 | private run(plugin); 89 | stringify(): Result; 90 | } 91 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/list.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Contains helpers for safely splitting lists of CSS values, preserving 3 | * parentheses and quotes. 4 | */ 5 | declare module List { 6 | /** 7 | * Safely splits space-separated values (such as those for background, 8 | * border-radius and other shorthand properties). 9 | */ 10 | function space(str: string): string[]; 11 | /** 12 | * Safely splits comma-separated values (such as those for transition-* and 13 | * background properties). 14 | */ 15 | function comma(str: string): string[]; 16 | } 17 | export default List; 18 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/map-generator.d.ts: -------------------------------------------------------------------------------- 1 | import Root from './root'; 2 | export default class MapGenerator { 3 | private stringify; 4 | private root; 5 | private opts; 6 | private mapOpts; 7 | private previousMaps; 8 | private map; 9 | private css; 10 | constructor(stringify: any, root: Root, opts: any); 11 | isMap(): boolean; 12 | previous(): any; 13 | isInline(): any; 14 | isSourcesContent(): any; 15 | clearAnnotation(): void; 16 | setSourcesContent(): void; 17 | applyPrevMaps(): void; 18 | isAnnotation(): any; 19 | addAnnotation(): void; 20 | outputFile(): any; 21 | generateMap(): any[]; 22 | relative(file: any): any; 23 | sourcePath(node: any): any; 24 | generateString(): void; 25 | generate(): any[]; 26 | } 27 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/parse.d.ts: -------------------------------------------------------------------------------- 1 | import LazyResult from './lazy-result'; 2 | import postcss from './postcss'; 3 | import Result from './result'; 4 | import Root from './root'; 5 | /** 6 | * Parses source CSS. 7 | * @param css The CSS to parse. 8 | * @param options 9 | * @returns {} A new Root node, which contains the source CSS nodes. 10 | */ 11 | declare function parse(css: string | { 12 | toString(): string; 13 | } | LazyResult | Result, options?: { 14 | from?: string; 15 | map?: postcss.SourceMapOptions; 16 | }): Root; 17 | declare module parse { 18 | var parse: postcss.Syntax | postcss.Parse; 19 | } 20 | export default parse; 21 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/parser.d.ts: -------------------------------------------------------------------------------- 1 | import Input from './input'; 2 | import Node from './node'; 3 | import Root from './root'; 4 | export default class Parser { 5 | input: Input; 6 | pos: number; 7 | root: Root; 8 | spaces: string; 9 | semicolon: boolean; 10 | private current; 11 | private tokens; 12 | constructor(input: Input); 13 | tokenize(): void; 14 | loop(): void; 15 | comment(token: any): void; 16 | emptyRule(token: any): void; 17 | word(): void; 18 | rule(tokens: any): void; 19 | decl(tokens: any): void; 20 | atrule(token: any): void; 21 | end(token: any): void; 22 | endFile(): void; 23 | init(node: Node, line?: number, column?: number): void; 24 | raw(node: any, prop: any, tokens: any): void; 25 | spacesFromEnd(tokens: any): string; 26 | spacesFromStart(tokens: any): string; 27 | stringFrom(tokens: any, from: any): string; 28 | colon(tokens: any): number | boolean; 29 | unknownDecl(node: any, token: any): void; 30 | unclosedBracket(bracket: any): void; 31 | unknownWord(start: any): void; 32 | unexpectedClose(token: any): void; 33 | unclosedBlock(): void; 34 | doubleColon(token: any): void; 35 | unnamedAtrule(node: any, token: any): void; 36 | precheckMissedSemicolon(tokens: any): void; 37 | checkMissedSemicolon(tokens: any): void; 38 | } 39 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/previous-map.d.ts: -------------------------------------------------------------------------------- 1 | export default class PreviousMap { 2 | private inline; 3 | annotation: string; 4 | root: string; 5 | private consumerCache; 6 | text: string; 7 | file: string; 8 | constructor(css: any, opts: any); 9 | consumer(): any; 10 | withContent(): boolean; 11 | startWith(string: any, start: any): boolean; 12 | loadAnnotation(css: any): void; 13 | decodeInline(text: any): any; 14 | loadMap(file: any, prev: any): any; 15 | } 16 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/processor.d.ts: -------------------------------------------------------------------------------- 1 | import LazyResult from './lazy-result'; 2 | import postcss from './postcss'; 3 | import Result from './result'; 4 | export default class Processor implements postcss.Processor { 5 | /** 6 | * Contains current version of PostCSS (e.g., "4.0.5"). 7 | */ 8 | version: string; 9 | /** 10 | * Contains plugins added to this processor. 11 | */ 12 | plugins: postcss.Plugin[]; 13 | constructor(plugins?: (typeof postcss.acceptedPlugin)[]); 14 | /** 15 | * Adds a plugin to be used as a CSS processor. Plugins can also be 16 | * added by passing them as arguments when creating a postcss instance. 17 | */ 18 | use(plugin: typeof postcss.acceptedPlugin): Processor; 19 | /** 20 | * Parses source CSS. Because some plugins can be asynchronous it doesn't 21 | * make any transformations. Transformations will be applied in LazyResult's 22 | * methods. 23 | * @param css Input CSS or any object with toString() method, like a file 24 | * stream. If a Result instance is passed the processor will take the 25 | * existing Root parser from it. 26 | */ 27 | process(css: string | { 28 | toString(): string; 29 | } | Result, options?: postcss.ProcessOptions): LazyResult; 30 | private normalize(plugins); 31 | } 32 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/result.d.ts: -------------------------------------------------------------------------------- 1 | import Processor from './processor'; 2 | import postcss from './postcss'; 3 | import Root from './root'; 4 | export default class Result implements postcss.Result { 5 | /** 6 | * The Processor instance used for this transformation. 7 | */ 8 | processor: Processor; 9 | /** 10 | * Contains Root node after all transformations. 11 | */ 12 | root: Root; 13 | /** 14 | * Options from the Processor#process(css, opts) or Root#toResult(opts) call 15 | * that produced this Result instance. 16 | */ 17 | opts: postcss.ResultOptions; 18 | /** 19 | * A CSS string representing this Result's Root instance. 20 | */ 21 | css: string; 22 | /** 23 | * An instance of the SourceMapGenerator class from the source-map library, 24 | * representing changes to the Result's Root instance. 25 | * This property will have a value only if the user does not want an inline 26 | * source map. By default, PostCSS generates inline source maps, written 27 | * directly into the processed CSS. The map property will be empty by default. 28 | * An external source map will be generated — and assigned to map — only if 29 | * the user has set the map.inline option to false, or if PostCSS was passed 30 | * an external input source map. 31 | */ 32 | map: postcss.ResultMap; 33 | /** 34 | * Contains messages from plugins. For example, warnings or custom messages to 35 | * plugins communication. Add a warning using Result#warn() and get all warnings 36 | * using Result#warnings() method. 37 | */ 38 | messages: postcss.ResultMessage[]; 39 | lastPlugin: postcss.Transformer; 40 | /** 41 | * Provides the result of the PostCSS transformations. 42 | */ 43 | constructor( 44 | /** 45 | * The Processor instance used for this transformation. 46 | */ 47 | processor?: Processor, 48 | /** 49 | * Contains Root node after all transformations. 50 | */ 51 | root?: Root, 52 | /** 53 | * Options from the Processor#process(css, opts) or Root#toResult(opts) call 54 | * that produced this Result instance. 55 | */ 56 | opts?: postcss.ResultOptions); 57 | /** 58 | * Alias for css property. 59 | */ 60 | toString(): string; 61 | /** 62 | * Creates a Warning and adds it to messages. 63 | * @param message Used in the text property of the message object. 64 | * @param options Properties for Message object. 65 | */ 66 | warn(message: string, options?: postcss.WarningOptions): void; 67 | /** 68 | * @returns Warnings from plugins, filtered from messages. 69 | */ 70 | warnings(): postcss.ResultMessage[]; 71 | /** 72 | * Alias for css property to use with syntaxes that generate non-CSS output. 73 | */ 74 | content: string; 75 | } 76 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/root.d.ts: -------------------------------------------------------------------------------- 1 | import PreviousMap from './previous-map'; 2 | import Container from './container'; 3 | import postcss from './postcss'; 4 | import Result from './result'; 5 | import Node from './node'; 6 | export default class Root extends Container implements postcss.Root { 7 | prevMap: PreviousMap; 8 | rawCache: { 9 | [key: string]: any; 10 | }; 11 | /** 12 | * Represents a CSS file and contains all its parsed nodes. 13 | */ 14 | constructor(defaults?: postcss.RootNewProps); 15 | /** 16 | * @param overrides New properties to override in the clone. 17 | * @returns A clone of this node. The node and its (cloned) children will 18 | * have a clean parent and code style properties. 19 | */ 20 | clone(overrides?: Object): Root; 21 | toJSON(): postcss.JsonRoot; 22 | /** 23 | * Deprecated. Use Root#removeChild. 24 | */ 25 | remove(child?: Node | number): Root; 26 | /** 27 | * Removes child from the root node, and the parent properties of node and 28 | * its children. 29 | * @param child Child or child's index. 30 | * @returns This root node for chaining. 31 | */ 32 | removeChild(child: Node | number): Root; 33 | protected normalize(node: Node | string, sample: Node, type?: string): Node[]; 34 | protected normalize(props: postcss.AtRuleNewProps | postcss.RuleNewProps | postcss.DeclarationNewProps | postcss.CommentNewProps, sample: Node, type?: string): Node[]; 35 | /** 36 | * @returns A Result instance representing the root's CSS. 37 | */ 38 | toResult(options?: { 39 | /** 40 | * The path where you'll put the output CSS file. You should always 41 | * set "to" to generate correct source maps. 42 | */ 43 | to?: string; 44 | map?: postcss.SourceMapOptions; 45 | }): Result; 46 | } 47 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/rule.d.ts: -------------------------------------------------------------------------------- 1 | import Container from './container'; 2 | import postcss from './postcss'; 3 | export default class Rule extends Container implements postcss.Rule { 4 | /** 5 | * Contains information to generate byte-to-byte equal node string as it 6 | * was in origin input. 7 | */ 8 | raws: postcss.RuleRaws; 9 | /** 10 | * The rule's full selector. If there are multiple comma-separated selectors, 11 | * the entire group will be included. 12 | */ 13 | selector: string; 14 | /** 15 | * Represents a CSS rule: a selector followed by a declaration block. 16 | */ 17 | constructor(defaults?: postcss.RuleNewProps); 18 | /** 19 | * @param overrides New properties to override in the clone. 20 | * @returns A clone of this node. The node and its (cloned) children will 21 | * have a clean parent and code style properties. 22 | */ 23 | clone(overrides?: Object): Rule; 24 | toJSON(): postcss.JsonRule; 25 | /** 26 | * @returns An array containing the rule's individual selectors. 27 | * Groups of selectors are split at commas. 28 | */ 29 | selectors: string[]; 30 | _selector: string; 31 | } 32 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/stringifier.d.ts: -------------------------------------------------------------------------------- 1 | import Node from './node'; 2 | declare class Stringifier { 3 | builder: Stringifier.Builder; 4 | constructor(builder?: Stringifier.Builder); 5 | stringify(node: Node, semicolon?: boolean): void; 6 | root(node: any): void; 7 | comment(node: any): void; 8 | decl(node: any, semicolon: any): void; 9 | rule(node: any): void; 10 | atrule(node: any, semicolon: any): void; 11 | body(node: any): void; 12 | block(node: any, start: any): void; 13 | raw(node: Node, own: string, detect?: string): any; 14 | rawSemicolon(root: any): any; 15 | rawEmptyBody(root: any): any; 16 | rawIndent(root: any): any; 17 | rawBeforeComment(root: any, node: any): any; 18 | rawBeforeDecl(root: any, node: any): any; 19 | rawBeforeRule(root: any): any; 20 | rawBeforeClose(root: any): any; 21 | rawBeforeOpen(root: any): any; 22 | rawColon(root: any): any; 23 | beforeAfter(node: any, detect: any): any; 24 | rawValue(node: any, prop: any): any; 25 | } 26 | declare module Stringifier { 27 | interface Builder { 28 | (str: string, node?: Node, str2?: string): void; 29 | } 30 | } 31 | export default Stringifier; 32 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/stringify.d.ts: -------------------------------------------------------------------------------- 1 | import Stringifier from './stringifier'; 2 | import postcss from './postcss'; 3 | import Node from './node'; 4 | /** 5 | * Default function to convert nodes tree to CSS string. 6 | */ 7 | declare function stringify(node: Node, builder: Stringifier.Builder): void; 8 | declare module stringify { 9 | var stringify: postcss.Syntax | postcss.Stringify; 10 | } 11 | export default stringify; 12 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/tokenize.d.ts: -------------------------------------------------------------------------------- 1 | export default function tokenize(input: any): any[]; 2 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/vendor.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Contains helpers for working with vendor prefixes. 3 | */ 4 | declare module Vendor { 5 | /** 6 | * @returns The vendor prefix extracted from the input string. 7 | */ 8 | function prefix(prop: string): string; 9 | /** 10 | * @returns The input string stripped of its vendor prefix. 11 | */ 12 | function unprefixed(prop: string): string; 13 | } 14 | export default Vendor; 15 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/warn-once.d.ts: -------------------------------------------------------------------------------- 1 | declare var _default: (message: string) => void; 2 | export default _default; 3 | -------------------------------------------------------------------------------- /node_modules/postcss/d.ts/warning.d.ts: -------------------------------------------------------------------------------- 1 | import postcss from './postcss'; 2 | import Node from './node'; 3 | export default class Warning implements postcss.Warning { 4 | /** 5 | * Contains the warning message. 6 | */ 7 | text: string; 8 | type: string; 9 | /** 10 | * Contains name of plugin that created this warning. When you call 11 | * Node#warn(), it will fill this property automatically. 12 | */ 13 | plugin: string; 14 | /** 15 | * The CSS node that caused the warning. 16 | */ 17 | node: Node; 18 | /** 19 | * Line in input file with this warning source. 20 | */ 21 | line: number; 22 | /** 23 | * Column in input file with this warning source. 24 | */ 25 | column: number; 26 | /** 27 | * Warning from plugins. It can be created using Node#warn(). 28 | */ 29 | constructor( 30 | /** 31 | * Contains the warning message. 32 | */ 33 | text: string, options?: postcss.WarningOptions); 34 | /** 35 | * @returns Error position, message. 36 | */ 37 | toString(): string; 38 | } 39 | -------------------------------------------------------------------------------- /node_modules/postcss/lib/comment.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | 5 | var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); 6 | 7 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 8 | 9 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } 10 | 11 | function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 12 | 13 | var _warnOnce = require('./warn-once'); 14 | 15 | var _warnOnce2 = _interopRequireDefault(_warnOnce); 16 | 17 | var _node = require('./node'); 18 | 19 | var _node2 = _interopRequireDefault(_node); 20 | 21 | var Comment = (function (_Node) { 22 | _inherits(Comment, _Node); 23 | 24 | function Comment(defaults) { 25 | _classCallCheck(this, Comment); 26 | 27 | _Node.call(this, defaults); 28 | this.type = 'comment'; 29 | } 30 | 31 | _createClass(Comment, [{ 32 | key: 'left', 33 | get: function get() { 34 | _warnOnce2['default']('Comment#left was deprecated. Use Comment#raws.left'); 35 | return this.raws.left; 36 | }, 37 | set: function set(val) { 38 | _warnOnce2['default']('Comment#left was deprecated. Use Comment#raws.left'); 39 | this.raws.left = val; 40 | } 41 | }, { 42 | key: 'right', 43 | get: function get() { 44 | _warnOnce2['default']('Comment#right was deprecated. Use Comment#raws.right'); 45 | return this.raws.right; 46 | }, 47 | set: function set(val) { 48 | _warnOnce2['default']('Comment#right was deprecated. Use Comment#raws.right'); 49 | this.raws.right = val; 50 | } 51 | }]); 52 | 53 | return Comment; 54 | })(_node2['default']); 55 | 56 | exports['default'] = Comment; 57 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss/lib/declaration.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | 5 | var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); 6 | 7 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 8 | 9 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } 10 | 11 | function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 12 | 13 | var _warnOnce = require('./warn-once'); 14 | 15 | var _warnOnce2 = _interopRequireDefault(_warnOnce); 16 | 17 | var _node = require('./node'); 18 | 19 | var _node2 = _interopRequireDefault(_node); 20 | 21 | var Declaration = (function (_Node) { 22 | _inherits(Declaration, _Node); 23 | 24 | function Declaration(defaults) { 25 | _classCallCheck(this, Declaration); 26 | 27 | _Node.call(this, defaults); 28 | this.type = 'decl'; 29 | } 30 | 31 | _createClass(Declaration, [{ 32 | key: '_value', 33 | get: function get() { 34 | _warnOnce2['default']('Node#_value was deprecated. Use Node#raws.value'); 35 | return this.raws.value; 36 | }, 37 | set: function set(val) { 38 | _warnOnce2['default']('Node#_value was deprecated. Use Node#raws.value'); 39 | this.raws.value = val; 40 | } 41 | }, { 42 | key: '_important', 43 | get: function get() { 44 | _warnOnce2['default']('Node#_important was deprecated. Use Node#raws.important'); 45 | return this.raws.important; 46 | }, 47 | set: function set(val) { 48 | _warnOnce2['default']('Node#_important was deprecated. Use Node#raws.important'); 49 | this.raws.important = val; 50 | } 51 | }]); 52 | 53 | return Declaration; 54 | })(_node2['default']); 55 | 56 | exports['default'] = Declaration; 57 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss/lib/input.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | 5 | var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); 6 | 7 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 8 | 9 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } 10 | 11 | var _cssSyntaxError = require('./css-syntax-error'); 12 | 13 | var _cssSyntaxError2 = _interopRequireDefault(_cssSyntaxError); 14 | 15 | var _previousMap = require('./previous-map'); 16 | 17 | var _previousMap2 = _interopRequireDefault(_previousMap); 18 | 19 | var _path = require('path'); 20 | 21 | var _path2 = _interopRequireDefault(_path); 22 | 23 | var sequence = 0; 24 | 25 | var Input = (function () { 26 | function Input(css) { 27 | var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 28 | 29 | _classCallCheck(this, Input); 30 | 31 | this.css = css.toString(); 32 | 33 | if (this.css[0] === '' || this.css[0] === '￾') { 34 | this.css = this.css.slice(1); 35 | } 36 | 37 | if (opts.from) this.file = _path2['default'].resolve(opts.from); 38 | 39 | var map = new _previousMap2['default'](this.css, opts); 40 | if (map.text) { 41 | this.map = map; 42 | var file = map.consumer().file; 43 | if (!this.file && file) this.file = this.mapResolve(file); 44 | } 45 | 46 | if (!this.file) { 47 | sequence += 1; 48 | this.id = ''; 49 | } 50 | if (this.map) this.map.file = this.from; 51 | } 52 | 53 | Input.prototype.error = function error(message, line, column) { 54 | var opts = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3]; 55 | 56 | var error = undefined; 57 | var origin = this.origin(line, column); 58 | if (origin) { 59 | error = new _cssSyntaxError2['default'](message, origin.line, origin.column, origin.source, origin.file, opts.plugin); 60 | } else { 61 | error = new _cssSyntaxError2['default'](message, line, column, this.css, this.file, opts.plugin); 62 | } 63 | 64 | error.input = { line: line, column: column, source: this.css }; 65 | if (this.file) error.input.file = this.file; 66 | 67 | return error; 68 | }; 69 | 70 | Input.prototype.origin = function origin(line, column) { 71 | if (!this.map) return false; 72 | var consumer = this.map.consumer(); 73 | 74 | var from = consumer.originalPositionFor({ line: line, column: column }); 75 | if (!from.source) return false; 76 | 77 | var result = { 78 | file: this.mapResolve(from.source), 79 | line: from.line, 80 | column: from.column 81 | }; 82 | 83 | var source = consumer.sourceContentFor(result.file); 84 | if (source) result.source = source; 85 | 86 | return result; 87 | }; 88 | 89 | Input.prototype.mapResolve = function mapResolve(file) { 90 | return _path2['default'].resolve(this.map.consumer().sourceRoot || '.', file); 91 | }; 92 | 93 | _createClass(Input, [{ 94 | key: 'from', 95 | get: function get() { 96 | return this.file || this.id; 97 | } 98 | }]); 99 | 100 | return Input; 101 | })(); 102 | 103 | exports['default'] = Input; 104 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss/lib/list.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | var list = { 5 | 6 | split: function split(string, separators, last) { 7 | var array = []; 8 | var current = ''; 9 | var split = false; 10 | 11 | var func = 0; 12 | var quote = false; 13 | var escape = false; 14 | 15 | for (var i = 0; i < string.length; i++) { 16 | var letter = string[i]; 17 | 18 | if (quote) { 19 | if (escape) { 20 | escape = false; 21 | } else if (letter === '\\') { 22 | escape = true; 23 | } else if (letter === quote) { 24 | quote = false; 25 | } 26 | } else if (letter === '"' || letter === '\'') { 27 | quote = letter; 28 | } else if (letter === '(') { 29 | func += 1; 30 | } else if (letter === ')') { 31 | if (func > 0) func -= 1; 32 | } else if (func === 0) { 33 | if (separators.indexOf(letter) !== -1) split = true; 34 | } 35 | 36 | if (split) { 37 | if (current !== '') array.push(current.trim()); 38 | current = ''; 39 | split = false; 40 | } else { 41 | current += letter; 42 | } 43 | } 44 | 45 | if (last || current !== '') array.push(current.trim()); 46 | return array; 47 | }, 48 | 49 | space: function space(string) { 50 | var spaces = [' ', '\n', '\t']; 51 | return list.split(string, spaces); 52 | }, 53 | 54 | comma: function comma(string) { 55 | var comma = ','; 56 | return list.split(string, [comma], true); 57 | } 58 | 59 | }; 60 | 61 | exports['default'] = list; 62 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss/lib/parse.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | exports['default'] = parse; 5 | 6 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 7 | 8 | var _parser = require('./parser'); 9 | 10 | var _parser2 = _interopRequireDefault(_parser); 11 | 12 | var _input = require('./input'); 13 | 14 | var _input2 = _interopRequireDefault(_input); 15 | 16 | function parse(css, opts) { 17 | if (opts && opts.safe) { 18 | throw new Error('Option safe was removed. ' + 'Use parser: require("postcss-safe-parser")'); 19 | } 20 | 21 | var input = new _input2['default'](css, opts); 22 | 23 | var parser = new _parser2['default'](input); 24 | parser.tokenize(); 25 | parser.loop(); 26 | 27 | return parser.root; 28 | } 29 | 30 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss/lib/postcss.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | 5 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 6 | 7 | var _declaration = require('./declaration'); 8 | 9 | var _declaration2 = _interopRequireDefault(_declaration); 10 | 11 | var _processor = require('./processor'); 12 | 13 | var _processor2 = _interopRequireDefault(_processor); 14 | 15 | var _stringify = require('./stringify'); 16 | 17 | var _stringify2 = _interopRequireDefault(_stringify); 18 | 19 | var _comment = require('./comment'); 20 | 21 | var _comment2 = _interopRequireDefault(_comment); 22 | 23 | var _atRule = require('./at-rule'); 24 | 25 | var _atRule2 = _interopRequireDefault(_atRule); 26 | 27 | var _vendor = require('./vendor'); 28 | 29 | var _vendor2 = _interopRequireDefault(_vendor); 30 | 31 | var _parse = require('./parse'); 32 | 33 | var _parse2 = _interopRequireDefault(_parse); 34 | 35 | var _list = require('./list'); 36 | 37 | var _list2 = _interopRequireDefault(_list); 38 | 39 | var _rule = require('./rule'); 40 | 41 | var _rule2 = _interopRequireDefault(_rule); 42 | 43 | var _root = require('./root'); 44 | 45 | var _root2 = _interopRequireDefault(_root); 46 | 47 | var postcss = function postcss() { 48 | for (var _len = arguments.length, plugins = Array(_len), _key = 0; _key < _len; _key++) { 49 | plugins[_key] = arguments[_key]; 50 | } 51 | 52 | if (plugins.length === 1 && Array.isArray(plugins[0])) { 53 | plugins = plugins[0]; 54 | } 55 | return new _processor2['default'](plugins); 56 | }; 57 | 58 | postcss.plugin = function (name, initializer) { 59 | var creator = function creator() { 60 | var transformer = initializer.apply(this, arguments); 61 | transformer.postcssPlugin = name; 62 | transformer.postcssVersion = new _processor2['default']().version; 63 | return transformer; 64 | }; 65 | 66 | creator.postcss = creator(); 67 | creator.process = function (css, opts) { 68 | return postcss([creator(opts)]).process(css, opts); 69 | }; 70 | return creator; 71 | }; 72 | 73 | postcss.stringify = _stringify2['default']; 74 | postcss.vendor = _vendor2['default']; 75 | postcss.parse = _parse2['default']; 76 | postcss.list = _list2['default']; 77 | 78 | postcss.comment = function (defaults) { 79 | return new _comment2['default'](defaults); 80 | }; 81 | postcss.atRule = function (defaults) { 82 | return new _atRule2['default'](defaults); 83 | }; 84 | postcss.decl = function (defaults) { 85 | return new _declaration2['default'](defaults); 86 | }; 87 | postcss.rule = function (defaults) { 88 | return new _rule2['default'](defaults); 89 | }; 90 | postcss.root = function (defaults) { 91 | return new _root2['default'](defaults); 92 | }; 93 | 94 | exports['default'] = postcss; 95 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss/lib/processor.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | 5 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 6 | 7 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } 8 | 9 | var _package = require('../package'); 10 | 11 | var _package2 = _interopRequireDefault(_package); 12 | 13 | var _lazyResult = require('./lazy-result'); 14 | 15 | var _lazyResult2 = _interopRequireDefault(_lazyResult); 16 | 17 | var Processor = (function () { 18 | function Processor() { 19 | var plugins = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; 20 | 21 | _classCallCheck(this, Processor); 22 | 23 | this.version = _package2['default'].version; 24 | 25 | this.plugins = this.normalize(plugins); 26 | } 27 | 28 | Processor.prototype.use = function use(plugin) { 29 | this.plugins = this.plugins.concat(this.normalize([plugin])); 30 | return this; 31 | }; 32 | 33 | Processor.prototype.process = function process(css) { 34 | var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 35 | 36 | return new _lazyResult2['default'](this, css, opts); 37 | }; 38 | 39 | Processor.prototype.normalize = function normalize(plugins) { 40 | var normalized = []; 41 | for (var _iterator = plugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { 42 | var _ref; 43 | 44 | if (_isArray) { 45 | if (_i >= _iterator.length) break; 46 | _ref = _iterator[_i++]; 47 | } else { 48 | _i = _iterator.next(); 49 | if (_i.done) break; 50 | _ref = _i.value; 51 | } 52 | 53 | var i = _ref; 54 | 55 | if (i.postcss) i = i.postcss; 56 | 57 | if (typeof i === 'object' && Array.isArray(i.plugins)) { 58 | normalized = normalized.concat(i.plugins); 59 | } else if (typeof i === 'function') { 60 | normalized.push(i); 61 | } else { 62 | throw new Error(i + ' is not a PostCSS plugin'); 63 | } 64 | } 65 | return normalized; 66 | }; 67 | 68 | return Processor; 69 | })(); 70 | 71 | exports['default'] = Processor; 72 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss/lib/result.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | 5 | var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); 6 | 7 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 8 | 9 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } 10 | 11 | var _warning = require('./warning'); 12 | 13 | var _warning2 = _interopRequireDefault(_warning); 14 | 15 | var Result = (function () { 16 | function Result(processor, root, opts) { 17 | _classCallCheck(this, Result); 18 | 19 | this.processor = processor; 20 | this.messages = []; 21 | this.root = root; 22 | this.opts = opts; 23 | this.css = undefined; 24 | this.map = undefined; 25 | } 26 | 27 | Result.prototype.toString = function toString() { 28 | return this.css; 29 | }; 30 | 31 | Result.prototype.warn = function warn(text) { 32 | var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 33 | 34 | if (!opts.plugin) { 35 | if (this.lastPlugin && this.lastPlugin.postcssPlugin) { 36 | opts.plugin = this.lastPlugin.postcssPlugin; 37 | } 38 | } 39 | 40 | this.messages.push(new _warning2['default'](text, opts)); 41 | }; 42 | 43 | Result.prototype.warnings = function warnings() { 44 | return this.messages.filter(function (i) { 45 | return i.type === 'warning'; 46 | }); 47 | }; 48 | 49 | _createClass(Result, [{ 50 | key: 'content', 51 | get: function get() { 52 | return this.css; 53 | } 54 | }]); 55 | 56 | return Result; 57 | })(); 58 | 59 | exports['default'] = Result; 60 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss/lib/root.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | 5 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 6 | 7 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } 8 | 9 | function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 10 | 11 | var _container = require('./container'); 12 | 13 | var _container2 = _interopRequireDefault(_container); 14 | 15 | var _warnOnce = require('./warn-once'); 16 | 17 | var _warnOnce2 = _interopRequireDefault(_warnOnce); 18 | 19 | var Root = (function (_Container) { 20 | _inherits(Root, _Container); 21 | 22 | function Root(defaults) { 23 | _classCallCheck(this, Root); 24 | 25 | _Container.call(this, defaults); 26 | this.type = 'root'; 27 | if (!this.nodes) this.nodes = []; 28 | } 29 | 30 | Root.prototype.removeChild = function removeChild(child) { 31 | child = this.index(child); 32 | 33 | if (child === 0 && this.nodes.length > 1) { 34 | this.nodes[1].raws.before = this.nodes[child].raws.before; 35 | } 36 | 37 | return _Container.prototype.removeChild.call(this, child); 38 | }; 39 | 40 | Root.prototype.normalize = function normalize(child, sample, type) { 41 | var nodes = _Container.prototype.normalize.call(this, child); 42 | 43 | if (sample) { 44 | if (type === 'prepend') { 45 | if (this.nodes.length > 1) { 46 | sample.raws.before = this.nodes[1].raws.before; 47 | } else { 48 | delete sample.raws.before; 49 | } 50 | } else { 51 | for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { 52 | var _ref; 53 | 54 | if (_isArray) { 55 | if (_i >= _iterator.length) break; 56 | _ref = _iterator[_i++]; 57 | } else { 58 | _i = _iterator.next(); 59 | if (_i.done) break; 60 | _ref = _i.value; 61 | } 62 | 63 | var node = _ref; 64 | 65 | if (this.first !== sample) { 66 | node.raws.before = sample.raws.before; 67 | } 68 | } 69 | } 70 | } 71 | 72 | return nodes; 73 | }; 74 | 75 | Root.prototype.toResult = function toResult() { 76 | var opts = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; 77 | 78 | var LazyResult = require('./lazy-result'); 79 | var Processor = require('./processor'); 80 | 81 | var lazy = new LazyResult(new Processor(), this, opts); 82 | return lazy.stringify(); 83 | }; 84 | 85 | Root.prototype.remove = function remove(child) { 86 | _warnOnce2['default']('Root#remove is deprecated. Use Root#removeChild'); 87 | this.removeChild(child); 88 | }; 89 | 90 | Root.prototype.prevMap = function prevMap() { 91 | _warnOnce2['default']('Root#prevMap is deprecated. Use Root#source.input.map'); 92 | return this.source.input.map; 93 | }; 94 | 95 | return Root; 96 | })(_container2['default']); 97 | 98 | exports['default'] = Root; 99 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss/lib/rule.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | 5 | var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); 6 | 7 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 8 | 9 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } 10 | 11 | function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 12 | 13 | var _container = require('./container'); 14 | 15 | var _container2 = _interopRequireDefault(_container); 16 | 17 | var _warnOnce = require('./warn-once'); 18 | 19 | var _warnOnce2 = _interopRequireDefault(_warnOnce); 20 | 21 | var _list = require('./list'); 22 | 23 | var _list2 = _interopRequireDefault(_list); 24 | 25 | var Rule = (function (_Container) { 26 | _inherits(Rule, _Container); 27 | 28 | function Rule(defaults) { 29 | _classCallCheck(this, Rule); 30 | 31 | _Container.call(this, defaults); 32 | this.type = 'rule'; 33 | if (!this.nodes) this.nodes = []; 34 | } 35 | 36 | _createClass(Rule, [{ 37 | key: 'selectors', 38 | get: function get() { 39 | return _list2['default'].comma(this.selector); 40 | }, 41 | set: function set(values) { 42 | var match = this.selector ? this.selector.match(/,\s*/) : null; 43 | var sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen'); 44 | this.selector = values.join(sep); 45 | } 46 | }, { 47 | key: '_selector', 48 | get: function get() { 49 | _warnOnce2['default']('Rule#_selector is deprecated. Use Rule#raws.selector'); 50 | return this.raws.selector; 51 | }, 52 | set: function set(val) { 53 | _warnOnce2['default']('Rule#_selector is deprecated. Use Rule#raws.selector'); 54 | this.raws.selector = val; 55 | } 56 | }]); 57 | 58 | return Rule; 59 | })(_container2['default']); 60 | 61 | exports['default'] = Rule; 62 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss/lib/stringify.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | exports['default'] = stringify; 5 | 6 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 7 | 8 | var _stringifier = require('./stringifier'); 9 | 10 | var _stringifier2 = _interopRequireDefault(_stringifier); 11 | 12 | function stringify(node, builder) { 13 | var str = new _stringifier2['default'](builder); 14 | str.stringify(node); 15 | } 16 | 17 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss/lib/vendor.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | exports['default'] = { 5 | 6 | prefix: function prefix(prop) { 7 | if (prop[0] === '-') { 8 | var sep = prop.indexOf('-', 1); 9 | return prop.substr(0, sep + 1); 10 | } else { 11 | return ''; 12 | } 13 | }, 14 | 15 | unprefixed: function unprefixed(prop) { 16 | if (prop[0] === '-') { 17 | var sep = prop.indexOf('-', 1); 18 | return prop.substr(sep + 1); 19 | } else { 20 | return prop; 21 | } 22 | } 23 | 24 | }; 25 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss/lib/warn-once.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | exports['default'] = warnOnce; 5 | var printed = {}; 6 | 7 | function warnOnce(message) { 8 | if (printed[message]) return; 9 | printed[message] = true; 10 | 11 | if (typeof console !== 'undefined' && console.warn) console.warn(message); 12 | } 13 | 14 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss/lib/warning.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | 5 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } 6 | 7 | var Warning = (function () { 8 | function Warning(text) { 9 | var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 10 | 11 | _classCallCheck(this, Warning); 12 | 13 | this.type = 'warning'; 14 | 15 | this.text = text; 16 | 17 | if (opts.node) { 18 | var pos = opts.node.positionBy(opts); 19 | this.line = pos.line; 20 | this.column = pos.column; 21 | } 22 | 23 | for (var opt in opts) { 24 | this[opt] = opts[opt]; 25 | } 26 | } 27 | 28 | Warning.prototype.toString = function toString() { 29 | if (this.node) { 30 | return this.node.error(this.text, { plugin: this.plugin }).message; 31 | } else if (this.plugin) { 32 | return this.plugin + ': ' + this.text; 33 | } else { 34 | return this.text; 35 | } 36 | }; 37 | 38 | return Warning; 39 | })(); 40 | 41 | exports['default'] = Warning; 42 | module.exports = exports['default']; -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/js-base64/.npmignore: -------------------------------------------------------------------------------- 1 | *,v 2 | attic/**/* 3 | node_modules/**/* 4 | tmp/**/* 5 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/js-base64/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | - "0.8" 5 | 6 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/js-base64/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Dan Kogai 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of {{{project}}} nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/js-base64/README.md: -------------------------------------------------------------------------------- 1 | [![build status](https://secure.travis-ci.org/dankogai/js-base64.png)](http://travis-ci.org/dankogai/js-base64) 2 | 3 | # base64.js 4 | 5 | Yet another Base64 transcoder 6 | 7 | ## Usage 8 | 9 | ### In Browser 10 | ````html 11 | 12 | ```` 13 | ### node.js 14 | ````javascript 15 | var Base64 = require('./base64.js').Base64; 16 | ```` 17 | 18 | 19 | ## SYNOPSIS 20 | 21 | ````javascript 22 | Base64.encode('dankogai'); // ZGFua29nYWk= 23 | Base64.encode('小飼弾'); // 5bCP6aO85by+ 24 | Base64.encodeURI('小飼弾'); // 5bCP6aO85by- 25 | 26 | Base64.decode('ZGFua29nYWk='); // dankogai 27 | Base64.decode('5bCP6aO85by+'); // 小飼弾 28 | // note .decodeURI() is unnecessary since it accepts both flavors 29 | Base64.decode('5bCP6aO85by-'); // 小飼弾 30 | ```` 31 | 32 | ### String Extension for ES5 33 | 34 | ````javascript 35 | if (Base64.extendString) { 36 | // you have to explicitly extend String.prototype 37 | Base64.extendString(); 38 | // once extended, you can do the following 39 | 'dankogai'.toBase64(); // ZGFua29nYWk= 40 | '小飼弾'.toBase64(); // 5bCP6aO85by+ 41 | '小飼弾'.toBase64(true); // 5bCP6aO85by- 42 | '小飼弾'.toBase64URI(); // 5bCP6aO85by- 43 | 'ZGFua29nYWk='.fromBase64(); // dankogai 44 | '5bCP6aO85by+'.fromBase64(); // 小飼弾 45 | '5bCP6aO85by-'.fromBase64(); // 小飼弾 46 | } 47 | ```` 48 | 49 | ## SEE ALSO 50 | 51 | + http://en.wikipedia.org/wiki/Base64 52 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/js-base64/base64.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Test for base64.js 7 | 8 | 9 |

Test for base64.js

10 |

$Id: base64.html,v 1.1 2009/03/01 22:00:28 dankogai Exp dankogai $

11 | 12 | 14 | 15 | 17 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
TextBase64 13 | (URL Safe )
Roundtripiframe w/ data: (no IE)
29 | 30 | 31 | 32 | 46 | 47 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/js-base64/base64.min.js: -------------------------------------------------------------------------------- 1 | (function(global){"use strict";var _Base64=global.Base64;var version="2.1.9";var buffer;if(typeof module!=="undefined"&&module.exports){try{buffer=require("buffer").Buffer}catch(err){}}var b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var b64tab=function(bin){var t={};for(var i=0,l=bin.length;i>>6)+fromCharCode(128|cc&63):fromCharCode(224|cc>>>12&15)+fromCharCode(128|cc>>>6&63)+fromCharCode(128|cc&63)}else{var cc=65536+(c.charCodeAt(0)-55296)*1024+(c.charCodeAt(1)-56320);return fromCharCode(240|cc>>>18&7)+fromCharCode(128|cc>>>12&63)+fromCharCode(128|cc>>>6&63)+fromCharCode(128|cc&63)}};var re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;var utob=function(u){return u.replace(re_utob,cb_utob)};var cb_encode=function(ccc){var padlen=[0,2,1][ccc.length%3],ord=ccc.charCodeAt(0)<<16|(ccc.length>1?ccc.charCodeAt(1):0)<<8|(ccc.length>2?ccc.charCodeAt(2):0),chars=[b64chars.charAt(ord>>>18),b64chars.charAt(ord>>>12&63),padlen>=2?"=":b64chars.charAt(ord>>>6&63),padlen>=1?"=":b64chars.charAt(ord&63)];return chars.join("")};var btoa=global.btoa?function(b){return global.btoa(b)}:function(b){return b.replace(/[\s\S]{1,3}/g,cb_encode)};var _encode=buffer?function(u){return(u.constructor===buffer.constructor?u:new buffer(u)).toString("base64")}:function(u){return btoa(utob(u))};var encode=function(u,urisafe){return!urisafe?_encode(String(u)):_encode(String(u)).replace(/[+\/]/g,function(m0){return m0=="+"?"-":"_"}).replace(/=/g,"")};var encodeURI=function(u){return encode(u,true)};var re_btou=new RegExp(["[À-ß][€-¿]","[à-ï][€-¿]{2}","[ð-÷][€-¿]{3}"].join("|"),"g");var cb_btou=function(cccc){switch(cccc.length){case 4:var cp=(7&cccc.charCodeAt(0))<<18|(63&cccc.charCodeAt(1))<<12|(63&cccc.charCodeAt(2))<<6|63&cccc.charCodeAt(3),offset=cp-65536;return fromCharCode((offset>>>10)+55296)+fromCharCode((offset&1023)+56320);case 3:return fromCharCode((15&cccc.charCodeAt(0))<<12|(63&cccc.charCodeAt(1))<<6|63&cccc.charCodeAt(2));default:return fromCharCode((31&cccc.charCodeAt(0))<<6|63&cccc.charCodeAt(1))}};var btou=function(b){return b.replace(re_btou,cb_btou)};var cb_decode=function(cccc){var len=cccc.length,padlen=len%4,n=(len>0?b64tab[cccc.charAt(0)]<<18:0)|(len>1?b64tab[cccc.charAt(1)]<<12:0)|(len>2?b64tab[cccc.charAt(2)]<<6:0)|(len>3?b64tab[cccc.charAt(3)]:0),chars=[fromCharCode(n>>>16),fromCharCode(n>>>8&255),fromCharCode(n&255)];chars.length-=[0,0,2,1][padlen];return chars.join("")};var atob=global.atob?function(a){return global.atob(a)}:function(a){return a.replace(/[\s\S]{1,4}/g,cb_decode)};var _decode=buffer?function(a){return(a.constructor===buffer.constructor?a:new buffer(a,"base64")).toString()}:function(a){return btou(atob(a))};var decode=function(a){return _decode(String(a).replace(/[-_]/g,function(m0){return m0=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))};var noConflict=function(){var Base64=global.Base64;global.Base64=_Base64;return Base64};global.Base64={VERSION:version,atob:atob,btoa:btoa,fromBase64:decode,toBase64:encode,utob:utob,encode:encode,encodeURI:encodeURI,btou:btou,decode:decode,noConflict:noConflict};if(typeof Object.defineProperty==="function"){var noEnum=function(v){return{value:v,enumerable:false,writable:true,configurable:true}};global.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",noEnum(function(){return decode(this)}));Object.defineProperty(String.prototype,"toBase64",noEnum(function(urisafe){return encode(this,urisafe)}));Object.defineProperty(String.prototype,"toBase64URI",noEnum(function(){return encode(this,true)}))}}if(global["Meteor"]){Base64=global.Base64}})(this); -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/js-base64/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "js-base64", 3 | "version": "2.1.9", 4 | "main": [ 5 | "./base64.js" 6 | ], 7 | "ignore": [ 8 | "old", 9 | "test", 10 | ".gitignore", 11 | ".travis.yml", 12 | "base64.html", 13 | "package.json" 14 | ], 15 | "dependencies": { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/js-base64/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | summary: "Yet another Base64 transcoder" 3 | }) 4 | 5 | Package.on_use(function(api){ 6 | api.export('Base64'); 7 | 8 | api.add_files(['base64.js'], 'server'); 9 | }); -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/js-base64/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "js-base64", 3 | "version": "2.1.9", 4 | "description": "Yet another Base64 transcoder in pure-JS", 5 | "main": "base64.js", 6 | "directories": { 7 | "test": "test" 8 | }, 9 | "scripts": { 10 | "test": "mocha" 11 | }, 12 | "devDependencies": { 13 | "mocha": "*" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "git://github.com/dankogai/js-base64.git" 18 | }, 19 | "keywords": [ 20 | "base64" 21 | ], 22 | "author": { 23 | "name": "Dan Kogai" 24 | }, 25 | "license": "BSD", 26 | "gitHead": "8bfa436f733bec60c95c720e1d720c28b43ae0b2", 27 | "bugs": { 28 | "url": "https://github.com/dankogai/js-base64/issues" 29 | }, 30 | "homepage": "https://github.com/dankogai/js-base64#readme", 31 | "_id": "js-base64@2.1.9", 32 | "_shasum": "f0e80ae039a4bd654b5f281fc93f04a914a7fcce", 33 | "_from": "js-base64@>=2.1.9 <3.0.0", 34 | "_npmVersion": "2.13.0", 35 | "_nodeVersion": "0.12.7", 36 | "_npmUser": { 37 | "name": "dankogai", 38 | "email": "dankogai+github@gmail.com" 39 | }, 40 | "maintainers": [ 41 | { 42 | "name": "dankogai", 43 | "email": "dankogai+github@gmail.com" 44 | } 45 | ], 46 | "dist": { 47 | "shasum": "f0e80ae039a4bd654b5f281fc93f04a914a7fcce", 48 | "tarball": "http://registry.npmjs.org/js-base64/-/js-base64-2.1.9.tgz" 49 | }, 50 | "_resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.1.9.tgz", 51 | "readme": "ERROR: No README data found!" 52 | } 53 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/js-base64/test/dankogai.js: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: dankogai.js,v 0.4 2012/08/24 05:23:18 dankogai Exp dankogai $ 3 | * 4 | * use mocha to test me 5 | * http://visionmedia.github.com/mocha/ 6 | */ 7 | var assert, Base64; 8 | if (this['window'] !== this) { 9 | assert = require("assert"); 10 | Base64 = require('../base64.js').Base64; 11 | } 12 | var is = function (a, e, m) { 13 | return function () { 14 | assert.equal(a, e, m) 15 | } 16 | }; 17 | 18 | describe('basic', function () { 19 | it('d', is(Base64.encode('d'), 'ZA==')); 20 | it('da', is(Base64.encode('da'), 'ZGE=')); 21 | it('dan', is(Base64.encode('dan'), 'ZGFu')); 22 | it('ZA==', is(Base64.decode('ZA=='), 'd' )); 23 | it('ZGE=', is(Base64.decode('ZGE='), 'da' )); 24 | it('ZGFu', is(Base64.decode('ZGFu'), 'dan' )); 25 | }); 26 | 27 | describe('whitespace', function () { 28 | it('Z A==', is(Base64.decode('ZA =='), 'd' )); 29 | it('ZG E=', is(Base64.decode('ZG E='), 'da' )); 30 | it('ZGF u', is(Base64.decode('ZGF u'), 'dan' )); 31 | }); 32 | 33 | describe('null', function () { 34 | it('\\0', is(Base64.encode('\0'), 'AA==')); 35 | it('\\0\\0', is(Base64.encode('\0\0'), 'AAA=')); 36 | it('\\0\\0\\0', is(Base64.encode('\0\0\0'), 'AAAA')); 37 | it('AA==', is(Base64.decode('AA=='), '\0' )); 38 | it('AAA=', is(Base64.decode('AAA='), '\0\0' )); 39 | it('AAAA', is(Base64.decode('AAAA'), '\0\0\0')); 40 | }); 41 | 42 | describe('Base64', function () { 43 | it('.encode', is(Base64.encode('小飼弾'), '5bCP6aO85by+')); 44 | it('.encodeURI', is(Base64.encodeURI('小飼弾'), '5bCP6aO85by-')); 45 | it('.decode', is(Base64.decode('5bCP6aO85by+'), '小飼弾')); 46 | it('.decode', is(Base64.decode('5bCP6aO85by-'), '小飼弾')); 47 | }); 48 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/js-base64/test/es5.js: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: es5.js,v 0.1 2012/08/23 19:43:17 dankogai Exp dankogai $ 3 | * 4 | * use mocha to test me 5 | * http://visionmedia.github.com/mocha/ 6 | */ 7 | var assert, Base64; 8 | if (this['window'] !== this) { 9 | assert = require("assert"); 10 | Base64 = require('../base64.js').Base64; 11 | } 12 | var is = function (a, e, m) { 13 | return function () { 14 | assert.equal(a, e, m) 15 | } 16 | }; 17 | 18 | if ('extendString' in Base64){ 19 | Base64.extendString(); 20 | describe('String', function () { 21 | it('.toBase64', is('小飼弾'.toBase64(), '5bCP6aO85by+')); 22 | it('.toBase64', is('小飼弾'.toBase64(true), '5bCP6aO85by-')); 23 | it('.toBase64URI', is('小飼弾'.toBase64URI(), '5bCP6aO85by-')); 24 | it('.fromBase64', is('5bCP6aO85by+'.fromBase64(), '小飼弾')); 25 | it('.fromBase64', is('5bCP6aO85by-'.fromBase64(), '小飼弾')); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/js-base64/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 19 | 20 | 21 | 22 | 23 | 28 | 29 | 30 | $Id: browser.html,v 0.2 2012/08/23 19:44:32 dankogai Exp dankogai $ 31 |
32 | 33 | 34 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/js-base64/test/large.js: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: large.js,v 0.3 2012/08/23 19:14:37 dankogai Exp dankogai $ 3 | * 4 | * use mocha to test me 5 | * http://visionmedia.github.com/mocha/ 6 | */ 7 | var assert, Base64; 8 | if (this['window'] !== this) { 9 | assert = require("assert"); 10 | Base64 = require('../base64.js').Base64; 11 | } 12 | var is = function (a, e, m) { 13 | return function () { 14 | assert.equal(a, e, m) 15 | } 16 | }; 17 | var seed = function () { 18 | var a, i; 19 | for (a = [], i = 0; i < 256; i++) { 20 | a.push(String.fromCharCode(i)); 21 | } 22 | return a.join(''); 23 | }(); 24 | describe('Base64', function () { 25 | for (var i = 0, str = seed; i < 16; str += str, i++) { 26 | it(str.length, is(Base64.decode(Base64.encode(str)), str)); 27 | } 28 | }); 29 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/js-base64/test/yoshinoya.js: -------------------------------------------------------------------------------- 1 | /* 2 | * use mocha to test me 3 | * http://visionmedia.github.com/mocha/ 4 | */ 5 | var assert, Base64; 6 | if (this['window'] !== this) { 7 | assert = require("assert"); 8 | Base64 = require('../base64.js').Base64; 9 | } 10 | var is = function (a, e, m) { 11 | return function () { 12 | assert.equal(a, e, m) 13 | } 14 | }; 15 | 16 | describe('Yoshinoya', function () { 17 | it('.encode', is(Base64.encode('𠮷野家'), '8KCut+mHjuWutg==')); 18 | it('.encodeURI', is(Base64.encodeURI('𠮷野家'), '8KCut-mHjuWutg')); 19 | it('.decode', is(Base64.decode('8KCut+mHjuWutg=='), '𠮷野家')); 20 | it('.decode', is(Base64.decode('8KCut-mHjuWutg'), '𠮷野家')); 21 | it('.decode', is(Base64.decode('7aGC7b636YeO5a62'), '𠮷野家')); 22 | }); 23 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/source-map/build/assert-shim.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | define('test/source-map/assert', ['exports'], function (exports) { 8 | 9 | let do_throw = function (msg) { 10 | throw new Error(msg); 11 | }; 12 | 13 | exports.init = function (throw_fn) { 14 | do_throw = throw_fn; 15 | }; 16 | 17 | exports.doesNotThrow = function (fn) { 18 | try { 19 | fn(); 20 | } 21 | catch (e) { 22 | do_throw(e.message); 23 | } 24 | }; 25 | 26 | exports.equal = function (actual, expected, msg) { 27 | msg = msg || String(actual) + ' != ' + String(expected); 28 | if (actual != expected) { 29 | do_throw(msg); 30 | } 31 | }; 32 | 33 | exports.ok = function (val, msg) { 34 | msg = msg || String(val) + ' is falsey'; 35 | if (!Boolean(val)) { 36 | do_throw(msg); 37 | } 38 | }; 39 | 40 | exports.strictEqual = function (actual, expected, msg) { 41 | msg = msg || String(actual) + ' !== ' + String(expected); 42 | if (actual !== expected) { 43 | do_throw(msg); 44 | } 45 | }; 46 | 47 | exports.throws = function (fn) { 48 | try { 49 | fn(); 50 | do_throw('Expected an error to be thrown, but it wasn\'t.'); 51 | } 52 | catch (e) { 53 | } 54 | }; 55 | 56 | }); 57 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/source-map/build/prefix-source-map.jsm: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | 8 | /* 9 | * WARNING! 10 | * 11 | * Do not edit this file directly, it is built from the sources at 12 | * https://github.com/mozilla/source-map/ 13 | */ 14 | 15 | /////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | this.EXPORTED_SYMBOLS = [ "SourceMapConsumer", "SourceMapGenerator", "SourceNode" ]; 19 | 20 | Components.utils.import("resource://gre/modules/devtools/Console.jsm"); 21 | Components.utils.import('resource://gre/modules/devtools/Require.jsm'); 22 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/source-map/build/prefix-utils.jsm: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | 8 | /* 9 | * WARNING! 10 | * 11 | * Do not edit this file directly, it is built from the sources at 12 | * https://github.com/mozilla/source-map/ 13 | */ 14 | 15 | Components.utils.import('resource://gre/modules/devtools/Require.jsm'); 16 | Components.utils.import('resource://gre/modules/devtools/SourceMap.jsm'); 17 | 18 | this.EXPORTED_SYMBOLS = [ "define", "runSourceMapTests" ]; 19 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/source-map/build/suffix-browser.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /////////////////////////////////////////////////////////////////////////////// 3 | 4 | this.sourceMap = { 5 | SourceMapConsumer: require('source-map/source-map-consumer').SourceMapConsumer, 6 | SourceMapGenerator: require('source-map/source-map-generator').SourceMapGenerator, 7 | SourceNode: require('source-map/source-node').SourceNode 8 | }; 9 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/source-map/build/suffix-source-map.jsm: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /////////////////////////////////////////////////////////////////////////////// 3 | 4 | this.SourceMapConsumer = require('source-map/source-map-consumer').SourceMapConsumer; 5 | this.SourceMapGenerator = require('source-map/source-map-generator').SourceMapGenerator; 6 | this.SourceNode = require('source-map/source-node').SourceNode; 7 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/source-map/build/suffix-utils.jsm: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | function runSourceMapTests(modName, do_throw) { 8 | let mod = require(modName); 9 | let assert = require('test/source-map/assert'); 10 | let util = require('test/source-map/util'); 11 | 12 | assert.init(do_throw); 13 | 14 | for (let k in mod) { 15 | if (/^test/.test(k)) { 16 | mod[k](assert, util); 17 | } 18 | } 19 | 20 | } 21 | this.runSourceMapTests = runSourceMapTests; 22 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/source-map/build/test-prefix.js: -------------------------------------------------------------------------------- 1 | /* 2 | * WARNING! 3 | * 4 | * Do not edit this file directly, it is built from the sources at 5 | * https://github.com/mozilla/source-map/ 6 | */ 7 | 8 | Components.utils.import('resource://test/Utils.jsm'); 9 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/source-map/build/test-suffix.js: -------------------------------------------------------------------------------- 1 | function run_test() { 2 | runSourceMapTests('{THIS_MODULE}', do_throw); 3 | } 4 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/source-map/lib/source-map.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009-2011 Mozilla Foundation and contributors 3 | * Licensed under the New BSD license. See LICENSE.txt or: 4 | * http://opensource.org/licenses/BSD-3-Clause 5 | */ 6 | exports.SourceMapGenerator = require('./source-map/source-map-generator').SourceMapGenerator; 7 | exports.SourceMapConsumer = require('./source-map/source-map-consumer').SourceMapConsumer; 8 | exports.SourceNode = require('./source-map/source-node').SourceNode; 9 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/source-map/lib/source-map/array-set.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var util = require('./util'); 13 | 14 | /** 15 | * A data structure which is a combination of an array and a set. Adding a new 16 | * member is O(1), testing for membership is O(1), and finding the index of an 17 | * element is O(1). Removing elements from the set is not supported. Only 18 | * strings are supported for membership. 19 | */ 20 | function ArraySet() { 21 | this._array = []; 22 | this._set = {}; 23 | } 24 | 25 | /** 26 | * Static method for creating ArraySet instances from an existing array. 27 | */ 28 | ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { 29 | var set = new ArraySet(); 30 | for (var i = 0, len = aArray.length; i < len; i++) { 31 | set.add(aArray[i], aAllowDuplicates); 32 | } 33 | return set; 34 | }; 35 | 36 | /** 37 | * Return how many unique items are in this ArraySet. If duplicates have been 38 | * added, than those do not count towards the size. 39 | * 40 | * @returns Number 41 | */ 42 | ArraySet.prototype.size = function ArraySet_size() { 43 | return Object.getOwnPropertyNames(this._set).length; 44 | }; 45 | 46 | /** 47 | * Add the given string to this set. 48 | * 49 | * @param String aStr 50 | */ 51 | ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { 52 | var isDuplicate = this.has(aStr); 53 | var idx = this._array.length; 54 | if (!isDuplicate || aAllowDuplicates) { 55 | this._array.push(aStr); 56 | } 57 | if (!isDuplicate) { 58 | this._set[util.toSetString(aStr)] = idx; 59 | } 60 | }; 61 | 62 | /** 63 | * Is the given string a member of this set? 64 | * 65 | * @param String aStr 66 | */ 67 | ArraySet.prototype.has = function ArraySet_has(aStr) { 68 | return Object.prototype.hasOwnProperty.call(this._set, 69 | util.toSetString(aStr)); 70 | }; 71 | 72 | /** 73 | * What is the index of the given string in the array? 74 | * 75 | * @param String aStr 76 | */ 77 | ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { 78 | if (this.has(aStr)) { 79 | return this._set[util.toSetString(aStr)]; 80 | } 81 | throw new Error('"' + aStr + '" is not in the set.'); 82 | }; 83 | 84 | /** 85 | * What is the element at the given index? 86 | * 87 | * @param Number aIdx 88 | */ 89 | ArraySet.prototype.at = function ArraySet_at(aIdx) { 90 | if (aIdx >= 0 && aIdx < this._array.length) { 91 | return this._array[aIdx]; 92 | } 93 | throw new Error('No element indexed by ' + aIdx); 94 | }; 95 | 96 | /** 97 | * Returns the array representation of this set (which has the proper indices 98 | * indicated by indexOf). Note that this is a copy of the internal array used 99 | * for storing the members so that no one can mess with internal state. 100 | */ 101 | ArraySet.prototype.toArray = function ArraySet_toArray() { 102 | return this._array.slice(); 103 | }; 104 | 105 | exports.ArraySet = ArraySet; 106 | 107 | }); 108 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/source-map/lib/source-map/base64.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); 13 | 14 | /** 15 | * Encode an integer in the range of 0 to 63 to a single base 64 digit. 16 | */ 17 | exports.encode = function (number) { 18 | if (0 <= number && number < intToCharMap.length) { 19 | return intToCharMap[number]; 20 | } 21 | throw new TypeError("Must be between 0 and 63: " + aNumber); 22 | }; 23 | 24 | /** 25 | * Decode a single base 64 character code digit to an integer. Returns -1 on 26 | * failure. 27 | */ 28 | exports.decode = function (charCode) { 29 | var bigA = 65; // 'A' 30 | var bigZ = 90; // 'Z' 31 | 32 | var littleA = 97; // 'a' 33 | var littleZ = 122; // 'z' 34 | 35 | var zero = 48; // '0' 36 | var nine = 57; // '9' 37 | 38 | var plus = 43; // '+' 39 | var slash = 47; // '/' 40 | 41 | var littleOffset = 26; 42 | var numberOffset = 52; 43 | 44 | // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ 45 | if (bigA <= charCode && charCode <= bigZ) { 46 | return (charCode - bigA); 47 | } 48 | 49 | // 26 - 51: abcdefghijklmnopqrstuvwxyz 50 | if (littleA <= charCode && charCode <= littleZ) { 51 | return (charCode - littleA + littleOffset); 52 | } 53 | 54 | // 52 - 61: 0123456789 55 | if (zero <= charCode && charCode <= nine) { 56 | return (charCode - zero + numberOffset); 57 | } 58 | 59 | // 62: + 60 | if (charCode == plus) { 61 | return 62; 62 | } 63 | 64 | // 63: / 65 | if (charCode == slash) { 66 | return 63; 67 | } 68 | 69 | // Invalid base64 digit. 70 | return -1; 71 | }; 72 | 73 | }); 74 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/source-map/lib/source-map/mapping-list.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2014 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var util = require('./util'); 13 | 14 | /** 15 | * Determine whether mappingB is after mappingA with respect to generated 16 | * position. 17 | */ 18 | function generatedPositionAfter(mappingA, mappingB) { 19 | // Optimized for most common case 20 | var lineA = mappingA.generatedLine; 21 | var lineB = mappingB.generatedLine; 22 | var columnA = mappingA.generatedColumn; 23 | var columnB = mappingB.generatedColumn; 24 | return lineB > lineA || lineB == lineA && columnB >= columnA || 25 | util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; 26 | } 27 | 28 | /** 29 | * A data structure to provide a sorted view of accumulated mappings in a 30 | * performance conscious manner. It trades a neglibable overhead in general 31 | * case for a large speedup in case of mappings being added in order. 32 | */ 33 | function MappingList() { 34 | this._array = []; 35 | this._sorted = true; 36 | // Serves as infimum 37 | this._last = {generatedLine: -1, generatedColumn: 0}; 38 | } 39 | 40 | /** 41 | * Iterate through internal items. This method takes the same arguments that 42 | * `Array.prototype.forEach` takes. 43 | * 44 | * NOTE: The order of the mappings is NOT guaranteed. 45 | */ 46 | MappingList.prototype.unsortedForEach = 47 | function MappingList_forEach(aCallback, aThisArg) { 48 | this._array.forEach(aCallback, aThisArg); 49 | }; 50 | 51 | /** 52 | * Add the given source mapping. 53 | * 54 | * @param Object aMapping 55 | */ 56 | MappingList.prototype.add = function MappingList_add(aMapping) { 57 | var mapping; 58 | if (generatedPositionAfter(this._last, aMapping)) { 59 | this._last = aMapping; 60 | this._array.push(aMapping); 61 | } else { 62 | this._sorted = false; 63 | this._array.push(aMapping); 64 | } 65 | }; 66 | 67 | /** 68 | * Returns the flat, sorted array of mappings. The mappings are sorted by 69 | * generated position. 70 | * 71 | * WARNING: This method returns internal data without copying, for 72 | * performance. The return value must NOT be mutated, and should be treated as 73 | * an immutable borrow. If you want to take ownership, you must make your own 74 | * copy. 75 | */ 76 | MappingList.prototype.toArray = function MappingList_toArray() { 77 | if (!this._sorted) { 78 | this._array.sort(util.compareByGeneratedPositionsInflated); 79 | this._sorted = true; 80 | } 81 | return this._array; 82 | }; 83 | 84 | exports.MappingList = MappingList; 85 | 86 | }); 87 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/source-map/node_modules/amdefine/LICENSE: -------------------------------------------------------------------------------- 1 | amdefine is released under two licenses: new BSD, and MIT. You may pick the 2 | license that best suits your development needs. The text of both licenses are 3 | provided below. 4 | 5 | 6 | The "New" BSD License: 7 | ---------------------- 8 | 9 | Copyright (c) 2011-2015, The Dojo Foundation 10 | All rights reserved. 11 | 12 | Redistribution and use in source and binary forms, with or without 13 | modification, are permitted provided that the following conditions are met: 14 | 15 | * Redistributions of source code must retain the above copyright notice, this 16 | list of conditions and the following disclaimer. 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | * Neither the name of the Dojo Foundation nor the names of its contributors 21 | may be used to endorse or promote products derived from this software 22 | without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 25 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 28 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 30 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 32 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | 36 | 37 | MIT License 38 | ----------- 39 | 40 | Copyright (c) 2011-2015, The Dojo Foundation 41 | 42 | Permission is hereby granted, free of charge, to any person obtaining a copy 43 | of this software and associated documentation files (the "Software"), to deal 44 | in the Software without restriction, including without limitation the rights 45 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 46 | copies of the Software, and to permit persons to whom the Software is 47 | furnished to do so, subject to the following conditions: 48 | 49 | The above copyright notice and this permission notice shall be included in 50 | all copies or substantial portions of the Software. 51 | 52 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 53 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 54 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 55 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 56 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 57 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 58 | THE SOFTWARE. 59 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/source-map/node_modules/amdefine/intercept.js: -------------------------------------------------------------------------------- 1 | /*jshint node: true */ 2 | var inserted, 3 | Module = require('module'), 4 | fs = require('fs'), 5 | existingExtFn = Module._extensions['.js'], 6 | amdefineRegExp = /amdefine\.js/; 7 | 8 | inserted = "if (typeof define !== 'function') {var define = require('amdefine')(module)}"; 9 | 10 | //From the node/lib/module.js source: 11 | function stripBOM(content) { 12 | // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) 13 | // because the buffer-to-string conversion in `fs.readFileSync()` 14 | // translates it to FEFF, the UTF-16 BOM. 15 | if (content.charCodeAt(0) === 0xFEFF) { 16 | content = content.slice(1); 17 | } 18 | return content; 19 | } 20 | 21 | //Also adapted from the node/lib/module.js source: 22 | function intercept(module, filename) { 23 | var content = stripBOM(fs.readFileSync(filename, 'utf8')); 24 | 25 | if (!amdefineRegExp.test(module.id)) { 26 | content = inserted + content; 27 | } 28 | 29 | module._compile(content, filename); 30 | } 31 | 32 | intercept._id = 'amdefine/intercept'; 33 | 34 | if (!existingExtFn._id || existingExtFn._id !== intercept._id) { 35 | Module._extensions['.js'] = intercept; 36 | } 37 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/source-map/node_modules/amdefine/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "amdefine", 3 | "description": "Provide AMD's define() API for declaring modules in the AMD format", 4 | "version": "1.0.0", 5 | "homepage": "http://github.com/jrburke/amdefine", 6 | "author": { 7 | "name": "James Burke", 8 | "email": "jrburke@gmail.com", 9 | "url": "http://github.com/jrburke" 10 | }, 11 | "license": "BSD-3-Clause AND MIT", 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/jrburke/amdefine.git" 15 | }, 16 | "main": "./amdefine.js", 17 | "engines": { 18 | "node": ">=0.4.2" 19 | }, 20 | "gitHead": "578bc4a3f7dede33f3f3e10edde0c1607005d761", 21 | "bugs": { 22 | "url": "https://github.com/jrburke/amdefine/issues" 23 | }, 24 | "_id": "amdefine@1.0.0", 25 | "scripts": {}, 26 | "_shasum": "fd17474700cb5cc9c2b709f0be9d23ce3c198c33", 27 | "_from": "amdefine@>=0.0.4", 28 | "_npmVersion": "2.12.1", 29 | "_nodeVersion": "0.10.36", 30 | "_npmUser": { 31 | "name": "jrburke", 32 | "email": "jrburke@gmail.com" 33 | }, 34 | "maintainers": [ 35 | { 36 | "name": "jrburke", 37 | "email": "jrburke@gmail.com" 38 | } 39 | ], 40 | "dist": { 41 | "shasum": "fd17474700cb5cc9c2b709f0be9d23ce3c198c33", 42 | "tarball": "http://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz" 43 | }, 44 | "directories": {}, 45 | "_resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz", 46 | "readme": "ERROR: No README data found!" 47 | } 48 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/supports-color/browser.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = false; 3 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/supports-color/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var hasFlag = require('has-flag'); 3 | 4 | var support = function (level) { 5 | if (level === 0) { 6 | return false; 7 | } 8 | 9 | return { 10 | level: level, 11 | hasBasic: true, 12 | has256: level >= 2, 13 | has16m: level >= 3 14 | }; 15 | }; 16 | 17 | var supportLevel = (function () { 18 | if (hasFlag('no-color') || 19 | hasFlag('no-colors') || 20 | hasFlag('color=false')) { 21 | return 0; 22 | } 23 | 24 | if (hasFlag('color=16m') || 25 | hasFlag('color=full') || 26 | hasFlag('color=truecolor')) { 27 | return 3; 28 | } 29 | 30 | if (hasFlag('color=256')) { 31 | return 2; 32 | } 33 | 34 | if (hasFlag('color') || 35 | hasFlag('colors') || 36 | hasFlag('color=true') || 37 | hasFlag('color=always')) { 38 | return 1; 39 | } 40 | 41 | if ('electron' in process.versions) { 42 | return 0; 43 | } 44 | 45 | if (process.stdout && !process.stdout.isTTY) { 46 | return 0; 47 | } 48 | 49 | if (process.platform === 'win32') { 50 | return 1; 51 | } 52 | 53 | if ('COLORTERM' in process.env) { 54 | return 1; 55 | } 56 | 57 | if (process.env.TERM === 'dumb') { 58 | return 0; 59 | } 60 | 61 | if (/^xterm-256(?:color)?/.test(process.env.TERM)) { 62 | return 2; 63 | } 64 | 65 | if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { 66 | return 1; 67 | } 68 | 69 | return 0; 70 | })(); 71 | 72 | if (supportLevel === 0 && 'FORCE_COLOR' in process.env) { 73 | supportLevel = 1; 74 | } 75 | 76 | module.exports = process && support(supportLevel); 77 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/supports-color/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/supports-color/node_modules/has-flag/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = function (flag, argv) { 3 | argv = argv || process.argv; 4 | 5 | var terminatorPos = argv.indexOf('--'); 6 | var prefix = /^--/.test(flag) ? '' : '--'; 7 | var pos = argv.indexOf(prefix + flag); 8 | 9 | return pos !== -1 && (terminatorPos !== -1 ? pos < terminatorPos : true); 10 | }; 11 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/supports-color/node_modules/has-flag/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/supports-color/node_modules/has-flag/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "has-flag", 3 | "version": "1.0.0", 4 | "description": "Check if argv has a specific flag", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/sindresorhus/has-flag.git" 9 | }, 10 | "author": { 11 | "name": "Sindre Sorhus", 12 | "email": "sindresorhus@gmail.com", 13 | "url": "sindresorhus.com" 14 | }, 15 | "maintainers": [ 16 | { 17 | "name": "Sindre Sorhus", 18 | "email": "sindresorhus@gmail.com", 19 | "url": "sindresorhus.com" 20 | }, 21 | { 22 | "name": "Joshua Appelman", 23 | "email": "jappelman@xebia.com", 24 | "url": "jbnicolai.com" 25 | }, 26 | { 27 | "name": "JD Ballard", 28 | "email": "i.am.qix@gmail.com", 29 | "url": "github.com/qix-" 30 | } 31 | ], 32 | "engines": { 33 | "node": ">=0.10.0" 34 | }, 35 | "scripts": { 36 | "test": "node test.js" 37 | }, 38 | "files": [ 39 | "index.js" 40 | ], 41 | "keywords": [ 42 | "has", 43 | "check", 44 | "detect", 45 | "contains", 46 | "find", 47 | "flag", 48 | "cli", 49 | "command-line", 50 | "argv", 51 | "process", 52 | "arg", 53 | "args", 54 | "argument", 55 | "arguments", 56 | "getopt", 57 | "minimist", 58 | "optimist" 59 | ], 60 | "devDependencies": { 61 | "ava": "0.0.4" 62 | }, 63 | "gitHead": "621de2782d538f28f99f0bb85b158799cb3ae5cf", 64 | "bugs": { 65 | "url": "https://github.com/sindresorhus/has-flag/issues" 66 | }, 67 | "homepage": "https://github.com/sindresorhus/has-flag#readme", 68 | "_id": "has-flag@1.0.0", 69 | "_shasum": "9d9e793165ce017a00f00418c43f942a7b1d11fa", 70 | "_from": "has-flag@>=1.0.0 <2.0.0", 71 | "_npmVersion": "2.11.2", 72 | "_nodeVersion": "0.12.5", 73 | "_npmUser": { 74 | "name": "sindresorhus", 75 | "email": "sindresorhus@gmail.com" 76 | }, 77 | "dist": { 78 | "shasum": "9d9e793165ce017a00f00418c43f942a7b1d11fa", 79 | "tarball": "http://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz" 80 | }, 81 | "directories": {}, 82 | "_resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", 83 | "readme": "ERROR: No README data found!" 84 | } 85 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/supports-color/node_modules/has-flag/readme.md: -------------------------------------------------------------------------------- 1 | # has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag) 2 | 3 | > Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag 4 | 5 | Correctly stops looking after an `--` argument terminator. 6 | 7 | 8 | ## Install 9 | 10 | ``` 11 | $ npm install --save has-flag 12 | ``` 13 | 14 | 15 | ## Usage 16 | 17 | ```js 18 | // foo.js 19 | var hasFlag = require('has-flag'); 20 | 21 | hasFlag('unicorn'); 22 | //=> true 23 | 24 | hasFlag('--unicorn'); 25 | //=> true 26 | 27 | hasFlag('foo=bar'); 28 | //=> true 29 | 30 | hasFlag('foo'); 31 | //=> false 32 | 33 | hasFlag('rainbow'); 34 | //=> false 35 | ``` 36 | 37 | ``` 38 | $ node foo.js --unicorn --foo=bar -- --rainbow 39 | ``` 40 | 41 | 42 | ## API 43 | 44 | ### hasFlag(flag, [argv]) 45 | 46 | Returns a boolean whether the flag exists. 47 | 48 | #### flag 49 | 50 | Type: `string` 51 | 52 | CLI flag to look for. The `--` prefix is optional. 53 | 54 | #### argv 55 | 56 | Type: `array` 57 | Default: `process.argv` 58 | 59 | CLI arguments. 60 | 61 | 62 | ## License 63 | 64 | MIT © [Sindre Sorhus](http://sindresorhus.com) 65 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/supports-color/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "supports-color", 3 | "version": "3.1.1", 4 | "description": "Detect whether a terminal supports color", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/chalk/supports-color.git" 9 | }, 10 | "author": { 11 | "name": "Sindre Sorhus", 12 | "email": "sindresorhus@gmail.com", 13 | "url": "sindresorhus.com" 14 | }, 15 | "maintainers": [ 16 | { 17 | "name": "sindresorhus", 18 | "email": "sindresorhus@gmail.com" 19 | }, 20 | { 21 | "name": "jbnicolai", 22 | "email": "jappelman@xebia.com" 23 | } 24 | ], 25 | "browser": "browser.js", 26 | "engines": { 27 | "node": ">=0.8.0" 28 | }, 29 | "scripts": { 30 | "test": "xo && mocha", 31 | "travis": "mocha" 32 | }, 33 | "files": [ 34 | "index.js", 35 | "browser.js" 36 | ], 37 | "keywords": [ 38 | "color", 39 | "colour", 40 | "colors", 41 | "terminal", 42 | "console", 43 | "cli", 44 | "ansi", 45 | "styles", 46 | "tty", 47 | "rgb", 48 | "256", 49 | "shell", 50 | "xterm", 51 | "command-line", 52 | "support", 53 | "supports", 54 | "capability", 55 | "detect", 56 | "truecolor", 57 | "16m", 58 | "million" 59 | ], 60 | "dependencies": { 61 | "has-flag": "^1.0.0" 62 | }, 63 | "devDependencies": { 64 | "mocha": "*", 65 | "require-uncached": "^1.0.2", 66 | "xo": "*" 67 | }, 68 | "xo": { 69 | "envs": [ 70 | "node", 71 | "mocha" 72 | ] 73 | }, 74 | "gitHead": "9434c93918301a6b47faa01999482adfbf1b715c", 75 | "bugs": { 76 | "url": "https://github.com/chalk/supports-color/issues" 77 | }, 78 | "homepage": "https://github.com/chalk/supports-color", 79 | "_id": "supports-color@3.1.1", 80 | "_shasum": "10b730ea2c36e9f3790a035f71b007259260ec4b", 81 | "_from": "supports-color@>=3.1.0 <4.0.0", 82 | "_npmVersion": "2.11.3", 83 | "_nodeVersion": "0.12.7", 84 | "_npmUser": { 85 | "name": "sindresorhus", 86 | "email": "sindresorhus@gmail.com" 87 | }, 88 | "dist": { 89 | "shasum": "10b730ea2c36e9f3790a035f71b007259260ec4b", 90 | "tarball": "http://registry.npmjs.org/supports-color/-/supports-color-3.1.1.tgz" 91 | }, 92 | "directories": {}, 93 | "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.1.tgz", 94 | "readme": "ERROR: No README data found!" 95 | } 96 | -------------------------------------------------------------------------------- /node_modules/postcss/node_modules/supports-color/readme.md: -------------------------------------------------------------------------------- 1 | # supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) 2 | 3 | > Detect whether a terminal supports color 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save supports-color 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | var supportsColor = require('supports-color'); 17 | 18 | if (supportsColor) { 19 | console.log('Terminal supports color'); 20 | } 21 | 22 | if (supportsColor.has256) { 23 | console.log('Terminal supports 256 colors'); 24 | } 25 | 26 | if (supportsColor.has16m) { 27 | console.log('Terminal supports 16 million colors (truecolor)'); 28 | } 29 | ``` 30 | 31 | 32 | ## API 33 | 34 | Returns an `object`, or `false` if color is not supported. 35 | 36 | The returned object specifies a level of support for color through a `.level` property and a corresponding flag: 37 | 38 | - `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) 39 | - `.level = 2` and `.has256 = true`: 256 color support 40 | - `.level = 3` and `.has16m = true`: 16 million (truecolor) support 41 | 42 | 43 | ## Info 44 | 45 | It obeys the `--color` and `--no-color` CLI flags. 46 | 47 | For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`. 48 | 49 | Explicit 256/truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. 50 | 51 | 52 | ## Related 53 | 54 | - [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module 55 | - [chalk](https://github.com/chalk/chalk) - Terminal string styling done right 56 | 57 | 58 | ## License 59 | 60 | MIT © [Sindre Sorhus](http://sindresorhus.com) 61 | -------------------------------------------------------------------------------- /node_modules/postcss/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "postcss", 3 | "version": "5.0.4", 4 | "description": "Tool for transforming styles with JS plugins", 5 | "keywords": [ 6 | "css", 7 | "postcss", 8 | "rework", 9 | "preprocessor", 10 | "parser", 11 | "source map", 12 | "transform", 13 | "manipulation", 14 | "transpiler" 15 | ], 16 | "author": { 17 | "name": "Andrey Sitnik", 18 | "email": "andrey@sitnik.ru" 19 | }, 20 | "license": "MIT", 21 | "repository": { 22 | "type": "git", 23 | "url": "git+https://github.com/postcss/postcss.git" 24 | }, 25 | "dependencies": { 26 | "supports-color": "^3.1.0", 27 | "source-map": "^0.4.4", 28 | "js-base64": "^2.1.9" 29 | }, 30 | "devDependencies": { 31 | "concat-with-sourcemaps": "1.0.2", 32 | "postcss-parser-tests": "5.0.2", 33 | "gulp-json-editor": "2.2.1", 34 | "gulp-istanbul": "0.10.0", 35 | "run-sequence": "1.1.2", 36 | "babel-eslint": "4.1.1", 37 | "gulp-eslint": "1.0.0", 38 | "gulp-mocha": "2.1.3", 39 | "gulp-babel": "5.2.1", 40 | "strip-ansi": "3.0.0", 41 | "yaspeller": "2.5.0", 42 | "gulp-util": "3.0.6", 43 | "gulp-run": "1.6.10", 44 | "fs-extra": "0.24.0", 45 | "isparta": "3.0.4", 46 | "eslint": "1.3.1", 47 | "sinon": "1.16.1", 48 | "mocha": "2.3.0", 49 | "gulp": "3.9.0", 50 | "chai": "3.2.0", 51 | "del": "2.0.0", 52 | "babel-core": "5.8.23" 53 | }, 54 | "scripts": { 55 | "test": "gulp" 56 | }, 57 | "main": "lib/postcss", 58 | "bugs": { 59 | "url": "https://github.com/postcss/postcss/issues" 60 | }, 61 | "homepage": "https://github.com/postcss/postcss#readme", 62 | "_id": "postcss@5.0.4", 63 | "_shasum": "4e3ec2f5f0fc90210f13959b06fe17a7d1403d09", 64 | "_from": "postcss@>=5.0.4 <6.0.0", 65 | "_npmVersion": "2.13.0", 66 | "_nodeVersion": "2.4.0", 67 | "_npmUser": { 68 | "name": "ai", 69 | "email": "andrey@sitnik.ru" 70 | }, 71 | "dist": { 72 | "shasum": "4e3ec2f5f0fc90210f13959b06fe17a7d1403d09", 73 | "tarball": "http://registry.npmjs.org/postcss/-/postcss-5.0.4.tgz" 74 | }, 75 | "maintainers": [ 76 | { 77 | "name": "ai", 78 | "email": "andrey@sitnik.ru" 79 | } 80 | ], 81 | "directories": {}, 82 | "_resolved": "https://registry.npmjs.org/postcss/-/postcss-5.0.4.tgz", 83 | "readme": "ERROR: No README data found!" 84 | } 85 | -------------------------------------------------------------------------------- /node_modules/postcss/postcss.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'postcss' { 2 | import postcss from 'd.ts/postcss'; 3 | export default postcss; 4 | } 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "postcss": "^5.0.4", 4 | "get-stdin": "^4.0.1", 5 | "perfectionist": "^2.0.0", 6 | "postcss-scss": "^0.1.2", 7 | "postcss-safe-parser": "^1.0.1" 8 | }, 9 | "engines": { 10 | "node": ">=0.10.0" 11 | }, 12 | "private": true 13 | } 14 | -------------------------------------------------------------------------------- /perfectionist.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var scss = require('postcss-scss'); 3 | var safe = require('postcss-safe-parser'); 4 | var stdin = require('get-stdin'); 5 | var postcss = require('postcss'); 6 | var perfectionist = require('perfectionist'); 7 | 8 | stdin(function(data) { 9 | var opts = JSON.parse(process.argv[2]); 10 | 11 | postcss([perfectionist(opts)]) 12 | .process(data, { 13 | syntax: scss 14 | }) 15 | .then(function(result) { 16 | process.stdout.write(result.css); 17 | }).catch(function(err) { 18 | if (err.name === 'CssSyntaxError') { 19 | err.message += '\n' + err.showSourceCode(); 20 | } 21 | 22 | console.error(err.message.replace(':', '')); 23 | }); 24 | 25 | }); 26 | -------------------------------------------------------------------------------- /perfectionist.py: -------------------------------------------------------------------------------- 1 | import sublime 2 | import sublime_plugin 3 | import os 4 | import re 5 | import json 6 | from os.path import dirname, realpath, join 7 | 8 | try: 9 | # Python 2 10 | from node_bridge import node_bridge 11 | except: 12 | from .node_bridge import node_bridge 13 | 14 | # monkeypatch `Region` to be iterable 15 | sublime.Region.totuple = lambda self: (self.a, self.b) 16 | sublime.Region.__iter__ = lambda self: self.totuple().__iter__() 17 | 18 | BIN_PATH = join(sublime.packages_path(), dirname( 19 | realpath(__file__)), 'perfectionist.js') 20 | 21 | 22 | class PerfectionistCommand(sublime_plugin.TextCommand): 23 | 24 | def run(self, edit, action='expanded'): 25 | if action == 'auto': 26 | action = self.get_setting('format') 27 | 28 | if not self.has_selection(): 29 | region = sublime.Region(0, self.view.size()) 30 | originalBuffer = self.view.substr(region) 31 | code = self.beautify(originalBuffer, action) 32 | if code: 33 | self.view.replace(edit, region, code) 34 | return 35 | for region in self.view.sel(): 36 | if region.empty(): 37 | continue 38 | originalBuffer = self.view.substr(region) 39 | code = self.beautify(originalBuffer, action) 40 | if code: 41 | self.view.replace(edit, region, code) 42 | 43 | def beautify(self, data, action): 44 | try: 45 | return node_bridge(data, BIN_PATH, [json.dumps({ 46 | 'format': action, 47 | 'indentSize': self.get_setting('indent_size'), 48 | 'cascade': self.get_setting('cascade'), 49 | 'maxAtRuleLength': self.get_setting('max_at_rule_length'), 50 | 'maxSelectorLength': self.get_setting('max_selector_length'), 51 | 'maxValueLength': self.get_setting('max_value_length') 52 | })]) 53 | except Exception as e: 54 | sublime.error_message('Perfectionist\n%s' % e) 55 | 56 | def has_selection(self): 57 | for sel in self.view.sel(): 58 | start, end = sel 59 | if start != end: 60 | return True 61 | return False 62 | 63 | def get_setting(self, key): 64 | settings = self.view.settings().get('perfectionist') 65 | if settings is None: 66 | settings = sublime.load_settings('perfectionist.sublime-settings') 67 | return settings.get(key) 68 | 69 | # Filter file 70 | def is_visible(self): 71 | view = self.view 72 | file_name = view.file_name() 73 | syntax_path = view.settings().get('syntax') 74 | suffix_array = self.get_setting('file_filter').split(',') 75 | suffix = '' 76 | syntax = '' 77 | 78 | if file_name != None: # file exists, pull syntax type from extension 79 | suffix = os.path.splitext(file_name)[1][1:] 80 | if syntax_path != None: 81 | syntax = os.path.splitext(syntax_path)[0].split('/')[-1].lower() 82 | return suffix in suffix_array or syntax in suffix_array 83 | 84 | # On Save File auto format 85 | class BeautifyOnSave(sublime_plugin.EventListener): 86 | 87 | def on_pre_save(self, view): 88 | settings = sublime.load_settings('perfectionist.sublime-settings') 89 | 90 | should_format = view.settings().get( 91 | 'format_on_save', settings.get('format_on_save', False)) 92 | if not should_format: 93 | return 94 | 95 | file_filter_list = view.settings().get('file_filter', settings.get( 96 | 'file_filter', 'css,scss,less,html,htm')).replace(',', '|') 97 | filter_region_concat = '\.(' + file_filter_list + ')$' 98 | 99 | if not re.search(filter_region_concat, view.file_name()): 100 | return 101 | 102 | format_action = view.settings().get( 103 | 'format', settings.get('format', 'expanded')) 104 | if not format_action: 105 | return 106 | 107 | view.run_command('perfectionist', {'action': format_action}) 108 | -------------------------------------------------------------------------------- /perfectionist.sublime-commands: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "caption": "CSS Perfectionist: Expanded", 4 | "command": "perfectionist", 5 | "args": { 6 | "action": "expanded" 7 | } 8 | }, 9 | { 10 | "caption": "CSS Perfectionist: Compact", 11 | "command": "perfectionist", 12 | "args": { 13 | "action": "compact" 14 | } 15 | }, 16 | { 17 | "caption": "CSS Perfectionist: Compressed", 18 | "command": "perfectionist", 19 | "args": { 20 | "action": "compressed" 21 | } 22 | } 23 | ] 24 | -------------------------------------------------------------------------------- /perfectionist.sublime-settings: -------------------------------------------------------------------------------- 1 | { 2 | //expanded 3 | //compact 4 | //compressed 5 | "format": "expanded", 6 | "indent_size": 2, 7 | "cascade": true, 8 | "max_at_rule_length": 80, 9 | "max_selector_length": 80, 10 | "max_value_length": 80, 11 | 12 | //On Save File auto format 13 | "format_on_save": true, 14 | 15 | //On Save File Filter 16 | "file_filter": "css,scss" 17 | } 18 | -------------------------------------------------------------------------------- /shot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yisibl/sublime-perfectionist/cfe7007d4105439c68bac58e827ee16de3f35d9d/shot.gif --------------------------------------------------------------------------------