🎉 initiate project *astro_rewrite*
This commit is contained in:
parent
ffd4d5e86c
commit
2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions
64
node_modules/sass-formatter/dist/regex/regex.d.ts
generated
vendored
Normal file
64
node_modules/sass-formatter/dist/regex/regex.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
export declare function escapeRegExp(text: string): string;
|
||||
/** Check whether text is a variable: `/^[\t ]*(\$|--)\S+[\t ]*:.*/
|
||||
export declare function isVar(text: string): boolean;
|
||||
/** Check whether text @import: `/^[\t ]*@import/` */
|
||||
export declare function isAtImport(text: string): boolean;
|
||||
/** Check whether text is a \*: `/^[\t ]*?\*\/` */
|
||||
export declare function isStar(text: string): boolean;
|
||||
/** Check whether text is a css selector: `/^[\t ]*[{}]?[\t ]*[#\.%@=]/` */
|
||||
export declare function isCssSelector(text: string): boolean;
|
||||
/**Check whether text is class, id or placeholder: `/^[\t ]*[#\.%]/` */
|
||||
export declare function isClassOrId(text: string): boolean;
|
||||
/**Check whether text starts with one of [>\~]: `/^[\t ]*[>~]/` */
|
||||
export declare function isSelectorOperator(text: string): boolean;
|
||||
/**`/^[\t ]*\+[\t ]+/` */
|
||||
export declare function isAdjacentSelector(text: string): boolean;
|
||||
/**Check whether text is class, id or placeholder: `/^[\t ]*\r?\n?$/` */
|
||||
export declare function isEmptyOrWhitespace(text: string): boolean;
|
||||
/** Check whether text is a property: `^[\t ]*[\w\-]+[\t ]*:` */
|
||||
export declare function isProperty(text: string): boolean;
|
||||
/** Check whether text starts with &: `/^[\t ]*&/` */
|
||||
export declare function isAnd(text: string): boolean;
|
||||
/** Check whether text is a extend: `/^[\t ]*@extend/` */
|
||||
export declare function isAtExtend(text: string): boolean;
|
||||
/** Check whether text is include mixin statement */
|
||||
export declare function isInclude(text: string): boolean;
|
||||
/** Check whether text is a @keyframes: `/^[\t ]*@keyframes/` */
|
||||
export declare function isKeyframes(text: string): boolean;
|
||||
/** Check whether text is a Pseudo selector: `/^[\t ]*\\?::?/`. */
|
||||
export declare function isPseudo(text: string): boolean;
|
||||
/** Check whether text is bracket selector: `/^[\t ]*\[[\w=\-*"' ]*\]/`*/
|
||||
export declare function isBracketSelector(text: string): boolean;
|
||||
/** Check whether text starts with an html tag. */
|
||||
export declare function isHtmlTag(text: string): boolean;
|
||||
/** Check whether text starts with a self closing html tag. */
|
||||
export declare function isVoidHtmlTag(text: string): boolean;
|
||||
/** Check whether text starts with //R: `/^[\t ]*\/?\/\/ *R *$/` */
|
||||
export declare function isReset(text: string): boolean;
|
||||
/** Check whether text starts with //I: `/^[\t ]*\/?\/\/ *I *$/` */
|
||||
export declare function isIgnore(text: string): boolean;
|
||||
/** Check whether text starts with //S: `/^[\t ]*\/?\/\/ *S *$/` */
|
||||
export declare function isSassSpace(text: string): boolean;
|
||||
/** Returns true if the string has brackets or semicolons at the end, comments get ignored. */
|
||||
export declare function isScssOrCss(text: string): boolean;
|
||||
/** `/^[\t ]*[&.#%].*:/` */
|
||||
export declare function isCssPseudo(text: string): boolean;
|
||||
/** `/^[\t ]*[&.#%][\w-]*(?!#)[\t ]*\{.*[;\}][\t ]*$/` */
|
||||
export declare function isCssOneLiner(text: string): boolean;
|
||||
/** `/^[\t ]*::?[\w\-]+\(.*\)/` */
|
||||
/** `/^[\t ]*(\/\/|\/\*)/` */
|
||||
export declare function isComment(text: string): boolean;
|
||||
/** `/^[\t ]*(\/\*)/` */
|
||||
export declare function isBlockCommentStart(text: string): boolean;
|
||||
/** `/[\t ]*(\*\/)/` */
|
||||
export declare function isBlockCommentEnd(text: string): boolean;
|
||||
/** `/^[\t ]*[\.#%].* ?, *[\.#%].*\/` */
|
||||
export declare function isMoreThanOneClassOrId(text: string): boolean;
|
||||
/** `/^[\t ]*[}{]+[\t }{]*$/` */
|
||||
export declare function isBracketOrWhitespace(text: string): boolean;
|
||||
/** `/[\t ]*@forward|[\t ]*@use/` */
|
||||
export declare function isAtForwardOrAtUse(text: string): boolean;
|
||||
export declare function isInterpolatedProperty(text: string): boolean;
|
||||
export declare function hasPropertyValueSpace(text: string): boolean;
|
||||
/** returns the distance between the beginning and the first char. */
|
||||
export declare function getDistance(text: string, tabSize: number): number;
|
||||
186
node_modules/sass-formatter/dist/regex/regex.js
generated
vendored
Normal file
186
node_modules/sass-formatter/dist/regex/regex.js
generated
vendored
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.getDistance = exports.hasPropertyValueSpace = exports.isInterpolatedProperty = exports.isAtForwardOrAtUse = exports.isBracketOrWhitespace = exports.isMoreThanOneClassOrId = exports.isBlockCommentEnd = exports.isBlockCommentStart = exports.isComment = exports.isCssOneLiner = exports.isCssPseudo = exports.isScssOrCss = exports.isSassSpace = exports.isIgnore = exports.isReset = exports.isVoidHtmlTag = exports.isHtmlTag = exports.isBracketSelector = exports.isPseudo = exports.isKeyframes = exports.isInclude = exports.isAtExtend = exports.isAnd = exports.isProperty = exports.isEmptyOrWhitespace = exports.isAdjacentSelector = exports.isSelectorOperator = exports.isClassOrId = exports.isCssSelector = exports.isStar = exports.isAtImport = exports.isVar = exports.escapeRegExp = void 0;
|
||||
function escapeRegExp(text) {
|
||||
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
||||
}
|
||||
exports.escapeRegExp = escapeRegExp;
|
||||
/** Check whether text is a variable: `/^[\t ]*(\$|--)\S+[\t ]*:.*/
|
||||
function isVar(text) {
|
||||
return /^[\t ]*(\$|--)\S+[\t ]*:.*/.test(text);
|
||||
}
|
||||
exports.isVar = isVar;
|
||||
/** Check whether text @import: `/^[\t ]*@import/` */
|
||||
function isAtImport(text) {
|
||||
return /^[\t ]*@import/.test(text);
|
||||
}
|
||||
exports.isAtImport = isAtImport;
|
||||
/** Check whether text is a \*: `/^[\t ]*?\*\/` */
|
||||
function isStar(text) {
|
||||
return /^[\t ]*?\*/.test(text);
|
||||
}
|
||||
exports.isStar = isStar;
|
||||
/** Check whether text is a css selector: `/^[\t ]*[{}]?[\t ]*[#\.%@=]/` */
|
||||
function isCssSelector(text) {
|
||||
return /^[\t ]*[{}]?[\t ]*[#\.%@=]/.test(text);
|
||||
}
|
||||
exports.isCssSelector = isCssSelector;
|
||||
/**Check whether text is class, id or placeholder: `/^[\t ]*[#\.%]/` */
|
||||
function isClassOrId(text) {
|
||||
return /^[\t ]*[#\.%]/.test(text);
|
||||
}
|
||||
exports.isClassOrId = isClassOrId;
|
||||
/**Check whether text starts with one of [>\~]: `/^[\t ]*[>~]/` */
|
||||
function isSelectorOperator(text) {
|
||||
return /^[\t ]*[>~]/.test(text);
|
||||
}
|
||||
exports.isSelectorOperator = isSelectorOperator;
|
||||
/**`/^[\t ]*\+[\t ]+/` */
|
||||
function isAdjacentSelector(text) {
|
||||
return /^[\t ]*\+[\t ]+/.test(text);
|
||||
}
|
||||
exports.isAdjacentSelector = isAdjacentSelector;
|
||||
/**Check whether text is class, id or placeholder: `/^[\t ]*\r?\n?$/` */
|
||||
function isEmptyOrWhitespace(text) {
|
||||
return /^[\t ]*\r?\n?$/.test(text);
|
||||
}
|
||||
exports.isEmptyOrWhitespace = isEmptyOrWhitespace;
|
||||
/** Check whether text is a property: `^[\t ]*[\w\-]+[\t ]*:` */
|
||||
function isProperty(text) {
|
||||
// if (empty) {
|
||||
// return !/^[\t ]*[\w\-]+ *: *\S+/.test(text);
|
||||
// }
|
||||
return /^[\t ]*[\w\-]+[\t ]*:/.test(text);
|
||||
}
|
||||
exports.isProperty = isProperty;
|
||||
/** Check whether text starts with &: `/^[\t ]*&/` */
|
||||
function isAnd(text) {
|
||||
return /^[\t ]*&/.test(text);
|
||||
}
|
||||
exports.isAnd = isAnd;
|
||||
/** Check whether text is a extend: `/^[\t ]*@extend/` */
|
||||
function isAtExtend(text) {
|
||||
return /^[\t ]*@extend/.test(text);
|
||||
}
|
||||
exports.isAtExtend = isAtExtend;
|
||||
/** Check whether text is include mixin statement */
|
||||
function isInclude(text) {
|
||||
return /^[\t ]*(@include|\+\w)/.test(text);
|
||||
}
|
||||
exports.isInclude = isInclude;
|
||||
/** Check whether text is a @keyframes: `/^[\t ]*@keyframes/` */
|
||||
function isKeyframes(text) {
|
||||
return /^[\t ]*@keyframes/.test(text);
|
||||
}
|
||||
exports.isKeyframes = isKeyframes;
|
||||
/** Check whether text is a Pseudo selector: `/^[\t ]*\\?::?/`. */
|
||||
function isPseudo(text) {
|
||||
return /^[\t ]*\\?::?/.test(text);
|
||||
}
|
||||
exports.isPseudo = isPseudo;
|
||||
/** Check whether text is bracket selector: `/^[\t ]*\[[\w=\-*"' ]*\]/`*/
|
||||
function isBracketSelector(text) {
|
||||
return /^[\t ]*\[[\w=\-*"' ]*\]/.test(text);
|
||||
}
|
||||
exports.isBracketSelector = isBracketSelector;
|
||||
/** Check whether text starts with an html tag. */
|
||||
function isHtmlTag(text) {
|
||||
return /^[\t ]*(a|abbr|address|area|article|aside|audio|b|base|bdi|bdo|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|data|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|head|header|hgroup|hr|html|i|iframe|img|picture|input|ins|kbd|keygen|label|legend|li|link|main|map|mark|menu|menuitem|meta|meter|nav|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rb|rp|rt|rtc|ruby|s|samp|script|section|select|small|source|span|strong|style|sub|summary|sup|svg|table|tbody|td|template|textarea|tfoot|th|thead|time|title|tr|track|u|ul|var|video|wbr|path|circle|ellipse|line|polygon|polyline|rect|text|slot|h[1-6]?)((:|::|,|\.|#|\[)[\^:$#{}()\w\-\[\]='",\.# +\/]*)?$/.test(text);
|
||||
}
|
||||
exports.isHtmlTag = isHtmlTag;
|
||||
/** Check whether text starts with a self closing html tag. */
|
||||
function isVoidHtmlTag(text) {
|
||||
return /^[\t ]*(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr|command|keygen|menuitem|path)((:|::|,|\.|#|\[)[:$#{}()\w\-\[\]='",\.# ]*)?$/.test(text);
|
||||
}
|
||||
exports.isVoidHtmlTag = isVoidHtmlTag;
|
||||
/** Check whether text starts with //R: `/^[\t ]*\/?\/\/ *R *$/` */
|
||||
function isReset(text) {
|
||||
return /^[\t ]*\/?\/\/ *R *$/.test(text);
|
||||
}
|
||||
exports.isReset = isReset;
|
||||
/** Check whether text starts with //I: `/^[\t ]*\/?\/\/ *I *$/` */
|
||||
function isIgnore(text) {
|
||||
return /^[\t ]*\/?\/\/ *I *$/.test(text);
|
||||
}
|
||||
exports.isIgnore = isIgnore;
|
||||
/** Check whether text starts with //S: `/^[\t ]*\/?\/\/ *S *$/` */
|
||||
function isSassSpace(text) {
|
||||
return /^[\t ]*\/?\/\/ *S *$/.test(text);
|
||||
}
|
||||
exports.isSassSpace = isSassSpace;
|
||||
/** Returns true if the string has brackets or semicolons at the end, comments get ignored. */
|
||||
function isScssOrCss(text) {
|
||||
// Check if has brackets at the end and ignore comments.
|
||||
return /[;\{\}][\t ]*(\/\/.*)?$/.test(text);
|
||||
}
|
||||
exports.isScssOrCss = isScssOrCss;
|
||||
/** `/^[\t ]*[&.#%].*:/` */
|
||||
function isCssPseudo(text) {
|
||||
return /^[\t ]*[&.#%].*:/.test(text);
|
||||
}
|
||||
exports.isCssPseudo = isCssPseudo;
|
||||
/** `/^[\t ]*[&.#%][\w-]*(?!#)[\t ]*\{.*[;\}][\t ]*$/` */
|
||||
function isCssOneLiner(text) {
|
||||
return /^[\t ]*[&.#%][\w-]*(?!#)[\t ]*\{.*[;\}][\t ]*$/.test(text);
|
||||
}
|
||||
exports.isCssOneLiner = isCssOneLiner;
|
||||
/** `/^[\t ]*::?[\w\-]+\(.*\)/` */
|
||||
// export function isPseudoWithParenthesis(text: string) {
|
||||
// return /^[\t ]*::?[\w\-]+\(.*\)/.test(text);
|
||||
// }
|
||||
/** `/^[\t ]*(\/\/|\/\*)/` */
|
||||
function isComment(text) {
|
||||
return /^[\t ]*(\/\/|\/\*)/.test(text);
|
||||
}
|
||||
exports.isComment = isComment;
|
||||
/** `/^[\t ]*(\/\*)/` */
|
||||
function isBlockCommentStart(text) {
|
||||
return /^[\t ]*(\/\*)/.test(text);
|
||||
}
|
||||
exports.isBlockCommentStart = isBlockCommentStart;
|
||||
/** `/[\t ]*(\*\/)/` */
|
||||
function isBlockCommentEnd(text) {
|
||||
return /[\t ]*(\*\/)/.test(text);
|
||||
}
|
||||
exports.isBlockCommentEnd = isBlockCommentEnd;
|
||||
/** `/^[\t ]*[\.#%].* ?, *[\.#%].*\/` */
|
||||
function isMoreThanOneClassOrId(text) {
|
||||
return /^[\t ]*[\.#%].* ?, *[\.#%].*/.test(text);
|
||||
}
|
||||
exports.isMoreThanOneClassOrId = isMoreThanOneClassOrId;
|
||||
/** `/^[\t ]*[}{]+[\t }{]*$/` */
|
||||
function isBracketOrWhitespace(text) {
|
||||
return /^[\t ]*[}{]+[\t }{]*$/.test(text);
|
||||
}
|
||||
exports.isBracketOrWhitespace = isBracketOrWhitespace;
|
||||
/** `/[\t ]*@forward|[\t ]*@use/` */
|
||||
function isAtForwardOrAtUse(text) {
|
||||
return /[\t ]*@forward|[\t ]*@use/.test(text);
|
||||
}
|
||||
exports.isAtForwardOrAtUse = isAtForwardOrAtUse;
|
||||
function isInterpolatedProperty(text) {
|
||||
return /^[\t ]*[\w-]*#\{.*?\}[\w-]*:(?!:)/.test(text);
|
||||
}
|
||||
exports.isInterpolatedProperty = isInterpolatedProperty;
|
||||
function hasPropertyValueSpace(text) {
|
||||
return /^[\t ]*([\w ]+|[\w ]*#\{.*?\}[\w ]*): [^ ]/.test(text);
|
||||
}
|
||||
exports.hasPropertyValueSpace = hasPropertyValueSpace;
|
||||
/** returns the distance between the beginning and the first char. */
|
||||
function getDistance(text, tabSize) {
|
||||
var count = 0;
|
||||
for (var i = 0; i < text.length; i++) {
|
||||
var char = text[i];
|
||||
if (char !== ' ' && char !== '\t') {
|
||||
break;
|
||||
}
|
||||
if (char === '\t') {
|
||||
count += tabSize;
|
||||
}
|
||||
else {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
exports.getDistance = getDistance;
|
||||
Loading…
Add table
Add a link
Reference in a new issue