MinsoftK

7

Showing 1000 changed files with 0 additions and 4880 deletions

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

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 -var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
9 -
10 -/**
11 - * Encode an integer in the range of 0 to 63 to a single base 64 digit.
12 - */
13 -exports.encode = function (number) {
14 - if (0 <= number && number < intToCharMap.length) {
15 - return intToCharMap[number];
16 - }
17 - throw new TypeError("Must be between 0 and 63: " + number);
18 -};
19 -
20 -/**
21 - * Decode a single base 64 character code digit to an integer. Returns -1 on
22 - * failure.
23 - */
24 -exports.decode = function (charCode) {
25 - var bigA = 65; // 'A'
26 - var bigZ = 90; // 'Z'
27 -
28 - var littleA = 97; // 'a'
29 - var littleZ = 122; // 'z'
30 -
31 - var zero = 48; // '0'
32 - var nine = 57; // '9'
33 -
34 - var plus = 43; // '+'
35 - var slash = 47; // '/'
36 -
37 - var littleOffset = 26;
38 - var numberOffset = 52;
39 -
40 - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
41 - if (bigA <= charCode && charCode <= bigZ) {
42 - return (charCode - bigA);
43 - }
44 -
45 - // 26 - 51: abcdefghijklmnopqrstuvwxyz
46 - if (littleA <= charCode && charCode <= littleZ) {
47 - return (charCode - littleA + littleOffset);
48 - }
49 -
50 - // 52 - 61: 0123456789
51 - if (zero <= charCode && charCode <= nine) {
52 - return (charCode - zero + numberOffset);
53 - }
54 -
55 - // 62: +
56 - if (charCode == plus) {
57 - return 62;
58 - }
59 -
60 - // 63: /
61 - if (charCode == slash) {
62 - return 63;
63 - }
64 -
65 - // Invalid base64 digit.
66 - return -1;
67 -};
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 -exports.GREATEST_LOWER_BOUND = 1;
9 -exports.LEAST_UPPER_BOUND = 2;
10 -
11 -/**
12 - * Recursive implementation of binary search.
13 - *
14 - * @param aLow Indices here and lower do not contain the needle.
15 - * @param aHigh Indices here and higher do not contain the needle.
16 - * @param aNeedle The element being searched for.
17 - * @param aHaystack The non-empty array being searched.
18 - * @param aCompare Function which takes two elements and returns -1, 0, or 1.
19 - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
20 - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
21 - * closest element that is smaller than or greater than the one we are
22 - * searching for, respectively, if the exact element cannot be found.
23 - */
24 -function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
25 - // This function terminates when one of the following is true:
26 - //
27 - // 1. We find the exact element we are looking for.
28 - //
29 - // 2. We did not find the exact element, but we can return the index of
30 - // the next-closest element.
31 - //
32 - // 3. We did not find the exact element, and there is no next-closest
33 - // element than the one we are searching for, so we return -1.
34 - var mid = Math.floor((aHigh - aLow) / 2) + aLow;
35 - var cmp = aCompare(aNeedle, aHaystack[mid], true);
36 - if (cmp === 0) {
37 - // Found the element we are looking for.
38 - return mid;
39 - }
40 - else if (cmp > 0) {
41 - // Our needle is greater than aHaystack[mid].
42 - if (aHigh - mid > 1) {
43 - // The element is in the upper half.
44 - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
45 - }
46 -
47 - // The exact needle element was not found in this haystack. Determine if
48 - // we are in termination case (3) or (2) and return the appropriate thing.
49 - if (aBias == exports.LEAST_UPPER_BOUND) {
50 - return aHigh < aHaystack.length ? aHigh : -1;
51 - } else {
52 - return mid;
53 - }
54 - }
55 - else {
56 - // Our needle is less than aHaystack[mid].
57 - if (mid - aLow > 1) {
58 - // The element is in the lower half.
59 - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
60 - }
61 -
62 - // we are in termination case (3) or (2) and return the appropriate thing.
63 - if (aBias == exports.LEAST_UPPER_BOUND) {
64 - return mid;
65 - } else {
66 - return aLow < 0 ? -1 : aLow;
67 - }
68 - }
69 -}
70 -
71 -/**
72 - * This is an implementation of binary search which will always try and return
73 - * the index of the closest element if there is no exact hit. This is because
74 - * mappings between original and generated line/col pairs are single points,
75 - * and there is an implicit region between each of them, so a miss just means
76 - * that you aren't on the very start of a region.
77 - *
78 - * @param aNeedle The element you are looking for.
79 - * @param aHaystack The array that is being searched.
80 - * @param aCompare A function which takes the needle and an element in the
81 - * array and returns -1, 0, or 1 depending on whether the needle is less
82 - * than, equal to, or greater than the element, respectively.
83 - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
84 - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
85 - * closest element that is smaller than or greater than the one we are
86 - * searching for, respectively, if the exact element cannot be found.
87 - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
88 - */
89 -exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
90 - if (aHaystack.length === 0) {
91 - return -1;
92 - }
93 -
94 - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
95 - aCompare, aBias || exports.GREATEST_LOWER_BOUND);
96 - if (index < 0) {
97 - return -1;
98 - }
99 -
100 - // We have found either the exact element, or the next-closest element than
101 - // the one we are searching for. However, there may be more than one such
102 - // element. Make sure we always return the smallest of these.
103 - while (index - 1 >= 0) {
104 - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
105 - break;
106 - }
107 - --index;
108 - }
109 -
110 - return index;
111 -};
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 -
8 -var util = require('./util');
9 -
10 -/**
11 - * Determine whether mappingB is after mappingA with respect to generated
12 - * position.
13 - */
14 -function generatedPositionAfter(mappingA, mappingB) {
15 - // Optimized for most common case
16 - var lineA = mappingA.generatedLine;
17 - var lineB = mappingB.generatedLine;
18 - var columnA = mappingA.generatedColumn;
19 - var columnB = mappingB.generatedColumn;
20 - return lineB > lineA || lineB == lineA && columnB >= columnA ||
21 - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
22 -}
23 -
24 -/**
25 - * A data structure to provide a sorted view of accumulated mappings in a
26 - * performance conscious manner. It trades a neglibable overhead in general
27 - * case for a large speedup in case of mappings being added in order.
28 - */
29 -function MappingList() {
30 - this._array = [];
31 - this._sorted = true;
32 - // Serves as infimum
33 - this._last = {generatedLine: -1, generatedColumn: 0};
34 -}
35 -
36 -/**
37 - * Iterate through internal items. This method takes the same arguments that
38 - * `Array.prototype.forEach` takes.
39 - *
40 - * NOTE: The order of the mappings is NOT guaranteed.
41 - */
42 -MappingList.prototype.unsortedForEach =
43 - function MappingList_forEach(aCallback, aThisArg) {
44 - this._array.forEach(aCallback, aThisArg);
45 - };
46 -
47 -/**
48 - * Add the given source mapping.
49 - *
50 - * @param Object aMapping
51 - */
52 -MappingList.prototype.add = function MappingList_add(aMapping) {
53 - if (generatedPositionAfter(this._last, aMapping)) {
54 - this._last = aMapping;
55 - this._array.push(aMapping);
56 - } else {
57 - this._sorted = false;
58 - this._array.push(aMapping);
59 - }
60 -};
61 -
62 -/**
63 - * Returns the flat, sorted array of mappings. The mappings are sorted by
64 - * generated position.
65 - *
66 - * WARNING: This method returns internal data without copying, for
67 - * performance. The return value must NOT be mutated, and should be treated as
68 - * an immutable borrow. If you want to take ownership, you must make your own
69 - * copy.
70 - */
71 -MappingList.prototype.toArray = function MappingList_toArray() {
72 - if (!this._sorted) {
73 - this._array.sort(util.compareByGeneratedPositionsInflated);
74 - this._sorted = true;
75 - }
76 - return this._array;
77 -};
78 -
79 -exports.MappingList = MappingList;
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 -// It turns out that some (most?) JavaScript engines don't self-host
9 -// `Array.prototype.sort`. This makes sense because C++ will likely remain
10 -// faster than JS when doing raw CPU-intensive sorting. However, when using a
11 -// custom comparator function, calling back and forth between the VM's C++ and
12 -// JIT'd JS is rather slow *and* loses JIT type information, resulting in
13 -// worse generated code for the comparator function than would be optimal. In
14 -// fact, when sorting with a comparator, these costs outweigh the benefits of
15 -// sorting in C++. By using our own JS-implemented Quick Sort (below), we get
16 -// a ~3500ms mean speed-up in `bench/bench.html`.
17 -
18 -/**
19 - * Swap the elements indexed by `x` and `y` in the array `ary`.
20 - *
21 - * @param {Array} ary
22 - * The array.
23 - * @param {Number} x
24 - * The index of the first item.
25 - * @param {Number} y
26 - * The index of the second item.
27 - */
28 -function swap(ary, x, y) {
29 - var temp = ary[x];
30 - ary[x] = ary[y];
31 - ary[y] = temp;
32 -}
33 -
34 -/**
35 - * Returns a random integer within the range `low .. high` inclusive.
36 - *
37 - * @param {Number} low
38 - * The lower bound on the range.
39 - * @param {Number} high
40 - * The upper bound on the range.
41 - */
42 -function randomIntInRange(low, high) {
43 - return Math.round(low + (Math.random() * (high - low)));
44 -}
45 -
46 -/**
47 - * The Quick Sort algorithm.
48 - *
49 - * @param {Array} ary
50 - * An array to sort.
51 - * @param {function} comparator
52 - * Function to use to compare two items.
53 - * @param {Number} p
54 - * Start index of the array
55 - * @param {Number} r
56 - * End index of the array
57 - */
58 -function doQuickSort(ary, comparator, p, r) {
59 - // If our lower bound is less than our upper bound, we (1) partition the
60 - // array into two pieces and (2) recurse on each half. If it is not, this is
61 - // the empty array and our base case.
62 -
63 - if (p < r) {
64 - // (1) Partitioning.
65 - //
66 - // The partitioning chooses a pivot between `p` and `r` and moves all
67 - // elements that are less than or equal to the pivot to the before it, and
68 - // all the elements that are greater than it after it. The effect is that
69 - // once partition is done, the pivot is in the exact place it will be when
70 - // the array is put in sorted order, and it will not need to be moved
71 - // again. This runs in O(n) time.
72 -
73 - // Always choose a random pivot so that an input array which is reverse
74 - // sorted does not cause O(n^2) running time.
75 - var pivotIndex = randomIntInRange(p, r);
76 - var i = p - 1;
77 -
78 - swap(ary, pivotIndex, r);
79 - var pivot = ary[r];
80 -
81 - // Immediately after `j` is incremented in this loop, the following hold
82 - // true:
83 - //
84 - // * Every element in `ary[p .. i]` is less than or equal to the pivot.
85 - //
86 - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
87 - for (var j = p; j < r; j++) {
88 - if (comparator(ary[j], pivot) <= 0) {
89 - i += 1;
90 - swap(ary, i, j);
91 - }
92 - }
93 -
94 - swap(ary, i + 1, j);
95 - var q = i + 1;
96 -
97 - // (2) Recurse on each half.
98 -
99 - doQuickSort(ary, comparator, p, q - 1);
100 - doQuickSort(ary, comparator, q + 1, r);
101 - }
102 -}
103 -
104 -/**
105 - * Sort the given array in-place with the given comparator function.
106 - *
107 - * @param {Array} ary
108 - * An array to sort.
109 - * @param {function} comparator
110 - * Function to use to compare two items.
111 - */
112 -exports.quickSort = function (ary, comparator) {
113 - doQuickSort(ary, comparator, 0, ary.length - 1);
114 -};
1 -{
2 - "_from": "source-map@^0.6.1",
3 - "_id": "source-map@0.6.1",
4 - "_inBundle": false,
5 - "_integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
6 - "_location": "/css-tree/source-map",
7 - "_phantomChildren": {},
8 - "_requested": {
9 - "type": "range",
10 - "registry": true,
11 - "raw": "source-map@^0.6.1",
12 - "name": "source-map",
13 - "escapedName": "source-map",
14 - "rawSpec": "^0.6.1",
15 - "saveSpec": null,
16 - "fetchSpec": "^0.6.1"
17 - },
18 - "_requiredBy": [
19 - "/css-tree"
20 - ],
21 - "_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
22 - "_shasum": "74722af32e9614e9c287a8d0bbde48b5e2f1a263",
23 - "_spec": "source-map@^0.6.1",
24 - "_where": "C:\\Users\\kkwan_000\\Desktop\\git\\2017110269\\minsung\\node_modules\\css-tree",
25 - "author": {
26 - "name": "Nick Fitzgerald",
27 - "email": "nfitzgerald@mozilla.com"
28 - },
29 - "bugs": {
30 - "url": "https://github.com/mozilla/source-map/issues"
31 - },
32 - "bundleDependencies": false,
33 - "contributors": [
34 - {
35 - "name": "Tobias Koppers",
36 - "email": "tobias.koppers@googlemail.com"
37 - },
38 - {
39 - "name": "Duncan Beevers",
40 - "email": "duncan@dweebd.com"
41 - },
42 - {
43 - "name": "Stephen Crane",
44 - "email": "scrane@mozilla.com"
45 - },
46 - {
47 - "name": "Ryan Seddon",
48 - "email": "seddon.ryan@gmail.com"
49 - },
50 - {
51 - "name": "Miles Elam",
52 - "email": "miles.elam@deem.com"
53 - },
54 - {
55 - "name": "Mihai Bazon",
56 - "email": "mihai.bazon@gmail.com"
57 - },
58 - {
59 - "name": "Michael Ficarra",
60 - "email": "github.public.email@michael.ficarra.me"
61 - },
62 - {
63 - "name": "Todd Wolfson",
64 - "email": "todd@twolfson.com"
65 - },
66 - {
67 - "name": "Alexander Solovyov",
68 - "email": "alexander@solovyov.net"
69 - },
70 - {
71 - "name": "Felix Gnass",
72 - "email": "fgnass@gmail.com"
73 - },
74 - {
75 - "name": "Conrad Irwin",
76 - "email": "conrad.irwin@gmail.com"
77 - },
78 - {
79 - "name": "usrbincc",
80 - "email": "usrbincc@yahoo.com"
81 - },
82 - {
83 - "name": "David Glasser",
84 - "email": "glasser@davidglasser.net"
85 - },
86 - {
87 - "name": "Chase Douglas",
88 - "email": "chase@newrelic.com"
89 - },
90 - {
91 - "name": "Evan Wallace",
92 - "email": "evan.exe@gmail.com"
93 - },
94 - {
95 - "name": "Heather Arthur",
96 - "email": "fayearthur@gmail.com"
97 - },
98 - {
99 - "name": "Hugh Kennedy",
100 - "email": "hughskennedy@gmail.com"
101 - },
102 - {
103 - "name": "David Glasser",
104 - "email": "glasser@davidglasser.net"
105 - },
106 - {
107 - "name": "Simon Lydell",
108 - "email": "simon.lydell@gmail.com"
109 - },
110 - {
111 - "name": "Jmeas Smith",
112 - "email": "jellyes2@gmail.com"
113 - },
114 - {
115 - "name": "Michael Z Goddard",
116 - "email": "mzgoddard@gmail.com"
117 - },
118 - {
119 - "name": "azu",
120 - "email": "azu@users.noreply.github.com"
121 - },
122 - {
123 - "name": "John Gozde",
124 - "email": "john@gozde.ca"
125 - },
126 - {
127 - "name": "Adam Kirkton",
128 - "email": "akirkton@truefitinnovation.com"
129 - },
130 - {
131 - "name": "Chris Montgomery",
132 - "email": "christopher.montgomery@dowjones.com"
133 - },
134 - {
135 - "name": "J. Ryan Stinnett",
136 - "email": "jryans@gmail.com"
137 - },
138 - {
139 - "name": "Jack Herrington",
140 - "email": "jherrington@walmartlabs.com"
141 - },
142 - {
143 - "name": "Chris Truter",
144 - "email": "jeffpalentine@gmail.com"
145 - },
146 - {
147 - "name": "Daniel Espeset",
148 - "email": "daniel@danielespeset.com"
149 - },
150 - {
151 - "name": "Jamie Wong",
152 - "email": "jamie.lf.wong@gmail.com"
153 - },
154 - {
155 - "name": "Eddy Bruël",
156 - "email": "ejpbruel@mozilla.com"
157 - },
158 - {
159 - "name": "Hawken Rives",
160 - "email": "hawkrives@gmail.com"
161 - },
162 - {
163 - "name": "Gilad Peleg",
164 - "email": "giladp007@gmail.com"
165 - },
166 - {
167 - "name": "djchie",
168 - "email": "djchie.dev@gmail.com"
169 - },
170 - {
171 - "name": "Gary Ye",
172 - "email": "garysye@gmail.com"
173 - },
174 - {
175 - "name": "Nicolas Lalevée",
176 - "email": "nicolas.lalevee@hibnet.org"
177 - }
178 - ],
179 - "deprecated": false,
180 - "description": "Generates and consumes source maps",
181 - "devDependencies": {
182 - "doctoc": "^0.15.0",
183 - "webpack": "^1.12.0"
184 - },
185 - "engines": {
186 - "node": ">=0.10.0"
187 - },
188 - "files": [
189 - "source-map.js",
190 - "source-map.d.ts",
191 - "lib/",
192 - "dist/source-map.debug.js",
193 - "dist/source-map.js",
194 - "dist/source-map.min.js",
195 - "dist/source-map.min.js.map"
196 - ],
197 - "homepage": "https://github.com/mozilla/source-map",
198 - "license": "BSD-3-Clause",
199 - "main": "./source-map.js",
200 - "name": "source-map",
201 - "repository": {
202 - "type": "git",
203 - "url": "git+ssh://git@github.com/mozilla/source-map.git"
204 - },
205 - "scripts": {
206 - "build": "webpack --color",
207 - "test": "npm run build && node test/run-tests.js",
208 - "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md"
209 - },
210 - "typings": "source-map",
211 - "version": "0.6.1"
212 -}
1 -export interface StartOfSourceMap {
2 - file?: string;
3 - sourceRoot?: string;
4 -}
5 -
6 -export interface RawSourceMap extends StartOfSourceMap {
7 - version: string;
8 - sources: string[];
9 - names: string[];
10 - sourcesContent?: string[];
11 - mappings: string;
12 -}
13 -
14 -export interface Position {
15 - line: number;
16 - column: number;
17 -}
18 -
19 -export interface LineRange extends Position {
20 - lastColumn: number;
21 -}
22 -
23 -export interface FindPosition extends Position {
24 - // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND
25 - bias?: number;
26 -}
27 -
28 -export interface SourceFindPosition extends FindPosition {
29 - source: string;
30 -}
31 -
32 -export interface MappedPosition extends Position {
33 - source: string;
34 - name?: string;
35 -}
36 -
37 -export interface MappingItem {
38 - source: string;
39 - generatedLine: number;
40 - generatedColumn: number;
41 - originalLine: number;
42 - originalColumn: number;
43 - name: string;
44 -}
45 -
46 -export class SourceMapConsumer {
47 - static GENERATED_ORDER: number;
48 - static ORIGINAL_ORDER: number;
49 -
50 - static GREATEST_LOWER_BOUND: number;
51 - static LEAST_UPPER_BOUND: number;
52 -
53 - constructor(rawSourceMap: RawSourceMap);
54 - computeColumnSpans(): void;
55 - originalPositionFor(generatedPosition: FindPosition): MappedPosition;
56 - generatedPositionFor(originalPosition: SourceFindPosition): LineRange;
57 - allGeneratedPositionsFor(originalPosition: MappedPosition): Position[];
58 - hasContentsOfAllSources(): boolean;
59 - sourceContentFor(source: string, returnNullOnMissing?: boolean): string;
60 - eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void;
61 -}
62 -
63 -export interface Mapping {
64 - generated: Position;
65 - original: Position;
66 - source: string;
67 - name?: string;
68 -}
69 -
70 -export class SourceMapGenerator {
71 - constructor(startOfSourceMap?: StartOfSourceMap);
72 - static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator;
73 - addMapping(mapping: Mapping): void;
74 - setSourceContent(sourceFile: string, sourceContent: string): void;
75 - applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void;
76 - toString(): string;
77 -}
78 -
79 -export interface CodeWithSourceMap {
80 - code: string;
81 - map: SourceMapGenerator;
82 -}
83 -
84 -export class SourceNode {
85 - constructor();
86 - constructor(line: number, column: number, source: string);
87 - constructor(line: number, column: number, source: string, chunk?: string, name?: string);
88 - static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode;
89 - add(chunk: string): void;
90 - prepend(chunk: string): void;
91 - setSourceContent(sourceFile: string, sourceContent: string): void;
92 - walk(fn: (chunk: string, mapping: MappedPosition) => void): void;
93 - walkSourceContents(fn: (file: string, content: string) => void): void;
94 - join(sep: string): SourceNode;
95 - replaceRight(pattern: string, replacement: string): SourceNode;
96 - toString(): string;
97 - toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap;
98 -}
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('./lib/source-map-generator').SourceMapGenerator;
7 -exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;
8 -exports.SourceNode = require('./lib/source-node').SourceNode;
1 -{
2 - "_from": "css-tree@1.0.0-alpha.37",
3 - "_id": "css-tree@1.0.0-alpha.37",
4 - "_inBundle": false,
5 - "_integrity": "sha512-DMxWJg0rnz7UgxKT0Q1HU/L9BeJI0M6ksor0OgqOnF+aRCDWg/N2641HmVyU9KVIu0OVVWOb2IpC9A+BJRnejg==",
6 - "_location": "/css-tree",
7 - "_phantomChildren": {},
8 - "_requested": {
9 - "type": "version",
10 - "registry": true,
11 - "raw": "css-tree@1.0.0-alpha.37",
12 - "name": "css-tree",
13 - "escapedName": "css-tree",
14 - "rawSpec": "1.0.0-alpha.37",
15 - "saveSpec": null,
16 - "fetchSpec": "1.0.0-alpha.37"
17 - },
18 - "_requiredBy": [
19 - "/svgo"
20 - ],
21 - "_resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.37.tgz",
22 - "_shasum": "98bebd62c4c1d9f960ec340cf9f7522e30709a22",
23 - "_spec": "css-tree@1.0.0-alpha.37",
24 - "_where": "C:\\Users\\kkwan_000\\Desktop\\git\\2017110269\\minsung\\node_modules\\svgo",
25 - "author": {
26 - "name": "Roman Dvornov",
27 - "email": "rdvornov@gmail.com",
28 - "url": "https://github.com/lahmatiy"
29 - },
30 - "browser": {
31 - "./data": "./dist/default-syntax.json"
32 - },
33 - "bugs": {
34 - "url": "https://github.com/csstree/csstree/issues"
35 - },
36 - "bundleDependencies": false,
37 - "dependencies": {
38 - "mdn-data": "2.0.4",
39 - "source-map": "^0.6.1"
40 - },
41 - "deprecated": false,
42 - "description": "CSSTree is a tool set to work with CSS, including fast detailed parser (string->AST), walker (AST traversal), generator (AST->string) and lexer (validation and matching) based on knowledge of spec and browser implementations",
43 - "devDependencies": {
44 - "coveralls": "^3.0.4",
45 - "eslint": "^6.3.0",
46 - "json-to-ast": "^2.1.0",
47 - "mocha": "^5.2.0",
48 - "nyc": "^14.1.1",
49 - "rollup": "^1.22.0",
50 - "rollup-plugin-commonjs": "^10.1.0",
51 - "rollup-plugin-json": "^4.0.0",
52 - "rollup-plugin-node-resolve": "^5.2.0",
53 - "terser": "^4.3.4"
54 - },
55 - "engines": {
56 - "node": ">=8.0.0"
57 - },
58 - "files": [
59 - "data",
60 - "dist",
61 - "lib"
62 - ],
63 - "homepage": "https://github.com/csstree/csstree#readme",
64 - "keywords": [
65 - "css",
66 - "ast",
67 - "tokenizer",
68 - "parser",
69 - "walker",
70 - "lexer",
71 - "generator",
72 - "utils",
73 - "syntax",
74 - "validation"
75 - ],
76 - "license": "MIT",
77 - "main": "./lib/index",
78 - "name": "css-tree",
79 - "repository": {
80 - "type": "git",
81 - "url": "git+https://github.com/csstree/csstree.git"
82 - },
83 - "scripts": {
84 - "build": "npm run gen:syntax && rollup --config && terser dist/csstree.js --compress --mangle -o dist/csstree.min.js",
85 - "coverage": "nyc npm test",
86 - "coveralls": "nyc report --reporter=text-lcov | coveralls",
87 - "gen:syntax": "node scripts/gen-syntax-data",
88 - "hydrogen": "node --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces --redirect-code-traces-to=code.asm --trace_hydrogen_file=code.cfg --print-opt-code bin/parse --stat -o /dev/null",
89 - "lint": "eslint data lib scripts test && node scripts/review-syntax-patch --lint && node scripts/update-docs --lint",
90 - "lint-and-test": "npm run lint && npm test",
91 - "prepublishOnly": "npm run build",
92 - "review:syntax-patch": "node scripts/review-syntax-patch",
93 - "test": "mocha --reporter progress",
94 - "travis": "nyc npm run lint-and-test && npm run coveralls",
95 - "update:docs": "node scripts/update-docs"
96 - },
97 - "version": "1.0.0-alpha.37"
98 -}
1 -Copyright (c) Felix Böhm
2 -All rights reserved.
3 -
4 -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5 -
6 -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7 -
8 -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9 -
10 -THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
11 -EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1 -export * from "./parse";
2 -export { default as parse } from "./parse";
3 -export { default as stringify } from "./stringify";
4 -//# sourceMappingURL=index.d.ts.map
...\ No newline at end of file ...\ No newline at end of file
1 -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC"}
...\ No newline at end of file ...\ No newline at end of file
1 -"use strict";
2 -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3 - if (k2 === undefined) k2 = k;
4 - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5 -}) : (function(o, m, k, k2) {
6 - if (k2 === undefined) k2 = k;
7 - o[k2] = m[k];
8 -}));
9 -var __exportStar = (this && this.__exportStar) || function(m, exports) {
10 - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11 -};
12 -var __importDefault = (this && this.__importDefault) || function (mod) {
13 - return (mod && mod.__esModule) ? mod : { "default": mod };
14 -};
15 -Object.defineProperty(exports, "__esModule", { value: true });
16 -exports.stringify = exports.parse = void 0;
17 -__exportStar(require("./parse"), exports);
18 -var parse_1 = require("./parse");
19 -Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return __importDefault(parse_1).default; } });
20 -var stringify_1 = require("./stringify");
21 -Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return __importDefault(stringify_1).default; } });
1 -export default parse;
2 -export interface Options {
3 - lowerCaseAttributeNames?: boolean;
4 - lowerCaseTags?: boolean;
5 - xmlMode?: boolean;
6 -}
7 -export declare type Selector = PseudoSelector | PseudoElement | AttributeSelector | TagSelector | UniversalSelector | Traversal;
8 -export interface AttributeSelector {
9 - type: "attribute";
10 - name: string;
11 - action: AttributeAction;
12 - value: string;
13 - ignoreCase: boolean;
14 -}
15 -declare type DataType = Selector[][] | null | string;
16 -export interface PseudoSelector {
17 - type: "pseudo";
18 - name: string;
19 - data: DataType;
20 -}
21 -export interface PseudoElement {
22 - type: "pseudo-element";
23 - name: string;
24 -}
25 -export interface TagSelector {
26 - type: "tag";
27 - name: string;
28 -}
29 -export interface UniversalSelector {
30 - type: "universal";
31 -}
32 -export interface Traversal {
33 - type: TraversalType;
34 -}
35 -export declare type AttributeAction = "any" | "element" | "end" | "equals" | "exists" | "hyphen" | "not" | "start";
36 -export declare type TraversalType = "adjacent" | "child" | "descendant" | "parent" | "sibling";
37 -declare function parse(selector: string, options?: Options): Selector[][];
38 -//# sourceMappingURL=parse.d.ts.map
...\ No newline at end of file ...\ No newline at end of file
1 -{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AAEA,eAAe,KAAK,CAAC;AAErB,MAAM,WAAW,OAAO;IACpB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,oBAAY,QAAQ,GACd,cAAc,GACd,aAAa,GACb,iBAAiB,GACjB,WAAW,GACX,iBAAiB,GACjB,SAAS,CAAC;AAEhB,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,aAAK,QAAQ,GAAG,QAAQ,EAAE,EAAE,GAAG,IAAI,GAAG,MAAM,CAAC;AAE7C,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,SAAS;IACtB,IAAI,EAAE,aAAa,CAAC;CACvB;AAED,oBAAY,eAAe,GACrB,KAAK,GACL,SAAS,GACT,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,OAAO,CAAC;AAEd,oBAAY,aAAa,GACnB,UAAU,GACV,OAAO,GACP,YAAY,GACZ,QAAQ,GACR,SAAS,CAAC;AAkEhB,iBAAS,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,EAAE,EAAE,CAUhE"}
...\ No newline at end of file ...\ No newline at end of file
1 -"use strict";
2 -Object.defineProperty(exports, "__esModule", { value: true });
3 -exports.default = parse;
4 -var reName = /^[^\\]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/;
5 -var reEscape = /\\([\da-f]{1,6}\s?|(\s)|.)/gi;
6 -// Modified version of https://github.com/jquery/sizzle/blob/master/src/sizzle.js#L87
7 -var reAttr = /^\s*((?:\\.|[\w\u00b0-\uFFFF-])+)\s*(?:(\S?)=\s*(?:(['"])((?:[^\\]|\\[^])*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF-])*)|)|)\s*(i)?\]/;
8 -var actionTypes = {
9 - undefined: "exists",
10 - "": "equals",
11 - "~": "element",
12 - "^": "start",
13 - $: "end",
14 - "*": "any",
15 - "!": "not",
16 - "|": "hyphen",
17 -};
18 -var Traversals = {
19 - ">": "child",
20 - "<": "parent",
21 - "~": "sibling",
22 - "+": "adjacent",
23 -};
24 -var attribSelectors = {
25 - "#": ["id", "equals"],
26 - ".": ["class", "element"],
27 -};
28 -// Pseudos, whose data property is parsed as well.
29 -var unpackPseudos = new Set([
30 - "has",
31 - "not",
32 - "matches",
33 - "is",
34 - "host",
35 - "host-context",
36 -]);
37 -var stripQuotesFromPseudos = new Set(["contains", "icontains"]);
38 -var quotes = new Set(['"', "'"]);
39 -// Unescape function taken from https://github.com/jquery/sizzle/blob/master/src/sizzle.js#L152
40 -function funescape(_, escaped, escapedWhitespace) {
41 - var high = parseInt(escaped, 16) - 0x10000;
42 - // NaN means non-codepoint
43 - return high !== high || escapedWhitespace
44 - ? escaped
45 - : high < 0
46 - ? // BMP codepoint
47 - String.fromCharCode(high + 0x10000)
48 - : // Supplemental Plane codepoint (surrogate pair)
49 - String.fromCharCode((high >> 10) | 0xd800, (high & 0x3ff) | 0xdc00);
50 -}
51 -function unescapeCSS(str) {
52 - return str.replace(reEscape, funescape);
53 -}
54 -function isWhitespace(c) {
55 - return c === " " || c === "\n" || c === "\t" || c === "\f" || c === "\r";
56 -}
57 -function parse(selector, options) {
58 - var subselects = [];
59 - selector = parseSelector(subselects, "" + selector, options);
60 - if (selector !== "") {
61 - throw new Error("Unmatched selector: " + selector);
62 - }
63 - return subselects;
64 -}
65 -function parseSelector(subselects, selector, options) {
66 - var _a, _b;
67 - if (options === void 0) { options = {}; }
68 - var tokens = [];
69 - var sawWS = false;
70 - function getName() {
71 - var match = selector.match(reName);
72 - if (!match) {
73 - throw new Error("Expected name, found " + selector);
74 - }
75 - var sub = match[0];
76 - selector = selector.substr(sub.length);
77 - return unescapeCSS(sub);
78 - }
79 - function stripWhitespace(start) {
80 - while (isWhitespace(selector.charAt(start)))
81 - start++;
82 - selector = selector.substr(start);
83 - }
84 - function isEscaped(pos) {
85 - var slashCount = 0;
86 - while (selector.charAt(--pos) === "\\")
87 - slashCount++;
88 - return (slashCount & 1) === 1;
89 - }
90 - stripWhitespace(0);
91 - while (selector !== "") {
92 - var firstChar = selector.charAt(0);
93 - if (isWhitespace(firstChar)) {
94 - sawWS = true;
95 - stripWhitespace(1);
96 - }
97 - else if (firstChar in Traversals) {
98 - tokens.push({ type: Traversals[firstChar] });
99 - sawWS = false;
100 - stripWhitespace(1);
101 - }
102 - else if (firstChar === ",") {
103 - if (tokens.length === 0) {
104 - throw new Error("Empty sub-selector");
105 - }
106 - subselects.push(tokens);
107 - tokens = [];
108 - sawWS = false;
109 - stripWhitespace(1);
110 - }
111 - else {
112 - if (sawWS) {
113 - if (tokens.length > 0) {
114 - tokens.push({ type: "descendant" });
115 - }
116 - sawWS = false;
117 - }
118 - if (firstChar === "*") {
119 - selector = selector.substr(1);
120 - tokens.push({ type: "universal" });
121 - }
122 - else if (firstChar in attribSelectors) {
123 - var _c = attribSelectors[firstChar], name_1 = _c[0], action = _c[1];
124 - selector = selector.substr(1);
125 - tokens.push({
126 - type: "attribute",
127 - name: name_1,
128 - action: action,
129 - value: getName(),
130 - ignoreCase: false,
131 - });
132 - }
133 - else if (firstChar === "[") {
134 - selector = selector.substr(1);
135 - var attributeMatch = selector.match(reAttr);
136 - if (!attributeMatch) {
137 - throw new Error("Malformed attribute selector: " + selector);
138 - }
139 - var completeSelector = attributeMatch[0], baseName = attributeMatch[1], actionType = attributeMatch[2], _d = attributeMatch[4], quotedValue = _d === void 0 ? "" : _d, _e = attributeMatch[5], value = _e === void 0 ? quotedValue : _e, ignoreCase = attributeMatch[6];
140 - selector = selector.substr(completeSelector.length);
141 - var name_2 = unescapeCSS(baseName);
142 - if ((_a = options.lowerCaseAttributeNames) !== null && _a !== void 0 ? _a : !options.xmlMode) {
143 - name_2 = name_2.toLowerCase();
144 - }
145 - tokens.push({
146 - type: "attribute",
147 - name: name_2,
148 - action: actionTypes[actionType],
149 - value: unescapeCSS(value),
150 - ignoreCase: !!ignoreCase,
151 - });
152 - }
153 - else if (firstChar === ":") {
154 - if (selector.charAt(1) === ":") {
155 - selector = selector.substr(2);
156 - tokens.push({
157 - type: "pseudo-element",
158 - name: getName().toLowerCase(),
159 - });
160 - continue;
161 - }
162 - selector = selector.substr(1);
163 - var name_3 = getName().toLowerCase();
164 - var data = null;
165 - if (selector.startsWith("(")) {
166 - if (unpackPseudos.has(name_3)) {
167 - var quot = selector.charAt(1);
168 - var quoted = quotes.has(quot);
169 - selector = selector.substr(quoted ? 2 : 1);
170 - data = [];
171 - selector = parseSelector(data, selector, options);
172 - if (quoted) {
173 - if (!selector.startsWith(quot)) {
174 - throw new Error("Unmatched quotes in :" + name_3);
175 - }
176 - else {
177 - selector = selector.substr(1);
178 - }
179 - }
180 - if (!selector.startsWith(")")) {
181 - throw new Error("Missing closing parenthesis in :" + name_3 + " (" + selector + ")");
182 - }
183 - selector = selector.substr(1);
184 - }
185 - else {
186 - var pos = 1;
187 - var counter = 1;
188 - for (; counter > 0 && pos < selector.length; pos++) {
189 - if (selector.charAt(pos) === "(" &&
190 - !isEscaped(pos)) {
191 - counter++;
192 - }
193 - else if (selector.charAt(pos) === ")" &&
194 - !isEscaped(pos)) {
195 - counter--;
196 - }
197 - }
198 - if (counter) {
199 - throw new Error("Parenthesis not matched");
200 - }
201 - data = selector.substr(1, pos - 2);
202 - selector = selector.substr(pos);
203 - if (stripQuotesFromPseudos.has(name_3)) {
204 - var quot = data.charAt(0);
205 - if (quot === data.slice(-1) && quotes.has(quot)) {
206 - data = data.slice(1, -1);
207 - }
208 - data = unescapeCSS(data);
209 - }
210 - }
211 - }
212 - tokens.push({ type: "pseudo", name: name_3, data: data });
213 - }
214 - else if (reName.test(selector)) {
215 - var name_4 = getName();
216 - if ((_b = options.lowerCaseTags) !== null && _b !== void 0 ? _b : !options.xmlMode) {
217 - name_4 = name_4.toLowerCase();
218 - }
219 - tokens.push({ type: "tag", name: name_4 });
220 - }
221 - else {
222 - if (tokens.length &&
223 - tokens[tokens.length - 1].type === "descendant") {
224 - tokens.pop();
225 - }
226 - addToken(subselects, tokens);
227 - return selector;
228 - }
229 - }
230 - }
231 - addToken(subselects, tokens);
232 - return selector;
233 -}
234 -function addToken(subselects, tokens) {
235 - if (subselects.length > 0 && tokens.length === 0) {
236 - throw new Error("Empty sub-selector");
237 - }
238 - subselects.push(tokens);
239 -}
1 -import { Selector } from "./parse";
2 -export default function stringify(token: Selector[][]): string;
3 -//# sourceMappingURL=stringify.d.ts.map
...\ No newline at end of file ...\ No newline at end of file
1 -{"version":3,"file":"stringify.d.ts","sourceRoot":"","sources":["../src/stringify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAuBnC,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,GAAG,MAAM,CAE7D"}
...\ No newline at end of file ...\ No newline at end of file
1 -"use strict";
2 -var __spreadArrays = (this && this.__spreadArrays) || function () {
3 - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
4 - for (var r = Array(s), k = 0, i = 0; i < il; i++)
5 - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
6 - r[k] = a[j];
7 - return r;
8 -};
9 -Object.defineProperty(exports, "__esModule", { value: true });
10 -var actionTypes = {
11 - equals: "",
12 - element: "~",
13 - start: "^",
14 - end: "$",
15 - any: "*",
16 - not: "!",
17 - hyphen: "|",
18 -};
19 -var charsToEscape = new Set(__spreadArrays(Object.keys(actionTypes)
20 - .map(function (typeKey) { return actionTypes[typeKey]; })
21 - .filter(Boolean), [
22 - ":",
23 - "[",
24 - "]",
25 - " ",
26 - "\\",
27 -]));
28 -function stringify(token) {
29 - return token.map(stringifySubselector).join(", ");
30 -}
31 -exports.default = stringify;
32 -function stringifySubselector(token) {
33 - return token.map(stringifyToken).join("");
34 -}
35 -function stringifyToken(token) {
36 - switch (token.type) {
37 - // Simple types
38 - case "child":
39 - return " > ";
40 - case "parent":
41 - return " < ";
42 - case "sibling":
43 - return " ~ ";
44 - case "adjacent":
45 - return " + ";
46 - case "descendant":
47 - return " ";
48 - case "universal":
49 - return "*";
50 - case "tag":
51 - return escapeName(token.name);
52 - case "pseudo-element":
53 - return "::" + escapeName(token.name);
54 - case "pseudo":
55 - if (token.data === null)
56 - return ":" + escapeName(token.name);
57 - if (typeof token.data === "string") {
58 - return ":" + escapeName(token.name) + "(" + token.data + ")";
59 - }
60 - return ":" + escapeName(token.name) + "(" + stringify(token.data) + ")";
61 - case "attribute":
62 - if (token.action === "exists") {
63 - return "[" + escapeName(token.name) + "]";
64 - }
65 - if (token.name === "id" &&
66 - token.action === "equals" &&
67 - !token.ignoreCase) {
68 - return "#" + escapeName(token.value);
69 - }
70 - if (token.name === "class" &&
71 - token.action === "element" &&
72 - !token.ignoreCase) {
73 - return "." + escapeName(token.value);
74 - }
75 - return "[" + escapeName(token.name) + actionTypes[token.action] + "='" + escapeName(token.value) + "'" + (token.ignoreCase ? "i" : "") + "]";
76 - }
77 -}
78 -function escapeName(str) {
79 - return str
80 - .split("")
81 - .map(function (c) { return (charsToEscape.has(c) ? "\\" + c : c); })
82 - .join("");
83 -}
1 -{
2 - "_from": "css-what@^3.2.1",
3 - "_id": "css-what@3.4.2",
4 - "_inBundle": false,
5 - "_integrity": "sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ==",
6 - "_location": "/css-what",
7 - "_phantomChildren": {},
8 - "_requested": {
9 - "type": "range",
10 - "registry": true,
11 - "raw": "css-what@^3.2.1",
12 - "name": "css-what",
13 - "escapedName": "css-what",
14 - "rawSpec": "^3.2.1",
15 - "saveSpec": null,
16 - "fetchSpec": "^3.2.1"
17 - },
18 - "_requiredBy": [
19 - "/css-select"
20 - ],
21 - "_resolved": "https://registry.npmjs.org/css-what/-/css-what-3.4.2.tgz",
22 - "_shasum": "ea7026fcb01777edbde52124e21f327e7ae950e4",
23 - "_spec": "css-what@^3.2.1",
24 - "_where": "C:\\Users\\kkwan_000\\Desktop\\git\\2017110269\\minsung\\node_modules\\css-select",
25 - "author": {
26 - "name": "Felix Böhm",
27 - "email": "me@feedic.com",
28 - "url": "http://feedic.com"
29 - },
30 - "bugs": {
31 - "url": "https://github.com/fb55/css-what/issues"
32 - },
33 - "bundleDependencies": false,
34 - "dependencies": {},
35 - "deprecated": false,
36 - "description": "a CSS selector parser",
37 - "devDependencies": {
38 - "@types/jest": "^26.0.3",
39 - "@types/node": "^14.0.5",
40 - "@typescript-eslint/eslint-plugin": "^4.1.0",
41 - "@typescript-eslint/parser": "^4.1.0",
42 - "coveralls": "^3.0.5",
43 - "eslint": "^7.0.0",
44 - "eslint-config-prettier": "^6.0.0",
45 - "eslint-plugin-node": "^11.1.0",
46 - "jest": "^26.0.1",
47 - "prettier": "^2.0.5",
48 - "ts-jest": "^26.0.0",
49 - "typescript": "^4.0.2"
50 - },
51 - "engines": {
52 - "node": ">= 6"
53 - },
54 - "files": [
55 - "lib/**/*"
56 - ],
57 - "funding": "https://github.com/sponsors/fb55",
58 - "homepage": "https://github.com/fb55/css-what#readme",
59 - "jest": {
60 - "preset": "ts-jest",
61 - "testEnvironment": "node"
62 - },
63 - "license": "BSD-2-Clause",
64 - "main": "lib/index.js",
65 - "name": "css-what",
66 - "optionalDependencies": {},
67 - "prettier": {
68 - "tabWidth": 4
69 - },
70 - "repository": {
71 - "url": "git+https://github.com/fb55/css-what.git"
72 - },
73 - "scripts": {
74 - "build": "tsc",
75 - "coverage": "cat coverage/lcov.info | coveralls",
76 - "format": "npm run format:es && npm run format:prettier",
77 - "format:es": "npm run lint:es -- --fix",
78 - "format:prettier": "npm run prettier -- --write",
79 - "lint": "npm run lint:es && npm run lint:prettier",
80 - "lint:es": "eslint src",
81 - "lint:prettier": "npm run prettier -- --check",
82 - "prepare": "npm run build",
83 - "prettier": "prettier '**/*.{ts,md,json,yml}'",
84 - "test": "jest --coverage -u && npm run lint"
85 - },
86 - "types": "lib/index.d.ts",
87 - "version": "3.4.2"
88 -}
1 -# css-what [![Build Status](https://secure.travis-ci.org/fb55/css-what.svg?branch=master)](http://travis-ci.org/fb55/css-what)
2 -
3 -a CSS selector parser
4 -
5 -## Example
6 -
7 -```js
8 -const CSSwhat = require("css-what")
9 -CSSwhat.parse("foo[bar]:baz")
10 -
11 -~> [
12 - [
13 - { type: "tag", name: "foo" },
14 - {
15 - type: "attribute",
16 - name: "bar",
17 - action: "exists",
18 - value: "",
19 - ignoreCase: false
20 - },
21 - { type: "pseudo", name: "baz", data: null }
22 - ]
23 -]
24 -```
25 -
26 -## API
27 -
28 -**`CSSwhat.parse(str, options)` - Parses `str`, optionally with the passed `options`.**
29 -
30 -The function returns a two-dimensional array. The first array represents selectors separated by commas (eg. `sub1, sub2`), the second contains the relevant tokens for that selector. Possible token types are:
31 -
32 -| name | attributes | example | output |
33 -| ---------------- | --------------------------------------- | ------------- | ---------------------------------------------------------------------------------------- |
34 -| `tag` | `name` | `div` | `{ type: 'tag', name: 'div' }` |
35 -| `universal` | - | `*` | `{ type: 'universal' }` |
36 -| `pseudo` | `name`, `data` | `:name(data)` | `{ type: 'pseudo', name: 'name', data: 'data' }` |
37 -| `pseudo` | `name`, `data` | `:name` | `{ type: 'pseudo', name: 'name', data: null }` |
38 -| `pseudo-element` | `name` | `::name` | `{ type: 'pseudo-element', name: 'name' }` |
39 -| `attribute` | `name`, `action`, `value`, `ignoreCase` | `[attr]` | `{ type: 'attribute', name: 'attr', action: 'exists', value: '', ignoreCase: false }` |
40 -| `attribute` | `name`, `action`, `value`, `ignoreCase` | `[attr=val]` | `{ type: 'attribute', name: 'attr', action: 'equals', value: 'val', ignoreCase: false }` |
41 -| `attribute` | `name`, `action`, `value`, `ignoreCase` | `[attr^=val]` | `{ type: 'attribute', name: 'attr', action: 'start', value: 'val', ignoreCase: false }` |
42 -| `attribute` | `name`, `action`, `value`, `ignoreCase` | `[attr$=val]` | `{ type: 'attribute', name: 'attr', action: 'end', value: 'val', ignoreCase: false }` |
43 -| `child` | - | `>` | `{ type: 'child' }` |
44 -| `parent` | - | `<` | `{ type: 'parent' }` |
45 -| `sibling` | - | `~` | `{ type: 'sibling' }` |
46 -| `adjacent` | - | `+` | `{ type: 'adjacent' }` |
47 -| `descendant` | - | | `{ type: 'descendant' }` |
48 -
49 -**Options:**
50 -
51 -- `lowerCaseTags`: When false, tag names will not be lowercased. Defaults to `true`.
52 -- `lowerCaseAttributeNames`: When false, attribute names will not be lowercased. Defaults to `true`.
53 -- `xmlMode`: When `true`, `xmlMode` implies both `lowerCaseTags` and `lowerCaseAttributeNames` are set to `false`.
54 -
55 -**`CSSwhat.stringify(selector)` - Turns `selector` back into a string.**
56 -
57 ----
58 -
59 -License: BSD-2-Clause
60 -
61 -## Security contact information
62 -
63 -To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).
64 -Tidelift will coordinate the fix and disclosure.
65 -
66 -## `css-what` for enterprise
67 -
68 -Available as part of the Tidelift Subscription
69 -
70 -The maintainers of `css-what` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-css-what?utm_source=npm-css-what&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
1 -Copyright Mathias Bynens <https://mathiasbynens.be/>
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.
1 -# `CSS.escape` polyfill [![Build status](https://travis-ci.org/mathiasbynens/CSS.escape.svg?branch=master)](https://travis-ci.org/mathiasbynens/CSS.escape) [![Code coverage status](http://img.shields.io/coveralls/mathiasbynens/CSS.escape/master.svg)](https://coveralls.io/r/mathiasbynens/CSS.escape)
2 -
3 -A robust polyfill for [the `CSS.escape` utility method as defined in CSSOM](https://drafts.csswg.org/cssom/#the-css.escape%28%29-method).
4 -
5 -For a more powerful alternative, consider using [cssesc](https://mths.be/cssesc), which automatically takes care of excessive whitespace, and has many options to customize the output.
6 -
7 -## Installation
8 -
9 -In a browser:
10 -
11 -```html
12 -<script src="css.escape.js"></script>
13 -```
14 -
15 -Via [npm](https://www.npmjs.com/):
16 -
17 -```bash
18 -npm install css.escape
19 -```
20 -
21 -Then, in [Node.js](https://nodejs.org/):
22 -
23 -```js
24 -require('css.escape');
25 -
26 -// On Windows and on Mac systems with default settings, case doesn’t matter,
27 -// which allows you to do this instead:
28 -require('CSS.escape');
29 -```
30 -
31 -## Author
32 -
33 -| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
34 -|---|
35 -| [Mathias Bynens](https://mathiasbynens.be/) |
36 -
37 -## License
38 -
39 -This polyfill is available under the [MIT](https://mths.be/mit) license.
1 -/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
2 -;(function(root, factory) {
3 - // https://github.com/umdjs/umd/blob/master/returnExports.js
4 - if (typeof exports == 'object') {
5 - // For Node.js.
6 - module.exports = factory(root);
7 - } else if (typeof define == 'function' && define.amd) {
8 - // For AMD. Register as an anonymous module.
9 - define([], factory.bind(root, root));
10 - } else {
11 - // For browser globals (not exposing the function separately).
12 - factory(root);
13 - }
14 -}(typeof global != 'undefined' ? global : this, function(root) {
15 -
16 - if (root.CSS && root.CSS.escape) {
17 - return root.CSS.escape;
18 - }
19 -
20 - // https://drafts.csswg.org/cssom/#serialize-an-identifier
21 - var cssEscape = function(value) {
22 - if (arguments.length == 0) {
23 - throw new TypeError('`CSS.escape` requires an argument.');
24 - }
25 - var string = String(value);
26 - var length = string.length;
27 - var index = -1;
28 - var codeUnit;
29 - var result = '';
30 - var firstCodeUnit = string.charCodeAt(0);
31 - while (++index < length) {
32 - codeUnit = string.charCodeAt(index);
33 - // Note: there’s no need to special-case astral symbols, surrogate
34 - // pairs, or lone surrogates.
35 -
36 - // If the character is NULL (U+0000), then the REPLACEMENT CHARACTER
37 - // (U+FFFD).
38 - if (codeUnit == 0x0000) {
39 - result += '\uFFFD';
40 - continue;
41 - }
42 -
43 - if (
44 - // If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
45 - // U+007F, […]
46 - (codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F ||
47 - // If the character is the first character and is in the range [0-9]
48 - // (U+0030 to U+0039), […]
49 - (index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||
50 - // If the character is the second character and is in the range [0-9]
51 - // (U+0030 to U+0039) and the first character is a `-` (U+002D), […]
52 - (
53 - index == 1 &&
54 - codeUnit >= 0x0030 && codeUnit <= 0x0039 &&
55 - firstCodeUnit == 0x002D
56 - )
57 - ) {
58 - // https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
59 - result += '\\' + codeUnit.toString(16) + ' ';
60 - continue;
61 - }
62 -
63 - if (
64 - // If the character is the first character and is a `-` (U+002D), and
65 - // there is no second character, […]
66 - index == 0 &&
67 - length == 1 &&
68 - codeUnit == 0x002D
69 - ) {
70 - result += '\\' + string.charAt(index);
71 - continue;
72 - }
73 -
74 - // If the character is not handled by one of the above rules and is
75 - // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or
76 - // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to
77 - // U+005A), or [a-z] (U+0061 to U+007A), […]
78 - if (
79 - codeUnit >= 0x0080 ||
80 - codeUnit == 0x002D ||
81 - codeUnit == 0x005F ||
82 - codeUnit >= 0x0030 && codeUnit <= 0x0039 ||
83 - codeUnit >= 0x0041 && codeUnit <= 0x005A ||
84 - codeUnit >= 0x0061 && codeUnit <= 0x007A
85 - ) {
86 - // the character itself
87 - result += string.charAt(index);
88 - continue;
89 - }
90 -
91 - // Otherwise, the escaped character.
92 - // https://drafts.csswg.org/cssom/#escape-a-character
93 - result += '\\' + string.charAt(index);
94 -
95 - }
96 - return result;
97 - };
98 -
99 - if (!root.CSS) {
100 - root.CSS = {};
101 - }
102 -
103 - root.CSS.escape = cssEscape;
104 - return cssEscape;
105 -
106 -}));
1 -{
2 - "_from": "css.escape@^1.5.1",
3 - "_id": "css.escape@1.5.1",
4 - "_inBundle": false,
5 - "_integrity": "sha1-QuJ9T6BK4y+TGktNQZH6nN3ul8s=",
6 - "_location": "/css.escape",
7 - "_phantomChildren": {},
8 - "_requested": {
9 - "type": "range",
10 - "registry": true,
11 - "raw": "css.escape@^1.5.1",
12 - "name": "css.escape",
13 - "escapedName": "css.escape",
14 - "rawSpec": "^1.5.1",
15 - "saveSpec": null,
16 - "fetchSpec": "^1.5.1"
17 - },
18 - "_requiredBy": [
19 - "/@testing-library/jest-dom"
20 - ],
21 - "_resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz",
22 - "_shasum": "42e27d4fa04ae32f931a4b4d4191fa9cddee97cb",
23 - "_spec": "css.escape@^1.5.1",
24 - "_where": "C:\\Users\\kkwan_000\\Desktop\\git\\2017110269\\minsung\\node_modules\\@testing-library\\jest-dom",
25 - "author": {
26 - "name": "Mathias Bynens",
27 - "url": "https://mathiasbynens.be/"
28 - },
29 - "bugs": {
30 - "url": "https://github.com/mathiasbynens/CSS.escape/issues"
31 - },
32 - "bundleDependencies": false,
33 - "deprecated": false,
34 - "description": "A robust polyfill for the `CSS.escape` utility method as defined in CSSOM.",
35 - "devDependencies": {
36 - "coveralls": "^2.11.4",
37 - "istanbul": "^0.4.1"
38 - },
39 - "files": [
40 - "LICENSE-MIT.txt",
41 - "css.escape.js"
42 - ],
43 - "homepage": "https://mths.be/cssescape",
44 - "keywords": [
45 - "string",
46 - "unicode",
47 - "identifier",
48 - "css",
49 - "cssom",
50 - "polyfill"
51 - ],
52 - "license": "MIT",
53 - "main": "css.escape.js",
54 - "name": "css.escape",
55 - "repository": {
56 - "type": "git",
57 - "url": "git+https://github.com/mathiasbynens/CSS.escape.git"
58 - },
59 - "scripts": {
60 - "cover": "istanbul cover --report html --verbose --dir coverage tests/tests.js",
61 - "coveralls": "istanbul cover --verbose --dir coverage tests/tests.js && coveralls < coverage/lcov.info; rm -rf coverage/lcov*",
62 - "test": "node tests/tests.js"
63 - },
64 - "version": "1.5.1"
65 -}
1 -2.2.1 / 2015-06-17
2 -==================
3 -
4 - * fix parsing escaped quotes in quoted strings
5 -
6 -2.2.0 / 2015-02-18
7 -==================
8 -
9 - * add `parsingErrors` to list errors when parsing with `silent: true`
10 - * accept EOL characters and all other whitespace characters in `@` rules such
11 - as `@media`
12 -
13 -2.1.0 / 2014-08-05
14 -==================
15 -
16 - * change error message format and add `.reason` property to errors
17 - * add `inputSourcemaps` option to disable input source map processing
18 - * use `inherits` for inheritance (fixes some browsers)
19 - * add `sourcemap: 'generator'` option to return the `SourceMapGenerator`
20 - object
21 -
22 -2.0.0 / 2014-06-18
23 -==================
24 -
25 - * add non-enumerable parent reference to each node
26 - * drop Component(1) support
27 - * add support for @custom-media, @host, and @font-face
28 - * allow commas inside selector functions
29 - * allow empty property values
30 - * changed default options.position value to true
31 - * remove comments from properties and values
32 - * asserts when selectors are missing
33 - * added node.position.content property
34 - * absorb css-parse and css-stringify libraries
35 - * apply original source maps from source files
36 -
37 -1.6.1 / 2014-01-02
38 -==================
39 -
40 - * fix component.json
41 -
42 -1.6.0 / 2013-12-21
43 -==================
44 -
45 - * update deps
46 -
47 -1.5.0 / 2013-12-03
48 -==================
49 -
50 - * update deps
51 -
52 -1.1.0 / 2013-04-04
53 -==================
54 -
55 - * update deps
56 -
57 -1.0.7 / 2012-11-21
58 -==================
59 -
60 - * fix component.json
61 -
62 -1.0.4 / 2012-11-15
63 -==================
64 -
65 - * update css-stringify
66 -
67 -1.0.3 / 2012-09-01
68 -==================
69 -
70 - * add component support
71 -
72 -0.0.1 / 2010-01-03
73 -==================
74 -
75 - * Initial release
1 -(The MIT License)
2 -
3 -Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>
4 -
5 -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 -
7 -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 -
9 -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1 -# css [![Build Status](https://travis-ci.org/reworkcss/css.svg?branch=master)](https://travis-ci.org/reworkcss/css)
2 -
3 -CSS parser / stringifier.
4 -
5 -## Installation
6 -
7 - $ npm install css
8 -
9 -## Usage
10 -
11 -```js
12 -var css = require('css');
13 -var obj = css.parse('body { font-size: 12px; }', options);
14 -css.stringify(obj, options);
15 -```
16 -
17 -## API
18 -
19 -### css.parse(code, [options])
20 -
21 -Accepts a CSS string and returns an AST `object`.
22 -
23 -`options`:
24 -
25 -- silent: silently fail on parse errors.
26 -- source: the path to the file containing `css`. Makes errors and source
27 - maps more helpful, by letting them know where code comes from.
28 -
29 -### css.stringify(object, [options])
30 -
31 -Accepts an AST `object` (as `css.parse` produces) and returns a CSS string.
32 -
33 -`options`:
34 -
35 -- indent: the string used to indent the output. Defaults to two spaces.
36 -- compress: omit comments and extraneous whitespace.
37 -- sourcemap: return a sourcemap along with the CSS output. Using the `source`
38 - option of `css.parse` is strongly recommended when creating a source map.
39 - Specify `sourcemap: 'generator'` to return the SourceMapGenerator object
40 - instead of serializing the source map.
41 -- inputSourcemaps: (enabled by default, specify `false` to disable) reads any
42 - source maps referenced by the input files when generating the output source
43 - map. When enabled, file system access may be required for reading the
44 - referenced source maps.
45 -
46 -### Example
47 -
48 -```js
49 -var ast = css.parse('body { font-size: 12px; }', { source: 'source.css' });
50 -
51 -var css = css.stringify(ast);
52 -
53 -var result = css.stringify(ast, { sourcemap: true });
54 -result.code // string with CSS
55 -result.map // source map object
56 -```
57 -
58 -### Errors
59 -
60 -Errors thrown during parsing have the following properties:
61 -
62 -- message: `String`. The full error message with the source position.
63 -- reason: `String`. The error message without position.
64 -- filename: `String` or `undefined`. The value of `options.source` if
65 - passed to `css.parse`. Otherwise `undefined`.
66 -- line: `Integer`.
67 -- column: `Integer`.
68 -- source: `String`. The portion of code that couldn't be parsed.
69 -
70 -When parsing with the `silent` option, errors are listed in the
71 -`parsingErrors` property of the [`stylesheet`](#stylesheet) node instead
72 -of being thrown.
73 -
74 -If you create any errors in plugins such as in
75 -[rework](https://github.com/reworkcss/rework), you __must__ set the same
76 -properties for consistency.
77 -
78 -## AST
79 -
80 -Interactively explore the AST with <http://iamdustan.com/reworkcss_ast_explorer/>.
81 -
82 -### Common properties
83 -
84 -All nodes have the following properties.
85 -
86 -#### position
87 -
88 -Information about the position in the source string that corresponds to
89 -the node.
90 -
91 -`Object`:
92 -
93 -- start: `Object`:
94 - - line: `Number`.
95 - - column: `Number`.
96 -- end: `Object`:
97 - - line: `Number`.
98 - - column: `Number`.
99 -- source: `String` or `undefined`. The value of `options.source` if passed to
100 - `css.parse`. Otherwise `undefined`.
101 -- content: `String`. The full source string passed to `css.parse`.
102 -
103 -The line and column numbers are 1-based: The first line is 1 and the first
104 -column of a line is 1 (not 0).
105 -
106 -The `position` property lets you know from which source file the node comes
107 -from (if available), what that file contains, and what part of that file was
108 -parsed into the node.
109 -
110 -#### type
111 -
112 -`String`. The possible values are the ones listed in the Types section below.
113 -
114 -#### parent
115 -
116 -A reference to the parent node, or `null` if the node has no parent.
117 -
118 -### Types
119 -
120 -The available values of `node.type` are listed below, as well as the available
121 -properties of each node (other than the common properties listed above.)
122 -
123 -#### stylesheet
124 -
125 -The root node returned by `css.parse`.
126 -
127 -- stylesheet: `Object`:
128 - - rules: `Array` of nodes with the types `rule`, `comment` and any of the
129 - at-rule types.
130 - - parsingErrors: `Array` of `Error`s. Errors collected during parsing when
131 - option `silent` is true.
132 -
133 -#### rule
134 -
135 -- selectors: `Array` of `String`s. The list of selectors of the rule, split
136 - on commas. Each selector is trimmed from whitespace and comments.
137 -- declarations: `Array` of nodes with the types `declaration` and `comment`.
138 -
139 -#### declaration
140 -
141 -- property: `String`. The property name, trimmed from whitespace and
142 - comments. May not be empty.
143 -- value: `String`. The value of the property, trimmed from whitespace and
144 - comments. Empty values are allowed.
145 -
146 -#### comment
147 -
148 -A rule-level or declaration-level comment. Comments inside selectors,
149 -properties and values etc. are lost.
150 -
151 -- comment: `String`. The part between the starting `/*` and the ending `*/`
152 - of the comment, including whitespace.
153 -
154 -#### charset
155 -
156 -The `@charset` at-rule.
157 -
158 -- charset: `String`. The part following `@charset `.
159 -
160 -#### custom-media
161 -
162 -The `@custom-media` at-rule.
163 -
164 -- name: `String`. The `--`-prefixed name.
165 -- media: `String`. The part following the name.
166 -
167 -#### document
168 -
169 -The `@document` at-rule.
170 -
171 -- document: `String`. The part following `@document `.
172 -- vendor: `String` or `undefined`. The vendor prefix in `@document`, or
173 - `undefined` if there is none.
174 -- rules: `Array` of nodes with the types `rule`, `comment` and any of the
175 - at-rule types.
176 -
177 -#### font-face
178 -
179 -The `@font-face` at-rule.
180 -
181 -- declarations: `Array` of nodes with the types `declaration` and `comment`.
182 -
183 -#### host
184 -
185 -The `@host` at-rule.
186 -
187 -- rules: `Array` of nodes with the types `rule`, `comment` and any of the
188 - at-rule types.
189 -
190 -#### import
191 -
192 -The `@import` at-rule.
193 -
194 -- import: `String`. The part following `@import `.
195 -
196 -#### keyframes
197 -
198 -The `@keyframes` at-rule.
199 -
200 -- name: `String`. The name of the keyframes rule.
201 -- vendor: `String` or `undefined`. The vendor prefix in `@keyframes`, or
202 - `undefined` if there is none.
203 -- keyframes: `Array` of nodes with the types `keyframe` and `comment`.
204 -
205 -#### keyframe
206 -
207 -- values: `Array` of `String`s. The list of “selectors” of the keyframe rule,
208 - split on commas. Each “selector” is trimmed from whitespace.
209 -- declarations: `Array` of nodes with the types `declaration` and `comment`.
210 -
211 -#### media
212 -
213 -The `@media` at-rule.
214 -
215 -- media: `String`. The part following `@media `.
216 -- rules: `Array` of nodes with the types `rule`, `comment` and any of the
217 - at-rule types.
218 -
219 -#### namespace
220 -
221 -The `@namespace` at-rule.
222 -
223 -- namespace: `String`. The part following `@namespace `.
224 -
225 -#### page
226 -
227 -The `@page` at-rule.
228 -
229 -- selectors: `Array` of `String`s. The list of selectors of the rule, split
230 - on commas. Each selector is trimmed from whitespace and comments.
231 -- declarations: `Array` of nodes with the types `declaration` and `comment`.
232 -
233 -#### supports
234 -
235 -The `@supports` at-rule.
236 -
237 -- supports: `String`. The part following `@supports `.
238 -- rules: `Array` of nodes with the types `rule`, `comment` and any of the
239 - at-rule types.
240 -
241 -### Example
242 -
243 -CSS:
244 -
245 -```css
246 -body {
247 - background: #eee;
248 - color: #888;
249 -}
250 -```
251 -
252 -Parse tree:
253 -
254 -```json
255 -{
256 - "type": "stylesheet",
257 - "stylesheet": {
258 - "rules": [
259 - {
260 - "type": "rule",
261 - "selectors": [
262 - "body"
263 - ],
264 - "declarations": [
265 - {
266 - "type": "declaration",
267 - "property": "background",
268 - "value": "#eee",
269 - "position": {
270 - "start": {
271 - "line": 2,
272 - "column": 3
273 - },
274 - "end": {
275 - "line": 2,
276 - "column": 19
277 - }
278 - }
279 - },
280 - {
281 - "type": "declaration",
282 - "property": "color",
283 - "value": "#888",
284 - "position": {
285 - "start": {
286 - "line": 3,
287 - "column": 3
288 - },
289 - "end": {
290 - "line": 3,
291 - "column": 14
292 - }
293 - }
294 - }
295 - ],
296 - "position": {
297 - "start": {
298 - "line": 1,
299 - "column": 1
300 - },
301 - "end": {
302 - "line": 4,
303 - "column": 2
304 - }
305 - }
306 - }
307 - ]
308 - }
309 -}
310 -```
311 -
312 -## License
313 -
314 -MIT
1 -exports.parse = require('./lib/parse');
2 -exports.stringify = require('./lib/stringify');
This diff is collapsed. Click to expand it.
1 -
2 -/**
3 - * Expose `Compiler`.
4 - */
5 -
6 -module.exports = Compiler;
7 -
8 -/**
9 - * Initialize a compiler.
10 - *
11 - * @param {Type} name
12 - * @return {Type}
13 - * @api public
14 - */
15 -
16 -function Compiler(opts) {
17 - this.options = opts || {};
18 -}
19 -
20 -/**
21 - * Emit `str`
22 - */
23 -
24 -Compiler.prototype.emit = function(str) {
25 - return str;
26 -};
27 -
28 -/**
29 - * Visit `node`.
30 - */
31 -
32 -Compiler.prototype.visit = function(node){
33 - return this[node.type](node);
34 -};
35 -
36 -/**
37 - * Map visit over array of `nodes`, optionally using a `delim`
38 - */
39 -
40 -Compiler.prototype.mapVisit = function(nodes, delim){
41 - var buf = '';
42 - delim = delim || '';
43 -
44 - for (var i = 0, length = nodes.length; i < length; i++) {
45 - buf += this.visit(nodes[i]);
46 - if (delim && i < length - 1) buf += this.emit(delim);
47 - }
48 -
49 - return buf;
50 -};
1 -
2 -/**
3 - * Module dependencies.
4 - */
5 -
6 -var Base = require('./compiler');
7 -var inherits = require('inherits');
8 -
9 -/**
10 - * Expose compiler.
11 - */
12 -
13 -module.exports = Compiler;
14 -
15 -/**
16 - * Initialize a new `Compiler`.
17 - */
18 -
19 -function Compiler(options) {
20 - Base.call(this, options);
21 -}
22 -
23 -/**
24 - * Inherit from `Base.prototype`.
25 - */
26 -
27 -inherits(Compiler, Base);
28 -
29 -/**
30 - * Compile `node`.
31 - */
32 -
33 -Compiler.prototype.compile = function(node){
34 - return node.stylesheet
35 - .rules.map(this.visit, this)
36 - .join('');
37 -};
38 -
39 -/**
40 - * Visit comment node.
41 - */
42 -
43 -Compiler.prototype.comment = function(node){
44 - return this.emit('', node.position);
45 -};
46 -
47 -/**
48 - * Visit import node.
49 - */
50 -
51 -Compiler.prototype.import = function(node){
52 - return this.emit('@import ' + node.import + ';', node.position);
53 -};
54 -
55 -/**
56 - * Visit media node.
57 - */
58 -
59 -Compiler.prototype.media = function(node){
60 - return this.emit('@media ' + node.media, node.position)
61 - + this.emit('{')
62 - + this.mapVisit(node.rules)
63 - + this.emit('}');
64 -};
65 -
66 -/**
67 - * Visit document node.
68 - */
69 -
70 -Compiler.prototype.document = function(node){
71 - var doc = '@' + (node.vendor || '') + 'document ' + node.document;
72 -
73 - return this.emit(doc, node.position)
74 - + this.emit('{')
75 - + this.mapVisit(node.rules)
76 - + this.emit('}');
77 -};
78 -
79 -/**
80 - * Visit charset node.
81 - */
82 -
83 -Compiler.prototype.charset = function(node){
84 - return this.emit('@charset ' + node.charset + ';', node.position);
85 -};
86 -
87 -/**
88 - * Visit namespace node.
89 - */
90 -
91 -Compiler.prototype.namespace = function(node){
92 - return this.emit('@namespace ' + node.namespace + ';', node.position);
93 -};
94 -
95 -/**
96 - * Visit supports node.
97 - */
98 -
99 -Compiler.prototype.supports = function(node){
100 - return this.emit('@supports ' + node.supports, node.position)
101 - + this.emit('{')
102 - + this.mapVisit(node.rules)
103 - + this.emit('}');
104 -};
105 -
106 -/**
107 - * Visit keyframes node.
108 - */
109 -
110 -Compiler.prototype.keyframes = function(node){
111 - return this.emit('@'
112 - + (node.vendor || '')
113 - + 'keyframes '
114 - + node.name, node.position)
115 - + this.emit('{')
116 - + this.mapVisit(node.keyframes)
117 - + this.emit('}');
118 -};
119 -
120 -/**
121 - * Visit keyframe node.
122 - */
123 -
124 -Compiler.prototype.keyframe = function(node){
125 - var decls = node.declarations;
126 -
127 - return this.emit(node.values.join(','), node.position)
128 - + this.emit('{')
129 - + this.mapVisit(decls)
130 - + this.emit('}');
131 -};
132 -
133 -/**
134 - * Visit page node.
135 - */
136 -
137 -Compiler.prototype.page = function(node){
138 - var sel = node.selectors.length
139 - ? node.selectors.join(', ')
140 - : '';
141 -
142 - return this.emit('@page ' + sel, node.position)
143 - + this.emit('{')
144 - + this.mapVisit(node.declarations)
145 - + this.emit('}');
146 -};
147 -
148 -/**
149 - * Visit font-face node.
150 - */
151 -
152 -Compiler.prototype['font-face'] = function(node){
153 - return this.emit('@font-face', node.position)
154 - + this.emit('{')
155 - + this.mapVisit(node.declarations)
156 - + this.emit('}');
157 -};
158 -
159 -/**
160 - * Visit host node.
161 - */
162 -
163 -Compiler.prototype.host = function(node){
164 - return this.emit('@host', node.position)
165 - + this.emit('{')
166 - + this.mapVisit(node.rules)
167 - + this.emit('}');
168 -};
169 -
170 -/**
171 - * Visit custom-media node.
172 - */
173 -
174 -Compiler.prototype['custom-media'] = function(node){
175 - return this.emit('@custom-media ' + node.name + ' ' + node.media + ';', node.position);
176 -};
177 -
178 -/**
179 - * Visit rule node.
180 - */
181 -
182 -Compiler.prototype.rule = function(node){
183 - var decls = node.declarations;
184 - if (!decls.length) return '';
185 -
186 - return this.emit(node.selectors.join(','), node.position)
187 - + this.emit('{')
188 - + this.mapVisit(decls)
189 - + this.emit('}');
190 -};
191 -
192 -/**
193 - * Visit declaration node.
194 - */
195 -
196 -Compiler.prototype.declaration = function(node){
197 - return this.emit(node.property + ':' + node.value, node.position) + this.emit(';');
198 -};
199 -
1 -
2 -/**
3 - * Module dependencies.
4 - */
5 -
6 -var Base = require('./compiler');
7 -var inherits = require('inherits');
8 -
9 -/**
10 - * Expose compiler.
11 - */
12 -
13 -module.exports = Compiler;
14 -
15 -/**
16 - * Initialize a new `Compiler`.
17 - */
18 -
19 -function Compiler(options) {
20 - options = options || {};
21 - Base.call(this, options);
22 - this.indentation = options.indent;
23 -}
24 -
25 -/**
26 - * Inherit from `Base.prototype`.
27 - */
28 -
29 -inherits(Compiler, Base);
30 -
31 -/**
32 - * Compile `node`.
33 - */
34 -
35 -Compiler.prototype.compile = function(node){
36 - return this.stylesheet(node);
37 -};
38 -
39 -/**
40 - * Visit stylesheet node.
41 - */
42 -
43 -Compiler.prototype.stylesheet = function(node){
44 - return this.mapVisit(node.stylesheet.rules, '\n\n');
45 -};
46 -
47 -/**
48 - * Visit comment node.
49 - */
50 -
51 -Compiler.prototype.comment = function(node){
52 - return this.emit(this.indent() + '/*' + node.comment + '*/', node.position);
53 -};
54 -
55 -/**
56 - * Visit import node.
57 - */
58 -
59 -Compiler.prototype.import = function(node){
60 - return this.emit('@import ' + node.import + ';', node.position);
61 -};
62 -
63 -/**
64 - * Visit media node.
65 - */
66 -
67 -Compiler.prototype.media = function(node){
68 - return this.emit('@media ' + node.media, node.position)
69 - + this.emit(
70 - ' {\n'
71 - + this.indent(1))
72 - + this.mapVisit(node.rules, '\n\n')
73 - + this.emit(
74 - this.indent(-1)
75 - + '\n}');
76 -};
77 -
78 -/**
79 - * Visit document node.
80 - */
81 -
82 -Compiler.prototype.document = function(node){
83 - var doc = '@' + (node.vendor || '') + 'document ' + node.document;
84 -
85 - return this.emit(doc, node.position)
86 - + this.emit(
87 - ' '
88 - + ' {\n'
89 - + this.indent(1))
90 - + this.mapVisit(node.rules, '\n\n')
91 - + this.emit(
92 - this.indent(-1)
93 - + '\n}');
94 -};
95 -
96 -/**
97 - * Visit charset node.
98 - */
99 -
100 -Compiler.prototype.charset = function(node){
101 - return this.emit('@charset ' + node.charset + ';', node.position);
102 -};
103 -
104 -/**
105 - * Visit namespace node.
106 - */
107 -
108 -Compiler.prototype.namespace = function(node){
109 - return this.emit('@namespace ' + node.namespace + ';', node.position);
110 -};
111 -
112 -/**
113 - * Visit supports node.
114 - */
115 -
116 -Compiler.prototype.supports = function(node){
117 - return this.emit('@supports ' + node.supports, node.position)
118 - + this.emit(
119 - ' {\n'
120 - + this.indent(1))
121 - + this.mapVisit(node.rules, '\n\n')
122 - + this.emit(
123 - this.indent(-1)
124 - + '\n}');
125 -};
126 -
127 -/**
128 - * Visit keyframes node.
129 - */
130 -
131 -Compiler.prototype.keyframes = function(node){
132 - return this.emit('@' + (node.vendor || '') + 'keyframes ' + node.name, node.position)
133 - + this.emit(
134 - ' {\n'
135 - + this.indent(1))
136 - + this.mapVisit(node.keyframes, '\n')
137 - + this.emit(
138 - this.indent(-1)
139 - + '}');
140 -};
141 -
142 -/**
143 - * Visit keyframe node.
144 - */
145 -
146 -Compiler.prototype.keyframe = function(node){
147 - var decls = node.declarations;
148 -
149 - return this.emit(this.indent())
150 - + this.emit(node.values.join(', '), node.position)
151 - + this.emit(
152 - ' {\n'
153 - + this.indent(1))
154 - + this.mapVisit(decls, '\n')
155 - + this.emit(
156 - this.indent(-1)
157 - + '\n'
158 - + this.indent() + '}\n');
159 -};
160 -
161 -/**
162 - * Visit page node.
163 - */
164 -
165 -Compiler.prototype.page = function(node){
166 - var sel = node.selectors.length
167 - ? node.selectors.join(', ') + ' '
168 - : '';
169 -
170 - return this.emit('@page ' + sel, node.position)
171 - + this.emit('{\n')
172 - + this.emit(this.indent(1))
173 - + this.mapVisit(node.declarations, '\n')
174 - + this.emit(this.indent(-1))
175 - + this.emit('\n}');
176 -};
177 -
178 -/**
179 - * Visit font-face node.
180 - */
181 -
182 -Compiler.prototype['font-face'] = function(node){
183 - return this.emit('@font-face ', node.position)
184 - + this.emit('{\n')
185 - + this.emit(this.indent(1))
186 - + this.mapVisit(node.declarations, '\n')
187 - + this.emit(this.indent(-1))
188 - + this.emit('\n}');
189 -};
190 -
191 -/**
192 - * Visit host node.
193 - */
194 -
195 -Compiler.prototype.host = function(node){
196 - return this.emit('@host', node.position)
197 - + this.emit(
198 - ' {\n'
199 - + this.indent(1))
200 - + this.mapVisit(node.rules, '\n\n')
201 - + this.emit(
202 - this.indent(-1)
203 - + '\n}');
204 -};
205 -
206 -/**
207 - * Visit custom-media node.
208 - */
209 -
210 -Compiler.prototype['custom-media'] = function(node){
211 - return this.emit('@custom-media ' + node.name + ' ' + node.media + ';', node.position);
212 -};
213 -
214 -/**
215 - * Visit rule node.
216 - */
217 -
218 -Compiler.prototype.rule = function(node){
219 - var indent = this.indent();
220 - var decls = node.declarations;
221 - if (!decls.length) return '';
222 -
223 - return this.emit(node.selectors.map(function(s){ return indent + s }).join(',\n'), node.position)
224 - + this.emit(' {\n')
225 - + this.emit(this.indent(1))
226 - + this.mapVisit(decls, '\n')
227 - + this.emit(this.indent(-1))
228 - + this.emit('\n' + this.indent() + '}');
229 -};
230 -
231 -/**
232 - * Visit declaration node.
233 - */
234 -
235 -Compiler.prototype.declaration = function(node){
236 - return this.emit(this.indent())
237 - + this.emit(node.property + ': ' + node.value, node.position)
238 - + this.emit(';');
239 -};
240 -
241 -/**
242 - * Increase, decrease or return current indentation.
243 - */
244 -
245 -Compiler.prototype.indent = function(level) {
246 - this.level = this.level || 1;
247 -
248 - if (null != level) {
249 - this.level += level;
250 - return '';
251 - }
252 -
253 - return Array(this.level).join(this.indentation || ' ');
254 -};
1 -
2 -/**
3 - * Module dependencies.
4 - */
5 -
6 -var Compressed = require('./compress');
7 -var Identity = require('./identity');
8 -
9 -/**
10 - * Stringfy the given AST `node`.
11 - *
12 - * Options:
13 - *
14 - * - `compress` space-optimized output
15 - * - `sourcemap` return an object with `.code` and `.map`
16 - *
17 - * @param {Object} node
18 - * @param {Object} [options]
19 - * @return {String}
20 - * @api public
21 - */
22 -
23 -module.exports = function(node, options){
24 - options = options || {};
25 -
26 - var compiler = options.compress
27 - ? new Compressed(options)
28 - : new Identity(options);
29 -
30 - // source maps
31 - if (options.sourcemap) {
32 - var sourcemaps = require('./source-map-support');
33 - sourcemaps(compiler);
34 -
35 - var code = compiler.compile(node);
36 - compiler.applySourceMaps();
37 -
38 - var map = options.sourcemap === 'generator'
39 - ? compiler.map
40 - : compiler.map.toJSON();
41 -
42 - return { code: code, map: map };
43 - }
44 -
45 - var code = compiler.compile(node);
46 - return code;
47 -};
1 -
2 -/**
3 - * Module dependencies.
4 - */
5 -
6 -var SourceMap = require('source-map').SourceMapGenerator;
7 -var SourceMapConsumer = require('source-map').SourceMapConsumer;
8 -var sourceMapResolve = require('source-map-resolve');
9 -var urix = require('urix');
10 -var fs = require('fs');
11 -var path = require('path');
12 -
13 -/**
14 - * Expose `mixin()`.
15 - */
16 -
17 -module.exports = mixin;
18 -
19 -/**
20 - * Mixin source map support into `compiler`.
21 - *
22 - * @param {Compiler} compiler
23 - * @api public
24 - */
25 -
26 -function mixin(compiler) {
27 - compiler._comment = compiler.comment;
28 - compiler.map = new SourceMap();
29 - compiler.position = { line: 1, column: 1 };
30 - compiler.files = {};
31 - for (var k in exports) compiler[k] = exports[k];
32 -}
33 -
34 -/**
35 - * Update position.
36 - *
37 - * @param {String} str
38 - * @api private
39 - */
40 -
41 -exports.updatePosition = function(str) {
42 - var lines = str.match(/\n/g);
43 - if (lines) this.position.line += lines.length;
44 - var i = str.lastIndexOf('\n');
45 - this.position.column = ~i ? str.length - i : this.position.column + str.length;
46 -};
47 -
48 -/**
49 - * Emit `str`.
50 - *
51 - * @param {String} str
52 - * @param {Object} [pos]
53 - * @return {String}
54 - * @api private
55 - */
56 -
57 -exports.emit = function(str, pos) {
58 - if (pos) {
59 - var sourceFile = urix(pos.source || 'source.css');
60 -
61 - this.map.addMapping({
62 - source: sourceFile,
63 - generated: {
64 - line: this.position.line,
65 - column: Math.max(this.position.column - 1, 0)
66 - },
67 - original: {
68 - line: pos.start.line,
69 - column: pos.start.column - 1
70 - }
71 - });
72 -
73 - this.addFile(sourceFile, pos);
74 - }
75 -
76 - this.updatePosition(str);
77 -
78 - return str;
79 -};
80 -
81 -/**
82 - * Adds a file to the source map output if it has not already been added
83 - * @param {String} file
84 - * @param {Object} pos
85 - */
86 -
87 -exports.addFile = function(file, pos) {
88 - if (typeof pos.content !== 'string') return;
89 - if (Object.prototype.hasOwnProperty.call(this.files, file)) return;
90 -
91 - this.files[file] = pos.content;
92 -};
93 -
94 -/**
95 - * Applies any original source maps to the output and embeds the source file
96 - * contents in the source map.
97 - */
98 -
99 -exports.applySourceMaps = function() {
100 - Object.keys(this.files).forEach(function(file) {
101 - var content = this.files[file];
102 - this.map.setSourceContent(file, content);
103 -
104 - if (this.options.inputSourcemaps !== false) {
105 - var originalMap = sourceMapResolve.resolveSync(
106 - content, file, fs.readFileSync);
107 - if (originalMap) {
108 - var map = new SourceMapConsumer(originalMap.map);
109 - var relativeTo = originalMap.sourcesRelativeTo;
110 - this.map.applySourceMap(map, file, urix(path.dirname(relativeTo)));
111 - }
112 - }
113 - }, this);
114 -};
115 -
116 -/**
117 - * Process comments, drops sourceMap comments.
118 - * @param {Object} node
119 - */
120 -
121 -exports.comment = function(node) {
122 - if (/^# sourceMappingURL=/.test(node.comment))
123 - return this.emit('', node.position);
124 - else
125 - return this._comment(node);
126 -};
1 -# Change Log
2 -
3 -## 0.5.6
4 -
5 -* Fix for regression when people were using numbers as names in source maps. See
6 - #236.
7 -
8 -## 0.5.5
9 -
10 -* Fix "regression" of unsupported, implementation behavior that half the world
11 - happens to have come to depend on. See #235.
12 -
13 -* Fix regression involving function hoisting in SpiderMonkey. See #233.
14 -
15 -## 0.5.4
16 -
17 -* Large performance improvements to source-map serialization. See #228 and #229.
18 -
19 -## 0.5.3
20 -
21 -* Do not include unnecessary distribution files. See
22 - commit ef7006f8d1647e0a83fdc60f04f5a7ca54886f86.
23 -
24 -## 0.5.2
25 -
26 -* Include browser distributions of the library in package.json's `files`. See
27 - issue #212.
28 -
29 -## 0.5.1
30 -
31 -* Fix latent bugs in IndexedSourceMapConsumer.prototype._parseMappings. See
32 - ff05274becc9e6e1295ed60f3ea090d31d843379.
33 -
34 -## 0.5.0
35 -
36 -* Node 0.8 is no longer supported.
37 -
38 -* Use webpack instead of dryice for bundling.
39 -
40 -* Big speedups serializing source maps. See pull request #203.
41 -
42 -* Fix a bug with `SourceMapConsumer.prototype.sourceContentFor` and sources that
43 - explicitly start with the source root. See issue #199.
44 -
45 -## 0.4.4
46 -
47 -* Fix an issue where using a `SourceMapGenerator` after having created a
48 - `SourceMapConsumer` from it via `SourceMapConsumer.fromSourceMap` failed. See
49 - issue #191.
50 -
51 -* Fix an issue with where `SourceMapGenerator` would mistakenly consider
52 - different mappings as duplicates of each other and avoid generating them. See
53 - issue #192.
54 -
55 -## 0.4.3
56 -
57 -* A very large number of performance improvements, particularly when parsing
58 - source maps. Collectively about 75% of time shaved off of the source map
59 - parsing benchmark!
60 -
61 -* Fix a bug in `SourceMapConsumer.prototype.allGeneratedPositionsFor` and fuzzy
62 - searching in the presence of a column option. See issue #177.
63 -
64 -* Fix a bug with joining a source and its source root when the source is above
65 - the root. See issue #182.
66 -
67 -* Add the `SourceMapConsumer.prototype.hasContentsOfAllSources` method to
68 - determine when all sources' contents are inlined into the source map. See
69 - issue #190.
70 -
71 -## 0.4.2
72 -
73 -* Add an `.npmignore` file so that the benchmarks aren't pulled down by
74 - dependent projects. Issue #169.
75 -
76 -* Add an optional `column` argument to
77 - `SourceMapConsumer.prototype.allGeneratedPositionsFor` and better handle lines
78 - with no mappings. Issues #172 and #173.
79 -
80 -## 0.4.1
81 -
82 -* Fix accidentally defining a global variable. #170.
83 -
84 -## 0.4.0
85 -
86 -* The default direction for fuzzy searching was changed back to its original
87 - direction. See #164.
88 -
89 -* There is now a `bias` option you can supply to `SourceMapConsumer` to control
90 - the fuzzy searching direction. See #167.
91 -
92 -* About an 8% speed up in parsing source maps. See #159.
93 -
94 -* Added a benchmark for parsing and generating source maps.
95 -
96 -## 0.3.0
97 -
98 -* Change the default direction that searching for positions fuzzes when there is
99 - not an exact match. See #154.
100 -
101 -* Support for environments using json2.js for JSON serialization. See #156.
102 -
103 -## 0.2.0
104 -
105 -* Support for consuming "indexed" source maps which do not have any remote
106 - sections. See pull request #127. This introduces a minor backwards
107 - incompatibility if you are monkey patching `SourceMapConsumer.prototype`
108 - methods.
109 -
110 -## 0.1.43
111 -
112 -* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue
113 - #148 for some discussion and issues #150, #151, and #152 for implementations.
114 -
115 -## 0.1.42
116 -
117 -* Fix an issue where `SourceNode`s from different versions of the source-map
118 - library couldn't be used in conjunction with each other. See issue #142.
119 -
120 -## 0.1.41
121 -
122 -* Fix a bug with getting the source content of relative sources with a "./"
123 - prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768).
124 -
125 -* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the
126 - column span of each mapping.
127 -
128 -* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find
129 - all generated positions associated with a given original source and line.
130 -
131 -## 0.1.40
132 -
133 -* Performance improvements for parsing source maps in SourceMapConsumer.
134 -
135 -## 0.1.39
136 -
137 -* Fix a bug where setting a source's contents to null before any source content
138 - had been set before threw a TypeError. See issue #131.
139 -
140 -## 0.1.38
141 -
142 -* Fix a bug where finding relative paths from an empty path were creating
143 - absolute paths. See issue #129.
144 -
145 -## 0.1.37
146 -
147 -* Fix a bug where if the source root was an empty string, relative source paths
148 - would turn into absolute source paths. Issue #124.
149 -
150 -## 0.1.36
151 -
152 -* Allow the `names` mapping property to be an empty string. Issue #121.
153 -
154 -## 0.1.35
155 -
156 -* A third optional parameter was added to `SourceNode.fromStringWithSourceMap`
157 - to specify a path that relative sources in the second parameter should be
158 - relative to. Issue #105.
159 -
160 -* If no file property is given to a `SourceMapGenerator`, then the resulting
161 - source map will no longer have a `null` file property. The property will
162 - simply not exist. Issue #104.
163 -
164 -* Fixed a bug where consecutive newlines were ignored in `SourceNode`s.
165 - Issue #116.
166 -
167 -## 0.1.34
168 -
169 -* Make `SourceNode` work with windows style ("\r\n") newlines. Issue #103.
170 -
171 -* Fix bug involving source contents and the
172 - `SourceMapGenerator.prototype.applySourceMap`. Issue #100.
173 -
174 -## 0.1.33
175 -
176 -* Fix some edge cases surrounding path joining and URL resolution.
177 -
178 -* Add a third parameter for relative path to
179 - `SourceMapGenerator.prototype.applySourceMap`.
180 -
181 -* Fix issues with mappings and EOLs.
182 -
183 -## 0.1.32
184 -
185 -* Fixed a bug where SourceMapConsumer couldn't handle negative relative columns
186 - (issue 92).
187 -
188 -* Fixed test runner to actually report number of failed tests as its process
189 - exit code.
190 -
191 -* Fixed a typo when reporting bad mappings (issue 87).
192 -
193 -## 0.1.31
194 -
195 -* Delay parsing the mappings in SourceMapConsumer until queried for a source
196 - location.
197 -
198 -* Support Sass source maps (which at the time of writing deviate from the spec
199 - in small ways) in SourceMapConsumer.
200 -
201 -## 0.1.30
202 -
203 -* Do not join source root with a source, when the source is a data URI.
204 -
205 -* Extend the test runner to allow running single specific test files at a time.
206 -
207 -* Performance improvements in `SourceNode.prototype.walk` and
208 - `SourceMapConsumer.prototype.eachMapping`.
209 -
210 -* Source map browser builds will now work inside Workers.
211 -
212 -* Better error messages when attempting to add an invalid mapping to a
213 - `SourceMapGenerator`.
214 -
215 -## 0.1.29
216 -
217 -* Allow duplicate entries in the `names` and `sources` arrays of source maps
218 - (usually from TypeScript) we are parsing. Fixes github issue 72.
219 -
220 -## 0.1.28
221 -
222 -* Skip duplicate mappings when creating source maps from SourceNode; github
223 - issue 75.
224 -
225 -## 0.1.27
226 -
227 -* Don't throw an error when the `file` property is missing in SourceMapConsumer,
228 - we don't use it anyway.
229 -
230 -## 0.1.26
231 -
232 -* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70.
233 -
234 -## 0.1.25
235 -
236 -* Make compatible with browserify
237 -
238 -## 0.1.24
239 -
240 -* Fix issue with absolute paths and `file://` URIs. See
241 - https://bugzilla.mozilla.org/show_bug.cgi?id=885597
242 -
243 -## 0.1.23
244 -
245 -* Fix issue with absolute paths and sourcesContent, github issue 64.
246 -
247 -## 0.1.22
248 -
249 -* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21.
250 -
251 -## 0.1.21
252 -
253 -* Fixed handling of sources that start with a slash so that they are relative to
254 - the source root's host.
255 -
256 -## 0.1.20
257 -
258 -* Fixed github issue #43: absolute URLs aren't joined with the source root
259 - anymore.
260 -
261 -## 0.1.19
262 -
263 -* Using Travis CI to run tests.
264 -
265 -## 0.1.18
266 -
267 -* Fixed a bug in the handling of sourceRoot.
268 -
269 -## 0.1.17
270 -
271 -* Added SourceNode.fromStringWithSourceMap.
272 -
273 -## 0.1.16
274 -
275 -* Added missing documentation.
276 -
277 -* Fixed the generating of empty mappings in SourceNode.
278 -
279 -## 0.1.15
280 -
281 -* Added SourceMapGenerator.applySourceMap.
282 -
283 -## 0.1.14
284 -
285 -* The sourceRoot is now handled consistently.
286 -
287 -## 0.1.13
288 -
289 -* Added SourceMapGenerator.fromSourceMap.
290 -
291 -## 0.1.12
292 -
293 -* SourceNode now generates empty mappings too.
294 -
295 -## 0.1.11
296 -
297 -* Added name support to SourceNode.
298 -
299 -## 0.1.10
300 -
301 -* Added sourcesContent support to the customer and generator.
1 -
2 -Copyright (c) 2009-2011, Mozilla Foundation and contributors
3 -All rights reserved.
4 -
5 -Redistribution and use in source and binary forms, with or without
6 -modification, are permitted provided that the following conditions are met:
7 -
8 -* Redistributions of source code must retain the above copyright notice, this
9 - list of conditions and the following disclaimer.
10 -
11 -* Redistributions in binary form must reproduce the above copyright notice,
12 - this list of conditions and the following disclaimer in the documentation
13 - and/or other materials provided with the distribution.
14 -
15 -* Neither the names of the Mozilla Foundation nor the names of project
16 - contributors may be used to endorse or promote products derived from this
17 - software without specific prior written permission.
18 -
19 -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20 -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21 -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23 -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27 -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
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 -var util = require('./util');
9 -var has = Object.prototype.hasOwnProperty;
10 -var hasNativeMap = typeof Map !== "undefined";
11 -
12 -/**
13 - * A data structure which is a combination of an array and a set. Adding a new
14 - * member is O(1), testing for membership is O(1), and finding the index of an
15 - * element is O(1). Removing elements from the set is not supported. Only
16 - * strings are supported for membership.
17 - */
18 -function ArraySet() {
19 - this._array = [];
20 - this._set = hasNativeMap ? new Map() : Object.create(null);
21 -}
22 -
23 -/**
24 - * Static method for creating ArraySet instances from an existing array.
25 - */
26 -ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
27 - var set = new ArraySet();
28 - for (var i = 0, len = aArray.length; i < len; i++) {
29 - set.add(aArray[i], aAllowDuplicates);
30 - }
31 - return set;
32 -};
33 -
34 -/**
35 - * Return how many unique items are in this ArraySet. If duplicates have been
36 - * added, than those do not count towards the size.
37 - *
38 - * @returns Number
39 - */
40 -ArraySet.prototype.size = function ArraySet_size() {
41 - return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
42 -};
43 -
44 -/**
45 - * Add the given string to this set.
46 - *
47 - * @param String aStr
48 - */
49 -ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
50 - var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
51 - var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
52 - var idx = this._array.length;
53 - if (!isDuplicate || aAllowDuplicates) {
54 - this._array.push(aStr);
55 - }
56 - if (!isDuplicate) {
57 - if (hasNativeMap) {
58 - this._set.set(aStr, idx);
59 - } else {
60 - this._set[sStr] = idx;
61 - }
62 - }
63 -};
64 -
65 -/**
66 - * Is the given string a member of this set?
67 - *
68 - * @param String aStr
69 - */
70 -ArraySet.prototype.has = function ArraySet_has(aStr) {
71 - if (hasNativeMap) {
72 - return this._set.has(aStr);
73 - } else {
74 - var sStr = util.toSetString(aStr);
75 - return has.call(this._set, sStr);
76 - }
77 -};
78 -
79 -/**
80 - * What is the index of the given string in the array?
81 - *
82 - * @param String aStr
83 - */
84 -ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
85 - if (hasNativeMap) {
86 - var idx = this._set.get(aStr);
87 - if (idx >= 0) {
88 - return idx;
89 - }
90 - } else {
91 - var sStr = util.toSetString(aStr);
92 - if (has.call(this._set, sStr)) {
93 - return this._set[sStr];
94 - }
95 - }
96 -
97 - throw new Error('"' + aStr + '" is not in the set.');
98 -};
99 -
100 -/**
101 - * What is the element at the given index?
102 - *
103 - * @param Number aIdx
104 - */
105 -ArraySet.prototype.at = function ArraySet_at(aIdx) {
106 - if (aIdx >= 0 && aIdx < this._array.length) {
107 - return this._array[aIdx];
108 - }
109 - throw new Error('No element indexed by ' + aIdx);
110 -};
111 -
112 -/**
113 - * Returns the array representation of this set (which has the proper indices
114 - * indicated by indexOf). Note that this is a copy of the internal array used
115 - * for storing the members so that no one can mess with internal state.
116 - */
117 -ArraySet.prototype.toArray = function ArraySet_toArray() {
118 - return this._array.slice();
119 -};
120 -
121 -exports.ArraySet = ArraySet;
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 - * Based on the Base 64 VLQ implementation in Closure Compiler:
8 - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
9 - *
10 - * Copyright 2011 The Closure Compiler Authors. All rights reserved.
11 - * Redistribution and use in source and binary forms, with or without
12 - * modification, are permitted provided that the following conditions are
13 - * met:
14 - *
15 - * * Redistributions of source code must retain the above copyright
16 - * notice, this list of conditions and the following disclaimer.
17 - * * Redistributions in binary form must reproduce the above
18 - * copyright notice, this list of conditions and the following
19 - * disclaimer in the documentation and/or other materials provided
20 - * with the distribution.
21 - * * Neither the name of Google Inc. nor the names of its
22 - * contributors may be used to endorse or promote products derived
23 - * from this software without specific prior written permission.
24 - *
25 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 - */
37 -
38 -var base64 = require('./base64');
39 -
40 -// A single base 64 digit can contain 6 bits of data. For the base 64 variable
41 -// length quantities we use in the source map spec, the first bit is the sign,
42 -// the next four bits are the actual value, and the 6th bit is the
43 -// continuation bit. The continuation bit tells us whether there are more
44 -// digits in this value following this digit.
45 -//
46 -// Continuation
47 -// | Sign
48 -// | |
49 -// V V
50 -// 101011
51 -
52 -var VLQ_BASE_SHIFT = 5;
53 -
54 -// binary: 100000
55 -var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
56 -
57 -// binary: 011111
58 -var VLQ_BASE_MASK = VLQ_BASE - 1;
59 -
60 -// binary: 100000
61 -var VLQ_CONTINUATION_BIT = VLQ_BASE;
62 -
63 -/**
64 - * Converts from a two-complement value to a value where the sign bit is
65 - * placed in the least significant bit. For example, as decimals:
66 - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
67 - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
68 - */
69 -function toVLQSigned(aValue) {
70 - return aValue < 0
71 - ? ((-aValue) << 1) + 1
72 - : (aValue << 1) + 0;
73 -}
74 -
75 -/**
76 - * Converts to a two-complement value from a value where the sign bit is
77 - * placed in the least significant bit. For example, as decimals:
78 - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
79 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
80 - */
81 -function fromVLQSigned(aValue) {
82 - var isNegative = (aValue & 1) === 1;
83 - var shifted = aValue >> 1;
84 - return isNegative
85 - ? -shifted
86 - : shifted;
87 -}
88 -
89 -/**
90 - * Returns the base 64 VLQ encoded value.
91 - */
92 -exports.encode = function base64VLQ_encode(aValue) {
93 - var encoded = "";
94 - var digit;
95 -
96 - var vlq = toVLQSigned(aValue);
97 -
98 - do {
99 - digit = vlq & VLQ_BASE_MASK;
100 - vlq >>>= VLQ_BASE_SHIFT;
101 - if (vlq > 0) {
102 - // There are still more digits in this value, so we must make sure the
103 - // continuation bit is marked.
104 - digit |= VLQ_CONTINUATION_BIT;
105 - }
106 - encoded += base64.encode(digit);
107 - } while (vlq > 0);
108 -
109 - return encoded;
110 -};
111 -
112 -/**
113 - * Decodes the next base 64 VLQ value from the given string and returns the
114 - * value and the rest of the string via the out parameter.
115 - */
116 -exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
117 - var strLen = aStr.length;
118 - var result = 0;
119 - var shift = 0;
120 - var continuation, digit;
121 -
122 - do {
123 - if (aIndex >= strLen) {
124 - throw new Error("Expected more digits in base 64 VLQ value.");
125 - }
126 -
127 - digit = base64.decode(aStr.charCodeAt(aIndex++));
128 - if (digit === -1) {
129 - throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
130 - }
131 -
132 - continuation = !!(digit & VLQ_CONTINUATION_BIT);
133 - digit &= VLQ_BASE_MASK;
134 - result = result + (digit << shift);
135 - shift += VLQ_BASE_SHIFT;
136 - } while (continuation);
137 -
138 - aOutParam.value = fromVLQSigned(result);
139 - aOutParam.rest = aIndex;
140 -};
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 -var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
9 -
10 -/**
11 - * Encode an integer in the range of 0 to 63 to a single base 64 digit.
12 - */
13 -exports.encode = function (number) {
14 - if (0 <= number && number < intToCharMap.length) {
15 - return intToCharMap[number];
16 - }
17 - throw new TypeError("Must be between 0 and 63: " + number);
18 -};
19 -
20 -/**
21 - * Decode a single base 64 character code digit to an integer. Returns -1 on
22 - * failure.
23 - */
24 -exports.decode = function (charCode) {
25 - var bigA = 65; // 'A'
26 - var bigZ = 90; // 'Z'
27 -
28 - var littleA = 97; // 'a'
29 - var littleZ = 122; // 'z'
30 -
31 - var zero = 48; // '0'
32 - var nine = 57; // '9'
33 -
34 - var plus = 43; // '+'
35 - var slash = 47; // '/'
36 -
37 - var littleOffset = 26;
38 - var numberOffset = 52;
39 -
40 - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
41 - if (bigA <= charCode && charCode <= bigZ) {
42 - return (charCode - bigA);
43 - }
44 -
45 - // 26 - 51: abcdefghijklmnopqrstuvwxyz
46 - if (littleA <= charCode && charCode <= littleZ) {
47 - return (charCode - littleA + littleOffset);
48 - }
49 -
50 - // 52 - 61: 0123456789
51 - if (zero <= charCode && charCode <= nine) {
52 - return (charCode - zero + numberOffset);
53 - }
54 -
55 - // 62: +
56 - if (charCode == plus) {
57 - return 62;
58 - }
59 -
60 - // 63: /
61 - if (charCode == slash) {
62 - return 63;
63 - }
64 -
65 - // Invalid base64 digit.
66 - return -1;
67 -};
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 -exports.GREATEST_LOWER_BOUND = 1;
9 -exports.LEAST_UPPER_BOUND = 2;
10 -
11 -/**
12 - * Recursive implementation of binary search.
13 - *
14 - * @param aLow Indices here and lower do not contain the needle.
15 - * @param aHigh Indices here and higher do not contain the needle.
16 - * @param aNeedle The element being searched for.
17 - * @param aHaystack The non-empty array being searched.
18 - * @param aCompare Function which takes two elements and returns -1, 0, or 1.
19 - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
20 - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
21 - * closest element that is smaller than or greater than the one we are
22 - * searching for, respectively, if the exact element cannot be found.
23 - */
24 -function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
25 - // This function terminates when one of the following is true:
26 - //
27 - // 1. We find the exact element we are looking for.
28 - //
29 - // 2. We did not find the exact element, but we can return the index of
30 - // the next-closest element.
31 - //
32 - // 3. We did not find the exact element, and there is no next-closest
33 - // element than the one we are searching for, so we return -1.
34 - var mid = Math.floor((aHigh - aLow) / 2) + aLow;
35 - var cmp = aCompare(aNeedle, aHaystack[mid], true);
36 - if (cmp === 0) {
37 - // Found the element we are looking for.
38 - return mid;
39 - }
40 - else if (cmp > 0) {
41 - // Our needle is greater than aHaystack[mid].
42 - if (aHigh - mid > 1) {
43 - // The element is in the upper half.
44 - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
45 - }
46 -
47 - // The exact needle element was not found in this haystack. Determine if
48 - // we are in termination case (3) or (2) and return the appropriate thing.
49 - if (aBias == exports.LEAST_UPPER_BOUND) {
50 - return aHigh < aHaystack.length ? aHigh : -1;
51 - } else {
52 - return mid;
53 - }
54 - }
55 - else {
56 - // Our needle is less than aHaystack[mid].
57 - if (mid - aLow > 1) {
58 - // The element is in the lower half.
59 - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
60 - }
61 -
62 - // we are in termination case (3) or (2) and return the appropriate thing.
63 - if (aBias == exports.LEAST_UPPER_BOUND) {
64 - return mid;
65 - } else {
66 - return aLow < 0 ? -1 : aLow;
67 - }
68 - }
69 -}
70 -
71 -/**
72 - * This is an implementation of binary search which will always try and return
73 - * the index of the closest element if there is no exact hit. This is because
74 - * mappings between original and generated line/col pairs are single points,
75 - * and there is an implicit region between each of them, so a miss just means
76 - * that you aren't on the very start of a region.
77 - *
78 - * @param aNeedle The element you are looking for.
79 - * @param aHaystack The array that is being searched.
80 - * @param aCompare A function which takes the needle and an element in the
81 - * array and returns -1, 0, or 1 depending on whether the needle is less
82 - * than, equal to, or greater than the element, respectively.
83 - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
84 - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
85 - * closest element that is smaller than or greater than the one we are
86 - * searching for, respectively, if the exact element cannot be found.
87 - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
88 - */
89 -exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
90 - if (aHaystack.length === 0) {
91 - return -1;
92 - }
93 -
94 - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
95 - aCompare, aBias || exports.GREATEST_LOWER_BOUND);
96 - if (index < 0) {
97 - return -1;
98 - }
99 -
100 - // We have found either the exact element, or the next-closest element than
101 - // the one we are searching for. However, there may be more than one such
102 - // element. Make sure we always return the smallest of these.
103 - while (index - 1 >= 0) {
104 - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
105 - break;
106 - }
107 - --index;
108 - }
109 -
110 - return index;
111 -};
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 -
8 -var util = require('./util');
9 -
10 -/**
11 - * Determine whether mappingB is after mappingA with respect to generated
12 - * position.
13 - */
14 -function generatedPositionAfter(mappingA, mappingB) {
15 - // Optimized for most common case
16 - var lineA = mappingA.generatedLine;
17 - var lineB = mappingB.generatedLine;
18 - var columnA = mappingA.generatedColumn;
19 - var columnB = mappingB.generatedColumn;
20 - return lineB > lineA || lineB == lineA && columnB >= columnA ||
21 - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
22 -}
23 -
24 -/**
25 - * A data structure to provide a sorted view of accumulated mappings in a
26 - * performance conscious manner. It trades a neglibable overhead in general
27 - * case for a large speedup in case of mappings being added in order.
28 - */
29 -function MappingList() {
30 - this._array = [];
31 - this._sorted = true;
32 - // Serves as infimum
33 - this._last = {generatedLine: -1, generatedColumn: 0};
34 -}
35 -
36 -/**
37 - * Iterate through internal items. This method takes the same arguments that
38 - * `Array.prototype.forEach` takes.
39 - *
40 - * NOTE: The order of the mappings is NOT guaranteed.
41 - */
42 -MappingList.prototype.unsortedForEach =
43 - function MappingList_forEach(aCallback, aThisArg) {
44 - this._array.forEach(aCallback, aThisArg);
45 - };
46 -
47 -/**
48 - * Add the given source mapping.
49 - *
50 - * @param Object aMapping
51 - */
52 -MappingList.prototype.add = function MappingList_add(aMapping) {
53 - if (generatedPositionAfter(this._last, aMapping)) {
54 - this._last = aMapping;
55 - this._array.push(aMapping);
56 - } else {
57 - this._sorted = false;
58 - this._array.push(aMapping);
59 - }
60 -};
61 -
62 -/**
63 - * Returns the flat, sorted array of mappings. The mappings are sorted by
64 - * generated position.
65 - *
66 - * WARNING: This method returns internal data without copying, for
67 - * performance. The return value must NOT be mutated, and should be treated as
68 - * an immutable borrow. If you want to take ownership, you must make your own
69 - * copy.
70 - */
71 -MappingList.prototype.toArray = function MappingList_toArray() {
72 - if (!this._sorted) {
73 - this._array.sort(util.compareByGeneratedPositionsInflated);
74 - this._sorted = true;
75 - }
76 - return this._array;
77 -};
78 -
79 -exports.MappingList = MappingList;
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 -// It turns out that some (most?) JavaScript engines don't self-host
9 -// `Array.prototype.sort`. This makes sense because C++ will likely remain
10 -// faster than JS when doing raw CPU-intensive sorting. However, when using a
11 -// custom comparator function, calling back and forth between the VM's C++ and
12 -// JIT'd JS is rather slow *and* loses JIT type information, resulting in
13 -// worse generated code for the comparator function than would be optimal. In
14 -// fact, when sorting with a comparator, these costs outweigh the benefits of
15 -// sorting in C++. By using our own JS-implemented Quick Sort (below), we get
16 -// a ~3500ms mean speed-up in `bench/bench.html`.
17 -
18 -/**
19 - * Swap the elements indexed by `x` and `y` in the array `ary`.
20 - *
21 - * @param {Array} ary
22 - * The array.
23 - * @param {Number} x
24 - * The index of the first item.
25 - * @param {Number} y
26 - * The index of the second item.
27 - */
28 -function swap(ary, x, y) {
29 - var temp = ary[x];
30 - ary[x] = ary[y];
31 - ary[y] = temp;
32 -}
33 -
34 -/**
35 - * Returns a random integer within the range `low .. high` inclusive.
36 - *
37 - * @param {Number} low
38 - * The lower bound on the range.
39 - * @param {Number} high
40 - * The upper bound on the range.
41 - */
42 -function randomIntInRange(low, high) {
43 - return Math.round(low + (Math.random() * (high - low)));
44 -}
45 -
46 -/**
47 - * The Quick Sort algorithm.
48 - *
49 - * @param {Array} ary
50 - * An array to sort.
51 - * @param {function} comparator
52 - * Function to use to compare two items.
53 - * @param {Number} p
54 - * Start index of the array
55 - * @param {Number} r
56 - * End index of the array
57 - */
58 -function doQuickSort(ary, comparator, p, r) {
59 - // If our lower bound is less than our upper bound, we (1) partition the
60 - // array into two pieces and (2) recurse on each half. If it is not, this is
61 - // the empty array and our base case.
62 -
63 - if (p < r) {
64 - // (1) Partitioning.
65 - //
66 - // The partitioning chooses a pivot between `p` and `r` and moves all
67 - // elements that are less than or equal to the pivot to the before it, and
68 - // all the elements that are greater than it after it. The effect is that
69 - // once partition is done, the pivot is in the exact place it will be when
70 - // the array is put in sorted order, and it will not need to be moved
71 - // again. This runs in O(n) time.
72 -
73 - // Always choose a random pivot so that an input array which is reverse
74 - // sorted does not cause O(n^2) running time.
75 - var pivotIndex = randomIntInRange(p, r);
76 - var i = p - 1;
77 -
78 - swap(ary, pivotIndex, r);
79 - var pivot = ary[r];
80 -
81 - // Immediately after `j` is incremented in this loop, the following hold
82 - // true:
83 - //
84 - // * Every element in `ary[p .. i]` is less than or equal to the pivot.
85 - //
86 - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
87 - for (var j = p; j < r; j++) {
88 - if (comparator(ary[j], pivot) <= 0) {
89 - i += 1;
90 - swap(ary, i, j);
91 - }
92 - }
93 -
94 - swap(ary, i + 1, j);
95 - var q = i + 1;
96 -
97 - // (2) Recurse on each half.
98 -
99 - doQuickSort(ary, comparator, p, q - 1);
100 - doQuickSort(ary, comparator, q + 1, r);
101 - }
102 -}
103 -
104 -/**
105 - * Sort the given array in-place with the given comparator function.
106 - *
107 - * @param {Array} ary
108 - * An array to sort.
109 - * @param {function} comparator
110 - * Function to use to compare two items.
111 - */
112 -exports.quickSort = function (ary, comparator) {
113 - doQuickSort(ary, comparator, 0, ary.length - 1);
114 -};
1 -{
2 - "_from": "source-map@^0.6.1",
3 - "_id": "source-map@0.6.1",
4 - "_inBundle": false,
5 - "_integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
6 - "_location": "/css/source-map",
7 - "_phantomChildren": {},
8 - "_requested": {
9 - "type": "range",
10 - "registry": true,
11 - "raw": "source-map@^0.6.1",
12 - "name": "source-map",
13 - "escapedName": "source-map",
14 - "rawSpec": "^0.6.1",
15 - "saveSpec": null,
16 - "fetchSpec": "^0.6.1"
17 - },
18 - "_requiredBy": [
19 - "/css"
20 - ],
21 - "_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
22 - "_shasum": "74722af32e9614e9c287a8d0bbde48b5e2f1a263",
23 - "_spec": "source-map@^0.6.1",
24 - "_where": "C:\\Users\\kkwan_000\\Desktop\\git\\2017110269\\minsung\\node_modules\\css",
25 - "author": {
26 - "name": "Nick Fitzgerald",
27 - "email": "nfitzgerald@mozilla.com"
28 - },
29 - "bugs": {
30 - "url": "https://github.com/mozilla/source-map/issues"
31 - },
32 - "bundleDependencies": false,
33 - "contributors": [
34 - {
35 - "name": "Tobias Koppers",
36 - "email": "tobias.koppers@googlemail.com"
37 - },
38 - {
39 - "name": "Duncan Beevers",
40 - "email": "duncan@dweebd.com"
41 - },
42 - {
43 - "name": "Stephen Crane",
44 - "email": "scrane@mozilla.com"
45 - },
46 - {
47 - "name": "Ryan Seddon",
48 - "email": "seddon.ryan@gmail.com"
49 - },
50 - {
51 - "name": "Miles Elam",
52 - "email": "miles.elam@deem.com"
53 - },
54 - {
55 - "name": "Mihai Bazon",
56 - "email": "mihai.bazon@gmail.com"
57 - },
58 - {
59 - "name": "Michael Ficarra",
60 - "email": "github.public.email@michael.ficarra.me"
61 - },
62 - {
63 - "name": "Todd Wolfson",
64 - "email": "todd@twolfson.com"
65 - },
66 - {
67 - "name": "Alexander Solovyov",
68 - "email": "alexander@solovyov.net"
69 - },
70 - {
71 - "name": "Felix Gnass",
72 - "email": "fgnass@gmail.com"
73 - },
74 - {
75 - "name": "Conrad Irwin",
76 - "email": "conrad.irwin@gmail.com"
77 - },
78 - {
79 - "name": "usrbincc",
80 - "email": "usrbincc@yahoo.com"
81 - },
82 - {
83 - "name": "David Glasser",
84 - "email": "glasser@davidglasser.net"
85 - },
86 - {
87 - "name": "Chase Douglas",
88 - "email": "chase@newrelic.com"
89 - },
90 - {
91 - "name": "Evan Wallace",
92 - "email": "evan.exe@gmail.com"
93 - },
94 - {
95 - "name": "Heather Arthur",
96 - "email": "fayearthur@gmail.com"
97 - },
98 - {
99 - "name": "Hugh Kennedy",
100 - "email": "hughskennedy@gmail.com"
101 - },
102 - {
103 - "name": "David Glasser",
104 - "email": "glasser@davidglasser.net"
105 - },
106 - {
107 - "name": "Simon Lydell",
108 - "email": "simon.lydell@gmail.com"
109 - },
110 - {
111 - "name": "Jmeas Smith",
112 - "email": "jellyes2@gmail.com"
113 - },
114 - {
115 - "name": "Michael Z Goddard",
116 - "email": "mzgoddard@gmail.com"
117 - },
118 - {
119 - "name": "azu",
120 - "email": "azu@users.noreply.github.com"
121 - },
122 - {
123 - "name": "John Gozde",
124 - "email": "john@gozde.ca"
125 - },
126 - {
127 - "name": "Adam Kirkton",
128 - "email": "akirkton@truefitinnovation.com"
129 - },
130 - {
131 - "name": "Chris Montgomery",
132 - "email": "christopher.montgomery@dowjones.com"
133 - },
134 - {
135 - "name": "J. Ryan Stinnett",
136 - "email": "jryans@gmail.com"
137 - },
138 - {
139 - "name": "Jack Herrington",
140 - "email": "jherrington@walmartlabs.com"
141 - },
142 - {
143 - "name": "Chris Truter",
144 - "email": "jeffpalentine@gmail.com"
145 - },
146 - {
147 - "name": "Daniel Espeset",
148 - "email": "daniel@danielespeset.com"
149 - },
150 - {
151 - "name": "Jamie Wong",
152 - "email": "jamie.lf.wong@gmail.com"
153 - },
154 - {
155 - "name": "Eddy Bruël",
156 - "email": "ejpbruel@mozilla.com"
157 - },
158 - {
159 - "name": "Hawken Rives",
160 - "email": "hawkrives@gmail.com"
161 - },
162 - {
163 - "name": "Gilad Peleg",
164 - "email": "giladp007@gmail.com"
165 - },
166 - {
167 - "name": "djchie",
168 - "email": "djchie.dev@gmail.com"
169 - },
170 - {
171 - "name": "Gary Ye",
172 - "email": "garysye@gmail.com"
173 - },
174 - {
175 - "name": "Nicolas Lalevée",
176 - "email": "nicolas.lalevee@hibnet.org"
177 - }
178 - ],
179 - "deprecated": false,
180 - "description": "Generates and consumes source maps",
181 - "devDependencies": {
182 - "doctoc": "^0.15.0",
183 - "webpack": "^1.12.0"
184 - },
185 - "engines": {
186 - "node": ">=0.10.0"
187 - },
188 - "files": [
189 - "source-map.js",
190 - "source-map.d.ts",
191 - "lib/",
192 - "dist/source-map.debug.js",
193 - "dist/source-map.js",
194 - "dist/source-map.min.js",
195 - "dist/source-map.min.js.map"
196 - ],
197 - "homepage": "https://github.com/mozilla/source-map",
198 - "license": "BSD-3-Clause",
199 - "main": "./source-map.js",
200 - "name": "source-map",
201 - "repository": {
202 - "type": "git",
203 - "url": "git+ssh://git@github.com/mozilla/source-map.git"
204 - },
205 - "scripts": {
206 - "build": "webpack --color",
207 - "test": "npm run build && node test/run-tests.js",
208 - "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md"
209 - },
210 - "typings": "source-map",
211 - "version": "0.6.1"
212 -}
1 -export interface StartOfSourceMap {
2 - file?: string;
3 - sourceRoot?: string;
4 -}
5 -
6 -export interface RawSourceMap extends StartOfSourceMap {
7 - version: string;
8 - sources: string[];
9 - names: string[];
10 - sourcesContent?: string[];
11 - mappings: string;
12 -}
13 -
14 -export interface Position {
15 - line: number;
16 - column: number;
17 -}
18 -
19 -export interface LineRange extends Position {
20 - lastColumn: number;
21 -}
22 -
23 -export interface FindPosition extends Position {
24 - // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND
25 - bias?: number;
26 -}
27 -
28 -export interface SourceFindPosition extends FindPosition {
29 - source: string;
30 -}
31 -
32 -export interface MappedPosition extends Position {
33 - source: string;
34 - name?: string;
35 -}
36 -
37 -export interface MappingItem {
38 - source: string;
39 - generatedLine: number;
40 - generatedColumn: number;
41 - originalLine: number;
42 - originalColumn: number;
43 - name: string;
44 -}
45 -
46 -export class SourceMapConsumer {
47 - static GENERATED_ORDER: number;
48 - static ORIGINAL_ORDER: number;
49 -
50 - static GREATEST_LOWER_BOUND: number;
51 - static LEAST_UPPER_BOUND: number;
52 -
53 - constructor(rawSourceMap: RawSourceMap);
54 - computeColumnSpans(): void;
55 - originalPositionFor(generatedPosition: FindPosition): MappedPosition;
56 - generatedPositionFor(originalPosition: SourceFindPosition): LineRange;
57 - allGeneratedPositionsFor(originalPosition: MappedPosition): Position[];
58 - hasContentsOfAllSources(): boolean;
59 - sourceContentFor(source: string, returnNullOnMissing?: boolean): string;
60 - eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void;
61 -}
62 -
63 -export interface Mapping {
64 - generated: Position;
65 - original: Position;
66 - source: string;
67 - name?: string;
68 -}
69 -
70 -export class SourceMapGenerator {
71 - constructor(startOfSourceMap?: StartOfSourceMap);
72 - static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator;
73 - addMapping(mapping: Mapping): void;
74 - setSourceContent(sourceFile: string, sourceContent: string): void;
75 - applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void;
76 - toString(): string;
77 -}
78 -
79 -export interface CodeWithSourceMap {
80 - code: string;
81 - map: SourceMapGenerator;
82 -}
83 -
84 -export class SourceNode {
85 - constructor();
86 - constructor(line: number, column: number, source: string);
87 - constructor(line: number, column: number, source: string, chunk?: string, name?: string);
88 - static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode;
89 - add(chunk: string): void;
90 - prepend(chunk: string): void;
91 - setSourceContent(sourceFile: string, sourceContent: string): void;
92 - walk(fn: (chunk: string, mapping: MappedPosition) => void): void;
93 - walkSourceContents(fn: (file: string, content: string) => void): void;
94 - join(sep: string): SourceNode;
95 - replaceRight(pattern: string, replacement: string): SourceNode;
96 - toString(): string;
97 - toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap;
98 -}
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('./lib/source-map-generator').SourceMapGenerator;
7 -exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;
8 -exports.SourceNode = require('./lib/source-node').SourceNode;
1 -{
2 - "_from": "css@^2.0.0",
3 - "_id": "css@2.2.4",
4 - "_inBundle": false,
5 - "_integrity": "sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw==",
6 - "_location": "/css",
7 - "_phantomChildren": {},
8 - "_requested": {
9 - "type": "range",
10 - "registry": true,
11 - "raw": "css@^2.0.0",
12 - "name": "css",
13 - "escapedName": "css",
14 - "rawSpec": "^2.0.0",
15 - "saveSpec": null,
16 - "fetchSpec": "^2.0.0"
17 - },
18 - "_requiredBy": [
19 - "/rework"
20 - ],
21 - "_resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz",
22 - "_shasum": "c646755c73971f2bba6a601e2cf2fd71b1298929",
23 - "_spec": "css@^2.0.0",
24 - "_where": "C:\\Users\\kkwan_000\\Desktop\\git\\2017110269\\minsung\\node_modules\\rework",
25 - "author": {
26 - "name": "TJ Holowaychuk",
27 - "email": "tj@vision-media.ca"
28 - },
29 - "bugs": {
30 - "url": "https://github.com/reworkcss/css/issues"
31 - },
32 - "bundleDependencies": false,
33 - "dependencies": {
34 - "inherits": "^2.0.3",
35 - "source-map": "^0.6.1",
36 - "source-map-resolve": "^0.5.2",
37 - "urix": "^0.1.0"
38 - },
39 - "deprecated": false,
40 - "description": "CSS parser / stringifier",
41 - "devDependencies": {
42 - "bytes": "^1.0.0",
43 - "matcha": "^0.5.0",
44 - "mocha": "^1.21.3",
45 - "should": "^4.0.4"
46 - },
47 - "files": [
48 - "index.js",
49 - "lib",
50 - "Readme.md"
51 - ],
52 - "homepage": "https://github.com/reworkcss/css#readme",
53 - "keywords": [
54 - "css",
55 - "parser",
56 - "stringifier",
57 - "stylesheet"
58 - ],
59 - "license": "MIT",
60 - "main": "index",
61 - "name": "css",
62 - "repository": {
63 - "type": "git",
64 - "url": "git+https://github.com/reworkcss/css.git"
65 - },
66 - "scripts": {
67 - "benchmark": "matcha",
68 - "test": "mocha --require should --reporter spec --bail test/*.js"
69 - },
70 - "version": "2.2.4"
71 -}
1 -# Changes to cssdb
2 -
3 -### 4.4.0 (March 7, 2019)
4 -
5 -- Updated: Nesting Rules are now Stage 1! 🎉
6 -
7 -### 4.3.0 (December 12, 2018)
8 -
9 -- Added: `:blank` Empty-Value Pseudo-Class
10 -- Added: caniuse link for `:has()` Relational Pseudo-Class
11 -- Added: JavaScript Library and PostCSS Plugin links for the `:blank`
12 - Empty-Value Pseudo-Class and the `:has()` Relational Pseudo-Class
13 -
14 -### 4.2.0 (November 4, 2018)
15 -
16 -- Added: Documentation links to MDN
17 -- Added: `color-adjust` Property
18 -- Added: `overscroll-behavior` Property
19 -- Added: `prefers-color-scheme` Media Query
20 -- Added: `prefers-reduced-motion` Media Query
21 -- Added: `:in-range` and `:out-of-range` Pseudo-Classes
22 -- Added: `:read-only` and `:read-write` selectors
23 -
24 -This also updates the cssdb.org template and styles, using postcss-preset-env
25 -to create and minifying cross-browser compatible css, improving font loading
26 -and display, supporting RTL displays, and adding MDN documentation.
27 -
28 -### 4.1.1 (October 28, 2018)
29 -
30 -- Added: caniuse link for `overflow` shorthand property
31 -
32 -### 4.1.0 (October 28, 2018)
33 -
34 -- Added: Double Position Gradients
35 -
36 -### 4.0.0 (October 23, 2018)
37 -
38 -- Changed: `:something()` is now `:where()` and moved from Stage 2 to Stage 1
39 -
40 -### 3.2.1 (August 31st, 2018)
41 -
42 -- Updated: caniuse-like browser statistics for Custom Environment Variables
43 -
44 -I really wish caniuse would start adding some of these.
45 -
46 -### 3.2.0 (August 30th, 2018)
47 -
48 -- Removed: Rejected `color-mod()` function
49 -- Updated: Overflow shorthand is now Stage 2
50 -- Updated: caniuse-like browser statistics for Custom Environment Variables and
51 - Overflow Shorthand
52 -
53 -### 3.1.0 (May 11th, 2018)
54 -
55 -- Added: Polyfills for `lab-function` and `lch-function`
56 -
57 -### 3.0.0 (May 10th, 2018)
58 -
59 -- Changed: All stages from 1-4 to 0-4 to align with TC39
60 -- Updated: Tests, badges, descriptions, and dependencies
61 -
62 -### 2.2.0 (May 7th, 2018)
63 -
64 -- Added: Place Properties as Stage 2
65 -- Added: PostCSS plugin for Color Functional Notation
66 -- Updated: Media Query Ranges to Stage 4
67 -
68 -### 2.1.0 (May 1st, 2018)
69 -
70 -- Added: Environment Variables as Stage 1
71 -- Added: `overflow` Property as Stage 2
72 -- Added: Gap Properties as Stage 4
73 -
74 -### 2.0.0 (April 7th, 2018)
75 -
76 -- Renamed: GitHub repository from `css-db` to `cssdb`, now aligning with npm
77 -- Renamed: All feature IDs.
78 -- Updated: Documentation.
79 -
80 -Notes: The old feature IDs were problematic because they attempted to follow
81 -specification section IDs, but some specifications weren’t aren’t always
82 -covered by a single section, and many sections were inconsistently named.
83 -Because there was no pattern one could predict for any of the headings, a new
84 -system was created; to **name** the feature and provide **context**. This meant
85 -a feature ID like `css-cascade-all-shorthand` became `all-property`, and
86 -`css-fonts-propdef-font-variant` became `font-variant-property`, etc. This
87 -greatly simplified all of the feature IDs and allowed for more predictive
88 -naming moving forward.
89 -
90 -### 1.6.0 (February 18th, 2018)
91 -
92 -- Added: Break Properties
93 -
94 -### 1.5.2 (February 18th, 2018)
95 -
96 -- Updated: `:focus-within` polyfills
97 -
98 -### 1.5.1 (February 17th, 2018)
99 -
100 -- Fixed: `:focus-visible` and `:focus-within` title syntax
101 -
102 -### 1.5.0 (January 22th, 2018)
103 -
104 -- Changed: Use the latest published specification URL whenever possible
105 -- Changed: Upgrade Color #RRGGBBAA Notation to Stage 3
106 -- Changed: Upgrade Color gray() Function to Stage 3
107 -- Changed: Upgrade Color color-mod() Function to Stage 3
108 -- Changed: Upgrade Color hwb() Function to Stage 3
109 -- Changed: Downgrade Custom Properties to Stage 4
110 -- Fixed: Color hwb() Function example
111 -- Fixed: the Color rebeccapurple PostCSS Plugin URL
112 -
113 -### 1.4.0 (January 16th, 2018)
114 -
115 -- Changed: polyfill for `css-color-modifying-colors`
116 -
117 -### 1.3.0 (January 8th, 2018)
118 -
119 -- Added: caniuse references for `css-logical` and `css-fonts-system-ui-def`
120 -- Fixed: caniuse parsing for browser support
121 -
122 -### 1.2.0 (January 8th, 2018)
123 -
124 -- Fixed: specification identifiers for `css-color-hwb-notation`,
125 - `selectors-dir-pseudo`
126 -- Fixed: Examples for Media Queries Custom Media Queries
127 -
128 -### 1.1.0 (September 27th, 2017)
129 -
130 -- Added: Image `image-set()` Function, Selector `:dir` Pseudo-Class,
131 - Selector `:any-link` Pseudo-Class, Text `overflow-wrap` Property,
132 - Font `system-ui` Family, Cascade `all` Property
133 -- Added: caniuse identifiers
134 -- Fixed: Examples for Nesting, Media Queries Ranges
135 -
136 -### 1.0.0 (September 6th, 2017)
137 -
138 -- Initial version
1 -# CC0 1.0 Universal
2 -
3 -## Statement of Purpose
4 -
5 -The laws of most jurisdictions throughout the world automatically confer
6 -exclusive Copyright and Related Rights (defined below) upon the creator and
7 -subsequent owner(s) (each and all, an “owner”) of an original work of
8 -authorship and/or a database (each, a “Work”).
9 -
10 -Certain owners wish to permanently relinquish those rights to a Work for the
11 -purpose of contributing to a commons of creative, cultural and scientific works
12 -(“Commons”) that the public can reliably and without fear of later claims of
13 -infringement build upon, modify, incorporate in other works, reuse and
14 -redistribute as freely as possible in any form whatsoever and for any purposes,
15 -including without limitation commercial purposes. These owners may contribute
16 -to the Commons to promote the ideal of a free culture and the further
17 -production of creative, cultural and scientific works, or to gain reputation or
18 -greater distribution for their Work in part through the use and efforts of
19 -others.
20 -
21 -For these and/or other purposes and motivations, and without any expectation of
22 -additional consideration or compensation, the person associating CC0 with a
23 -Work (the “Affirmer”), to the extent that he or she is an owner of Copyright
24 -and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and
25 -publicly distribute the Work under its terms, with knowledge of his or her
26 -Copyright and Related Rights in the Work and the meaning and intended legal
27 -effect of CC0 on those rights.
28 -
29 -1. Copyright and Related Rights. A Work made available under CC0 may be
30 - protected by copyright and related or neighboring rights (“Copyright and
31 - Related Rights”). Copyright and Related Rights include, but are not limited
32 - to, the following:
33 - 1. the right to reproduce, adapt, distribute, perform, display,
34 - communicate, and translate a Work;
35 - 2. moral rights retained by the original author(s) and/or performer(s);
36 - 3. publicity and privacy rights pertaining to a person’s image or likeness
37 - depicted in a Work;
38 - 4. rights protecting against unfair competition in regards to a Work,
39 - subject to the limitations in paragraph 4(i), below;
40 - 5. rights protecting the extraction, dissemination, use and reuse of data
41 - in a Work;
42 - 6. database rights (such as those arising under Directive 96/9/EC of the
43 - European Parliament and of the Council of 11 March 1996 on the legal
44 - protection of databases, and under any national implementation thereof,
45 - including any amended or successor version of such directive); and
46 - 7. other similar, equivalent or corresponding rights throughout the world
47 - based on applicable law or treaty, and any national implementations
48 - thereof.
49 -
50 -2. Waiver. To the greatest extent permitted by, but not in contravention of,
51 -applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
52 -unconditionally waives, abandons, and surrenders all of Affirmer’s Copyright
53 -and Related Rights and associated claims and causes of action, whether now
54 -known or unknown (including existing as well as future claims and causes of
55 -action), in the Work (i) in all territories worldwide, (ii) for the maximum
56 -duration provided by applicable law or treaty (including future time
57 -extensions), (iii) in any current or future medium and for any number of
58 -copies, and (iv) for any purpose whatsoever, including without limitation
59 -commercial, advertising or promotional purposes (the “Waiver”). Affirmer makes
60 -the Waiver for the benefit of each member of the public at large and to the
61 -detriment of Affirmer’s heirs and successors, fully intending that such Waiver
62 -shall not be subject to revocation, rescission, cancellation, termination, or
63 -any other legal or equitable action to disrupt the quiet enjoyment of the Work
64 -by the public as contemplated by Affirmer’s express Statement of Purpose.
65 -
66 -3. Public License Fallback. Should any part of the Waiver for any reason be
67 -judged legally invalid or ineffective under applicable law, then the Waiver
68 -shall be preserved to the maximum extent permitted taking into account
69 -Affirmer’s express Statement of Purpose. In addition, to the extent the Waiver
70 -is so judged Affirmer hereby grants to each affected person a royalty-free, non
71 -transferable, non sublicensable, non exclusive, irrevocable and unconditional
72 -license to exercise Affirmer’s Copyright and Related Rights in the Work (i) in
73 -all territories worldwide, (ii) for the maximum duration provided by applicable
74 -law or treaty (including future time extensions), (iii) in any current or
75 -future medium and for any number of copies, and (iv) for any purpose
76 -whatsoever, including without limitation commercial, advertising or promotional
77 -purposes (the “License”). The License shall be deemed effective as of the date
78 -CC0 was applied by Affirmer to the Work. Should any part of the License for any
79 -reason be judged legally invalid or ineffective under applicable law, such
80 -partial invalidity or ineffectiveness shall not invalidate the remainder of the
81 -License, and in such case Affirmer hereby affirms that he or she will not (i)
82 -exercise any of his or her remaining Copyright and Related Rights in the Work
83 -or (ii) assert any associated claims and causes of action with respect to the
84 -Work, in either case contrary to Affirmer’s express Statement of Purpose.
85 -
86 -4. Limitations and Disclaimers.
87 - 1. No trademark or patent rights held by Affirmer are waived, abandoned,
88 - surrendered, licensed or otherwise affected by this document.
89 - 2. Affirmer offers the Work as-is and makes no representations or
90 - warranties of any kind concerning the Work, express, implied, statutory
91 - or otherwise, including without limitation warranties of title,
92 - merchantability, fitness for a particular purpose, non infringement, or
93 - the absence of latent or other defects, accuracy, or the present or
94 - absence of errors, whether or not discoverable, all to the greatest
95 - extent permissible under applicable law.
96 - 3. Affirmer disclaims responsibility for clearing rights of other persons
97 - that may apply to the Work or any use thereof, including without
98 - limitation any person’s Copyright and Related Rights in the Work.
99 - Further, Affirmer disclaims responsibility for obtaining any necessary
100 - consents, permissions or other rights required for any use of the Work.
101 - 4. Affirmer understands and acknowledges that Creative Commons is not a
102 - party to this document and has no duty or obligation with respect to
103 - this CC0 or use of the Work.
104 -
105 -For more information, please see
106 -https://creativecommons.org/publicdomain/zero/1.0/.
1 -# cssdb [<img src="https://cssdb.org/cssdb.svg" alt="cssdb logo" width="90" height="90" align="right">][cssdb]
2 -
3 -[![NPM Version][npm-img]][npm-url]
4 -[![Build Status][cli-img]][cli-url]
5 -
6 -[cssdb] is a comprehensive list of CSS features and their positions in
7 -the process of becoming implemented web standards.
8 -
9 ----
10 -
11 -Did you come here to update the status of a CSS feature or add a new one?
12 -Quick, read [CONTRIBUTING.md](CONTRIBUTING.md).
13 -
14 -Did you come here to learn about the stages? Quick, read [STAGES.md](STAGES.md).
15 -
16 ----
17 -
18 -[cssdb] ranks CSS features by stages that reflect the real-life stability of
19 -new CSS features.
20 -
21 -You can read an [inside view of the CSSWG] to learn about the official
22 -(and unofficial) development stages of CSS specifications. In reality,
23 -specifications and browser implementations happen out of sync. For example,
24 -there are stable CSS features missing in all browsers, while other CSS features
25 -developed outside the [CSSWG] have appeared in browsers behind flags. This is
26 -too ambiguous for the web development community, and a more accountable process
27 -is desired.
28 -
29 -[cli-img]: https://img.shields.io/travis/csstools/cssdb.svg
30 -[cli-url]: https://travis-ci.org/csstools/cssdb
31 -[cssdb]: https://github.com/csstools/cssdb
32 -[CSSWG]: https://wiki.csswg.org/spec
33 -[inside view of the CSSWG]: http://fantasai.inkedblade.net/weblog/2011/inside-csswg/process
34 -[npm-img]: https://img.shields.io/npm/v/cssdb.svg
35 -[npm-url]: https://www.npmjs.com/package/cssdb
This diff is collapsed. Click to expand it.
1 -{
2 - "_from": "cssdb@^4.4.0",
3 - "_id": "cssdb@4.4.0",
4 - "_inBundle": false,
5 - "_integrity": "sha512-LsTAR1JPEM9TpGhl/0p3nQecC2LJ0kD8X5YARu1hk/9I1gril5vDtMZyNxcEpxxDj34YNck/ucjuoUd66K03oQ==",
6 - "_location": "/cssdb",
7 - "_phantomChildren": {},
8 - "_requested": {
9 - "type": "range",
10 - "registry": true,
11 - "raw": "cssdb@^4.4.0",
12 - "name": "cssdb",
13 - "escapedName": "cssdb",
14 - "rawSpec": "^4.4.0",
15 - "saveSpec": null,
16 - "fetchSpec": "^4.4.0"
17 - },
18 - "_requiredBy": [
19 - "/postcss-preset-env"
20 - ],
21 - "_resolved": "https://registry.npmjs.org/cssdb/-/cssdb-4.4.0.tgz",
22 - "_shasum": "3bf2f2a68c10f5c6a08abd92378331ee803cddb0",
23 - "_spec": "cssdb@^4.4.0",
24 - "_where": "C:\\Users\\kkwan_000\\Desktop\\git\\2017110269\\minsung\\node_modules\\postcss-preset-env",
25 - "author": {
26 - "name": "Jonathan Neal",
27 - "email": "jonathantneal@hotmail.com"
28 - },
29 - "bugs": {
30 - "url": "https://github.com/csstools/cssdb/issues"
31 - },
32 - "bundleDependencies": false,
33 - "deprecated": false,
34 - "description": "A comprehensive list of CSS features and their positions in the process of becoming implemented web standards",
35 - "devDependencies": {
36 - "browserslist": "^4.4.2",
37 - "caniuse-lite": "^1.0.30000942",
38 - "cssnano": "^4.1.10",
39 - "eslit": "^6.0.0",
40 - "fse": "^4.0.1",
41 - "http-server": "^0.11.1",
42 - "marked": "^0.6.1",
43 - "node-fetch": "^2.3.0",
44 - "postcss": "^7.0.14",
45 - "postcss-preset-env": "^6.6.0",
46 - "pre-commit": "^1.2.2",
47 - "stylelint": "^9.10.1",
48 - "stylelint-config-dev": "^4.0.0"
49 - },
50 - "files": [
51 - "cssdb.json"
52 - ],
53 - "homepage": "https://github.com/csstools/cssdb#readme",
54 - "keywords": [
55 - "css",
56 - "features",
57 - "list",
58 - "specifications",
59 - "stages",
60 - "tc39"
61 - ],
62 - "license": "CC0-1.0",
63 - "main": "cssdb.json",
64 - "name": "cssdb",
65 - "repository": {
66 - "type": "git",
67 - "url": "git+https://github.com/csstools/cssdb.git"
68 - },
69 - "scripts": {
70 - "start": "node tasks/start",
71 - "start:nobadges": "node tasks/start --no-badges",
72 - "test": "npm run test:css && npm run test:json",
73 - "test:css": "stylelint tasks/style-template.css",
74 - "test:json": "node tasks/test",
75 - "watch": "http-server gh-pages"
76 - },
77 - "stylelint": {
78 - "extends": "stylelint-config-dev"
79 - },
80 - "version": "4.4.0"
81 -}
1 -Copyright Mathias Bynens <https://mathiasbynens.be/>
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.
1 -# cssesc [![Build status](https://travis-ci.org/mathiasbynens/cssesc.svg?branch=master)](https://travis-ci.org/mathiasbynens/cssesc) [![Code coverage status](https://img.shields.io/codecov/c/github/mathiasbynens/cssesc.svg)](https://codecov.io/gh/mathiasbynens/cssesc)
2 -
3 -A JavaScript library for escaping CSS strings and identifiers while generating the shortest possible ASCII-only output.
4 -
5 -This is a JavaScript library for [escaping text for use in CSS strings or identifiers](https://mathiasbynens.be/notes/css-escapes) while generating the shortest possible valid ASCII-only output. [Here’s an online demo.](https://mothereff.in/css-escapes)
6 -
7 -[A polyfill for the CSSOM `CSS.escape()` method is available in a separate repository.](https://mths.be/cssescape) (In comparison, _cssesc_ is much more powerful.)
8 -
9 -Feel free to fork if you see possible improvements!
10 -
11 -## Installation
12 -
13 -Via [npm](https://www.npmjs.com/):
14 -
15 -```bash
16 -npm install cssesc
17 -```
18 -
19 -In a browser:
20 -
21 -```html
22 -<script src="cssesc.js"></script>
23 -```
24 -
25 -In [Node.js](https://nodejs.org/):
26 -
27 -```js
28 -const cssesc = require('cssesc');
29 -```
30 -
31 -In Ruby using [the `ruby-cssesc` wrapper gem](https://github.com/borodean/ruby-cssesc):
32 -
33 -```bash
34 -gem install ruby-cssesc
35 -```
36 -
37 -```ruby
38 -require 'ruby-cssesc'
39 -CSSEsc.escape('I ♥ Ruby', is_identifier: true)
40 -```
41 -
42 -In Sass using [`sassy-escape`](https://github.com/borodean/sassy-escape):
43 -
44 -```bash
45 -gem install sassy-escape
46 -```
47 -
48 -```scss
49 -body {
50 - content: escape('I ♥ Sass', $is-identifier: true);
51 -}
52 -```
53 -
54 -## API
55 -
56 -### `cssesc(value, options)`
57 -
58 -This function takes a value and returns an escaped version of the value where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in CSS strings or identifiers](https://mathiasbynens.be/notes/css-escapes).
59 -
60 -```js
61 -cssesc('Ich ♥ Bücher');
62 -// → 'Ich \\2665 B\\FC cher'
63 -
64 -cssesc('foo 𝌆 bar');
65 -// → 'foo \\1D306 bar'
66 -```
67 -
68 -By default, `cssesc` returns a string that can be used as part of a CSS string. If the target is a CSS identifier rather than a CSS string, use the `isIdentifier: true` setting (see below).
69 -
70 -The optional `options` argument accepts an object with the following options:
71 -
72 -#### `isIdentifier`
73 -
74 -The default value for the `isIdentifier` option is `false`. This means that the input text will be escaped for use in a CSS string literal. If you want to use the result as a CSS identifier instead (in a selector, for example), set this option to `true`.
75 -
76 -```js
77 -cssesc('123a2b');
78 -// → '123a2b'
79 -
80 -cssesc('123a2b', {
81 - 'isIdentifier': true
82 -});
83 -// → '\\31 23a2b'
84 -```
85 -
86 -#### `quotes`
87 -
88 -The default value for the `quotes` option is `'single'`. This means that any occurences of `'` in the input text will be escaped as `\'`, so that the output can be used in a CSS string literal wrapped in single quotes.
89 -
90 -```js
91 -cssesc('Lorem ipsum "dolor" sit \'amet\' etc.');
92 -// → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.'
93 -// → "Lorem ipsum \"dolor\" sit \\'amet\\' etc."
94 -
95 -cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
96 - 'quotes': 'single'
97 -});
98 -// → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.'
99 -// → "Lorem ipsum \"dolor\" sit \\'amet\\' etc."
100 -```
101 -
102 -If you want to use the output as part of a CSS string literal wrapped in double quotes, set the `quotes` option to `'double'`.
103 -
104 -```js
105 -cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
106 - 'quotes': 'double'
107 -});
108 -// → 'Lorem ipsum \\"dolor\\" sit \'amet\' etc.'
109 -// → "Lorem ipsum \\\"dolor\\\" sit 'amet' etc."
110 -```
111 -
112 -#### `wrap`
113 -
114 -The `wrap` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output will be a valid CSS string literal wrapped in quotes. The type of quotes can be specified through the `quotes` setting.
115 -
116 -```js
117 -cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
118 - 'quotes': 'single',
119 - 'wrap': true
120 -});
121 -// → '\'Lorem ipsum "dolor" sit \\\'amet\\\' etc.\''
122 -// → "\'Lorem ipsum \"dolor\" sit \\\'amet\\\' etc.\'"
123 -
124 -cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
125 - 'quotes': 'double',
126 - 'wrap': true
127 -});
128 -// → '"Lorem ipsum \\"dolor\\" sit \'amet\' etc."'
129 -// → "\"Lorem ipsum \\\"dolor\\\" sit \'amet\' etc.\""
130 -```
131 -
132 -#### `escapeEverything`
133 -
134 -The `escapeEverything` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, all the symbols in the output will be escaped, even printable ASCII symbols.
135 -
136 -```js
137 -cssesc('lolwat"foo\'bar', {
138 - 'escapeEverything': true
139 -});
140 -// → '\\6C\\6F\\6C\\77\\61\\74\\"\\66\\6F\\6F\\\'\\62\\61\\72'
141 -// → "\\6C\\6F\\6C\\77\\61\\74\\\"\\66\\6F\\6F\\'\\62\\61\\72"
142 -```
143 -
144 -#### Overriding the default options globally
145 -
146 -The global default settings can be overridden by modifying the `css.options` object. This saves you from passing in an `options` object for every call to `encode` if you want to use the non-default setting.
147 -
148 -```js
149 -// Read the global default setting for `escapeEverything`:
150 -cssesc.options.escapeEverything;
151 -// → `false` by default
152 -
153 -// Override the global default setting for `escapeEverything`:
154 -cssesc.options.escapeEverything = true;
155 -
156 -// Using the global default setting for `escapeEverything`, which is now `true`:
157 -cssesc('foo © bar ≠ baz 𝌆 qux');
158 -// → '\\66\\6F\\6F\\ \\A9\\ \\62\\61\\72\\ \\2260\\ \\62\\61\\7A\\ \\1D306\\ \\71\\75\\78'
159 -```
160 -
161 -### `cssesc.version`
162 -
163 -A string representing the semantic version number.
164 -
165 -### Using the `cssesc` binary
166 -
167 -To use the `cssesc` binary in your shell, simply install cssesc globally using npm:
168 -
169 -```bash
170 -npm install -g cssesc
171 -```
172 -
173 -After that you will be able to escape text for use in CSS strings or identifiers from the command line:
174 -
175 -```bash
176 -$ cssesc 'föo ♥ bår 𝌆 baz'
177 -f\F6o \2665 b\E5r \1D306 baz
178 -```
179 -
180 -If the output needs to be a CSS identifier rather than part of a string literal, use the `-i`/`--identifier` option:
181 -
182 -```bash
183 -$ cssesc --identifier 'föo ♥ bår 𝌆 baz'
184 -f\F6o\ \2665\ b\E5r\ \1D306\ baz
185 -```
186 -
187 -See `cssesc --help` for the full list of options.
188 -
189 -## Support
190 -
191 -This library supports the Node.js and browser versions mentioned in [`.babelrc`](https://github.com/mathiasbynens/cssesc/blob/master/.babelrc). For a version that supports a wider variety of legacy browsers and environments out-of-the-box, [see v0.1.0](https://github.com/mathiasbynens/cssesc/releases/tag/v0.1.0).
192 -
193 -## Author
194 -
195 -| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
196 -|---|
197 -| [Mathias Bynens](https://mathiasbynens.be/) |
198 -
199 -## License
200 -
201 -This library is available under the [MIT](https://mths.be/mit) license.
1 -#!/usr/bin/env node
2 -const fs = require('fs');
3 -const cssesc = require('../cssesc.js');
4 -const strings = process.argv.splice(2);
5 -const stdin = process.stdin;
6 -const options = {};
7 -const log = console.log;
8 -
9 -const main = function() {
10 - const option = strings[0];
11 -
12 - if (/^(?:-h|--help|undefined)$/.test(option)) {
13 - log(
14 - 'cssesc v%s - https://mths.be/cssesc',
15 - cssesc.version
16 - );
17 - log([
18 - '\nUsage:\n',
19 - '\tcssesc [string]',
20 - '\tcssesc [-i | --identifier] [string]',
21 - '\tcssesc [-s | --single-quotes] [string]',
22 - '\tcssesc [-d | --double-quotes] [string]',
23 - '\tcssesc [-w | --wrap] [string]',
24 - '\tcssesc [-e | --escape-everything] [string]',
25 - '\tcssesc [-v | --version]',
26 - '\tcssesc [-h | --help]',
27 - '\nExamples:\n',
28 - '\tcssesc \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
29 - '\tcssesc --identifier \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
30 - '\tcssesc --escape-everything \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
31 - '\tcssesc --double-quotes --wrap \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
32 - '\techo \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\' | cssesc'
33 - ].join('\n'));
34 - return process.exit(1);
35 - }
36 -
37 - if (/^(?:-v|--version)$/.test(option)) {
38 - log('v%s', cssesc.version);
39 - return process.exit(1);
40 - }
41 -
42 - strings.forEach(function(string) {
43 - // Process options
44 - if (/^(?:-i|--identifier)$/.test(string)) {
45 - options.isIdentifier = true;
46 - return;
47 - }
48 - if (/^(?:-s|--single-quotes)$/.test(string)) {
49 - options.quotes = 'single';
50 - return;
51 - }
52 - if (/^(?:-d|--double-quotes)$/.test(string)) {
53 - options.quotes = 'double';
54 - return;
55 - }
56 - if (/^(?:-w|--wrap)$/.test(string)) {
57 - options.wrap = true;
58 - return;
59 - }
60 - if (/^(?:-e|--escape-everything)$/.test(string)) {
61 - options.escapeEverything = true;
62 - return;
63 - }
64 -
65 - // Process string(s)
66 - let result;
67 - try {
68 - result = cssesc(string, options);
69 - log(result);
70 - } catch (exception) {
71 - log(exception.message + '\n');
72 - log('Error: failed to escape.');
73 - log('If you think this is a bug in cssesc, please report it:');
74 - log('https://github.com/mathiasbynens/cssesc/issues/new');
75 - log(
76 - '\nStack trace using cssesc@%s:\n',
77 - cssesc.version
78 - );
79 - log(exception.stack);
80 - return process.exit(1);
81 - }
82 - });
83 - // Return with exit status 0 outside of the `forEach` loop, in case
84 - // multiple strings were passed in.
85 - return process.exit(0);
86 -
87 -};
88 -
89 -if (stdin.isTTY) {
90 - // handle shell arguments
91 - main();
92 -} else {
93 - let timeout;
94 - // Either the script is called from within a non-TTY context, or `stdin`
95 - // content is being piped in.
96 - if (!process.stdout.isTTY) {
97 - // The script was called from a non-TTY context. This is a rather uncommon
98 - // use case we don’t actively support. However, we don’t want the script
99 - // to wait forever in such cases, so…
100 - timeout = setTimeout(function() {
101 - // …if no piped data arrived after a whole minute, handle shell
102 - // arguments instead.
103 - main();
104 - }, 60000);
105 - }
106 - let data = '';
107 - stdin.on('data', function(chunk) {
108 - clearTimeout(timeout);
109 - data += chunk;
110 - });
111 - stdin.on('end', function() {
112 - strings.push(data.trim());
113 - main();
114 - });
115 - stdin.resume();
116 -}
1 -/*! https://mths.be/cssesc v3.0.0 by @mathias */
2 -'use strict';
3 -
4 -var object = {};
5 -var hasOwnProperty = object.hasOwnProperty;
6 -var merge = function merge(options, defaults) {
7 - if (!options) {
8 - return defaults;
9 - }
10 - var result = {};
11 - for (var key in defaults) {
12 - // `if (defaults.hasOwnProperty(key) { … }` is not needed here, since
13 - // only recognized option names are used.
14 - result[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key];
15 - }
16 - return result;
17 -};
18 -
19 -var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/;
20 -var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/;
21 -var regexAlwaysEscape = /['"\\]/;
22 -var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;
23 -
24 -// https://mathiasbynens.be/notes/css-escapes#css
25 -var cssesc = function cssesc(string, options) {
26 - options = merge(options, cssesc.options);
27 - if (options.quotes != 'single' && options.quotes != 'double') {
28 - options.quotes = 'single';
29 - }
30 - var quote = options.quotes == 'double' ? '"' : '\'';
31 - var isIdentifier = options.isIdentifier;
32 -
33 - var firstChar = string.charAt(0);
34 - var output = '';
35 - var counter = 0;
36 - var length = string.length;
37 - while (counter < length) {
38 - var character = string.charAt(counter++);
39 - var codePoint = character.charCodeAt();
40 - var value = void 0;
41 - // If it’s not a printable ASCII character…
42 - if (codePoint < 0x20 || codePoint > 0x7E) {
43 - if (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) {
44 - // It’s a high surrogate, and there is a next character.
45 - var extra = string.charCodeAt(counter++);
46 - if ((extra & 0xFC00) == 0xDC00) {
47 - // next character is low surrogate
48 - codePoint = ((codePoint & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000;
49 - } else {
50 - // It’s an unmatched surrogate; only append this code unit, in case
51 - // the next code unit is the high surrogate of a surrogate pair.
52 - counter--;
53 - }
54 - }
55 - value = '\\' + codePoint.toString(16).toUpperCase() + ' ';
56 - } else {
57 - if (options.escapeEverything) {
58 - if (regexAnySingleEscape.test(character)) {
59 - value = '\\' + character;
60 - } else {
61 - value = '\\' + codePoint.toString(16).toUpperCase() + ' ';
62 - }
63 - } else if (/[\t\n\f\r\x0B]/.test(character)) {
64 - value = '\\' + codePoint.toString(16).toUpperCase() + ' ';
65 - } else if (character == '\\' || !isIdentifier && (character == '"' && quote == character || character == '\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) {
66 - value = '\\' + character;
67 - } else {
68 - value = character;
69 - }
70 - }
71 - output += value;
72 - }
73 -
74 - if (isIdentifier) {
75 - if (/^-[-\d]/.test(output)) {
76 - output = '\\-' + output.slice(1);
77 - } else if (/\d/.test(firstChar)) {
78 - output = '\\3' + firstChar + ' ' + output.slice(1);
79 - }
80 - }
81 -
82 - // Remove spaces after `\HEX` escapes that are not followed by a hex digit,
83 - // since they’re redundant. Note that this is only possible if the escape
84 - // sequence isn’t preceded by an odd number of backslashes.
85 - output = output.replace(regexExcessiveSpaces, function ($0, $1, $2) {
86 - if ($1 && $1.length % 2) {
87 - // It’s not safe to remove the space, so don’t.
88 - return $0;
89 - }
90 - // Strip the space.
91 - return ($1 || '') + $2;
92 - });
93 -
94 - if (!isIdentifier && options.wrap) {
95 - return quote + output + quote;
96 - }
97 - return output;
98 -};
99 -
100 -// Expose default options (so they can be overridden globally).
101 -cssesc.options = {
102 - 'escapeEverything': false,
103 - 'isIdentifier': false,
104 - 'quotes': 'single',
105 - 'wrap': false
106 -};
107 -
108 -cssesc.version = '3.0.0';
109 -
110 -module.exports = cssesc;
1 -.Dd August 9, 2013
2 -.Dt cssesc 1
3 -.Sh NAME
4 -.Nm cssesc
5 -.Nd escape text for use in CSS string literals or identifiers
6 -.Sh SYNOPSIS
7 -.Nm
8 -.Op Fl i | -identifier Ar string
9 -.br
10 -.Op Fl s | -single-quotes Ar string
11 -.br
12 -.Op Fl d | -double-quotes Ar string
13 -.br
14 -.Op Fl w | -wrap Ar string
15 -.br
16 -.Op Fl e | -escape-everything Ar string
17 -.br
18 -.Op Fl v | -version
19 -.br
20 -.Op Fl h | -help
21 -.Sh DESCRIPTION
22 -.Nm
23 -escapes strings for use in CSS string literals or identifiers while generating the shortest possible valid ASCII-only output.
24 -.Sh OPTIONS
25 -.Bl -ohang -offset
26 -.It Sy "-s, --single-quotes"
27 -Escape any occurences of ' in the input string as \\', so that the output can be used in a CSS string literal wrapped in single quotes.
28 -.It Sy "-d, --double-quotes"
29 -Escape any occurences of " in the input string as \\", so that the output can be used in a CSS string literal wrapped in double quotes.
30 -.It Sy "-w, --wrap"
31 -Make sure the output is a valid CSS string literal wrapped in quotes. The type of quotes can be specified using the
32 -.Ar -s | --single-quotes
33 -or
34 -.Ar -d | --double-quotes
35 -settings.
36 -.It Sy "-e, --escape-everything"
37 -Escape all the symbols in the output, even printable ASCII symbols.
38 -.It Sy "-v, --version"
39 -Print cssesc's version.
40 -.It Sy "-h, --help"
41 -Show the help screen.
42 -.El
43 -.Sh EXIT STATUS
44 -The
45 -.Nm cssesc
46 -utility exits with one of the following values:
47 -.Pp
48 -.Bl -tag -width flag -compact
49 -.It Li 0
50 -.Nm
51 -successfully escaped the given text and printed the result.
52 -.It Li 1
53 -.Nm
54 -wasn't instructed to escape anything (for example, the
55 -.Ar --help
56 -flag was set); or, an error occurred.
57 -.El
58 -.Sh EXAMPLES
59 -.Bl -ohang -offset
60 -.It Sy "cssesc 'foo bar baz'"
61 -Print an escaped version of the given text.
62 -.It Sy echo\ 'foo bar baz'\ |\ cssesc
63 -Print an escaped version of the text that gets piped in.
64 -.El
65 -.Sh BUGS
66 -cssesc's bug tracker is located at <https://github.com/mathiasbynens/cssesc/issues>.
67 -.Sh AUTHOR
68 -Mathias Bynens <https://mathiasbynens.be/>
69 -.Sh WWW
70 -<https://mths.be/cssesc>
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.