format: prettify entire project
This commit is contained in:
2
node_modules/css-tree/cjs/syntax/config/generator.cjs
generated
vendored
2
node_modules/css-tree/cjs/syntax/config/generator.cjs
generated
vendored
@ -3,7 +3,7 @@
|
||||
const indexGenerate = require('../node/index-generate.cjs');
|
||||
|
||||
const config = {
|
||||
node: indexGenerate
|
||||
node: indexGenerate,
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
|
6
node_modules/css-tree/cjs/syntax/config/lexer.cjs
generated
vendored
6
node_modules/css-tree/cjs/syntax/config/lexer.cjs
generated
vendored
@ -4,9 +4,9 @@ const data = require('../../data.cjs');
|
||||
const index = require('../node/index.cjs');
|
||||
|
||||
const lexerConfig = {
|
||||
generic: true,
|
||||
...data,
|
||||
node: index
|
||||
generic: true,
|
||||
...data,
|
||||
node: index,
|
||||
};
|
||||
|
||||
module.exports = lexerConfig;
|
||||
|
199
node_modules/css-tree/cjs/syntax/config/mix.cjs
generated
vendored
199
node_modules/css-tree/cjs/syntax/config/mix.cjs
generated
vendored
@ -2,139 +2,136 @@
|
||||
|
||||
const { hasOwnProperty } = Object.prototype;
|
||||
const shape = {
|
||||
generic: true,
|
||||
types: appendOrAssign,
|
||||
atrules: {
|
||||
prelude: appendOrAssignOrNull,
|
||||
descriptors: appendOrAssignOrNull
|
||||
},
|
||||
properties: appendOrAssign,
|
||||
parseContext: assign,
|
||||
scope: deepAssign,
|
||||
atrule: ['parse'],
|
||||
pseudo: ['parse'],
|
||||
node: ['name', 'structure', 'parse', 'generate', 'walkContext']
|
||||
generic: true,
|
||||
types: appendOrAssign,
|
||||
atrules: {
|
||||
prelude: appendOrAssignOrNull,
|
||||
descriptors: appendOrAssignOrNull,
|
||||
},
|
||||
properties: appendOrAssign,
|
||||
parseContext: assign,
|
||||
scope: deepAssign,
|
||||
atrule: ['parse'],
|
||||
pseudo: ['parse'],
|
||||
node: ['name', 'structure', 'parse', 'generate', 'walkContext'],
|
||||
};
|
||||
|
||||
function isObject(value) {
|
||||
return value && value.constructor === Object;
|
||||
return value && value.constructor === Object;
|
||||
}
|
||||
|
||||
function copy(value) {
|
||||
return isObject(value)
|
||||
? { ...value }
|
||||
: value;
|
||||
return isObject(value) ? { ...value } : value;
|
||||
}
|
||||
|
||||
function assign(dest, src) {
|
||||
return Object.assign(dest, src);
|
||||
return Object.assign(dest, src);
|
||||
}
|
||||
|
||||
function deepAssign(dest, src) {
|
||||
for (const key in src) {
|
||||
if (hasOwnProperty.call(src, key)) {
|
||||
if (isObject(dest[key])) {
|
||||
deepAssign(dest[key], src[key]);
|
||||
} else {
|
||||
dest[key] = copy(src[key]);
|
||||
}
|
||||
}
|
||||
for (const key in src) {
|
||||
if (hasOwnProperty.call(src, key)) {
|
||||
if (isObject(dest[key])) {
|
||||
deepAssign(dest[key], src[key]);
|
||||
} else {
|
||||
dest[key] = copy(src[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return dest;
|
||||
return dest;
|
||||
}
|
||||
|
||||
function append(a, b) {
|
||||
if (typeof b === 'string' && /^\s*\|/.test(b)) {
|
||||
return typeof a === 'string'
|
||||
? a + b
|
||||
: b.replace(/^\s*\|\s*/, '');
|
||||
}
|
||||
if (typeof b === 'string' && /^\s*\|/.test(b)) {
|
||||
return typeof a === 'string' ? a + b : b.replace(/^\s*\|\s*/, '');
|
||||
}
|
||||
|
||||
return b || null;
|
||||
return b || null;
|
||||
}
|
||||
|
||||
function appendOrAssign(a, b) {
|
||||
if (typeof b === 'string') {
|
||||
return append(a, b);
|
||||
}
|
||||
if (typeof b === 'string') {
|
||||
return append(a, b);
|
||||
}
|
||||
|
||||
const result = { ...a };
|
||||
for (let key in b) {
|
||||
if (hasOwnProperty.call(b, key)) {
|
||||
result[key] = append(hasOwnProperty.call(a, key) ? a[key] : undefined, b[key]);
|
||||
}
|
||||
const result = { ...a };
|
||||
for (let key in b) {
|
||||
if (hasOwnProperty.call(b, key)) {
|
||||
result[key] = append(
|
||||
hasOwnProperty.call(a, key) ? a[key] : undefined,
|
||||
b[key]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
function appendOrAssignOrNull(a, b) {
|
||||
const result = appendOrAssign(a, b);
|
||||
const result = appendOrAssign(a, b);
|
||||
|
||||
return !isObject(result) || Object.keys(result).length
|
||||
? result
|
||||
: null;
|
||||
return !isObject(result) || Object.keys(result).length ? result : null;
|
||||
}
|
||||
|
||||
function mix(dest, src, shape) {
|
||||
for (const key in shape) {
|
||||
if (hasOwnProperty.call(shape, key) === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (shape[key] === true) {
|
||||
if (hasOwnProperty.call(src, key)) {
|
||||
dest[key] = copy(src[key]);
|
||||
}
|
||||
} else if (shape[key]) {
|
||||
if (typeof shape[key] === 'function') {
|
||||
const fn = shape[key];
|
||||
dest[key] = fn({}, dest[key]);
|
||||
dest[key] = fn(dest[key] || {}, src[key]);
|
||||
} else if (isObject(shape[key])) {
|
||||
const result = {};
|
||||
|
||||
for (let name in dest[key]) {
|
||||
result[name] = mix({}, dest[key][name], shape[key]);
|
||||
}
|
||||
|
||||
for (let name in src[key]) {
|
||||
result[name] = mix(result[name] || {}, src[key][name], shape[key]);
|
||||
}
|
||||
|
||||
dest[key] = result;
|
||||
} else if (Array.isArray(shape[key])) {
|
||||
const res = {};
|
||||
const innerShape = shape[key].reduce(function(s, k) {
|
||||
s[k] = true;
|
||||
return s;
|
||||
}, {});
|
||||
|
||||
for (const [name, value] of Object.entries(dest[key] || {})) {
|
||||
res[name] = {};
|
||||
if (value) {
|
||||
mix(res[name], value, innerShape);
|
||||
}
|
||||
}
|
||||
|
||||
for (const name in src[key]) {
|
||||
if (hasOwnProperty.call(src[key], name)) {
|
||||
if (!res[name]) {
|
||||
res[name] = {};
|
||||
}
|
||||
|
||||
if (src[key] && src[key][name]) {
|
||||
mix(res[name], src[key][name], innerShape);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dest[key] = res;
|
||||
}
|
||||
}
|
||||
for (const key in shape) {
|
||||
if (hasOwnProperty.call(shape, key) === false) {
|
||||
continue;
|
||||
}
|
||||
return dest;
|
||||
|
||||
if (shape[key] === true) {
|
||||
if (hasOwnProperty.call(src, key)) {
|
||||
dest[key] = copy(src[key]);
|
||||
}
|
||||
} else if (shape[key]) {
|
||||
if (typeof shape[key] === 'function') {
|
||||
const fn = shape[key];
|
||||
dest[key] = fn({}, dest[key]);
|
||||
dest[key] = fn(dest[key] || {}, src[key]);
|
||||
} else if (isObject(shape[key])) {
|
||||
const result = {};
|
||||
|
||||
for (let name in dest[key]) {
|
||||
result[name] = mix({}, dest[key][name], shape[key]);
|
||||
}
|
||||
|
||||
for (let name in src[key]) {
|
||||
result[name] = mix(result[name] || {}, src[key][name], shape[key]);
|
||||
}
|
||||
|
||||
dest[key] = result;
|
||||
} else if (Array.isArray(shape[key])) {
|
||||
const res = {};
|
||||
const innerShape = shape[key].reduce(function (s, k) {
|
||||
s[k] = true;
|
||||
return s;
|
||||
}, {});
|
||||
|
||||
for (const [name, value] of Object.entries(dest[key] || {})) {
|
||||
res[name] = {};
|
||||
if (value) {
|
||||
mix(res[name], value, innerShape);
|
||||
}
|
||||
}
|
||||
|
||||
for (const name in src[key]) {
|
||||
if (hasOwnProperty.call(src[key], name)) {
|
||||
if (!res[name]) {
|
||||
res[name] = {};
|
||||
}
|
||||
|
||||
if (src[key] && src[key][name]) {
|
||||
mix(res[name], src[key][name], innerShape);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dest[key] = res;
|
||||
}
|
||||
}
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
||||
const mix$1 = (dest, src) => mix(dest, src, shape);
|
||||
|
18
node_modules/css-tree/cjs/syntax/config/parser-selector.cjs
generated
vendored
18
node_modules/css-tree/cjs/syntax/config/parser-selector.cjs
generated
vendored
@ -5,15 +5,15 @@ const indexParseSelector = require('../node/index-parse-selector.cjs');
|
||||
const selector = require('../scope/selector.cjs');
|
||||
|
||||
const config = {
|
||||
parseContext: {
|
||||
default: 'SelectorList',
|
||||
selectorList: 'SelectorList',
|
||||
selector: 'Selector'
|
||||
},
|
||||
scope: { Selector: selector },
|
||||
atrule: {},
|
||||
pseudo: index,
|
||||
node: indexParseSelector
|
||||
parseContext: {
|
||||
default: 'SelectorList',
|
||||
selectorList: 'SelectorList',
|
||||
selector: 'Selector',
|
||||
},
|
||||
scope: { Selector: selector },
|
||||
atrule: {},
|
||||
pseudo: index,
|
||||
node: indexParseSelector,
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
|
44
node_modules/css-tree/cjs/syntax/config/parser.cjs
generated
vendored
44
node_modules/css-tree/cjs/syntax/config/parser.cjs
generated
vendored
@ -6,29 +6,29 @@ const index$2 = require('../pseudo/index.cjs');
|
||||
const indexParse = require('../node/index-parse.cjs');
|
||||
|
||||
const config = {
|
||||
parseContext: {
|
||||
default: 'StyleSheet',
|
||||
stylesheet: 'StyleSheet',
|
||||
atrule: 'Atrule',
|
||||
atrulePrelude(options) {
|
||||
return this.AtrulePrelude(options.atrule ? String(options.atrule) : null);
|
||||
},
|
||||
mediaQueryList: 'MediaQueryList',
|
||||
mediaQuery: 'MediaQuery',
|
||||
rule: 'Rule',
|
||||
selectorList: 'SelectorList',
|
||||
selector: 'Selector',
|
||||
block() {
|
||||
return this.Block(true);
|
||||
},
|
||||
declarationList: 'DeclarationList',
|
||||
declaration: 'Declaration',
|
||||
value: 'Value'
|
||||
parseContext: {
|
||||
default: 'StyleSheet',
|
||||
stylesheet: 'StyleSheet',
|
||||
atrule: 'Atrule',
|
||||
atrulePrelude(options) {
|
||||
return this.AtrulePrelude(options.atrule ? String(options.atrule) : null);
|
||||
},
|
||||
scope: index,
|
||||
atrule: index$1,
|
||||
pseudo: index$2,
|
||||
node: indexParse
|
||||
mediaQueryList: 'MediaQueryList',
|
||||
mediaQuery: 'MediaQuery',
|
||||
rule: 'Rule',
|
||||
selectorList: 'SelectorList',
|
||||
selector: 'Selector',
|
||||
block() {
|
||||
return this.Block(true);
|
||||
},
|
||||
declarationList: 'DeclarationList',
|
||||
declaration: 'Declaration',
|
||||
value: 'Value',
|
||||
},
|
||||
scope: index,
|
||||
atrule: index$1,
|
||||
pseudo: index$2,
|
||||
node: indexParse,
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
|
2
node_modules/css-tree/cjs/syntax/config/walker.cjs
generated
vendored
2
node_modules/css-tree/cjs/syntax/config/walker.cjs
generated
vendored
@ -3,7 +3,7 @@
|
||||
const index = require('../node/index.cjs');
|
||||
|
||||
const config = {
|
||||
node: index
|
||||
node: index,
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
|
Reference in New Issue
Block a user