@projectwallace/format-css 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/format.cjs +1 -1
- package/dist/format.cjs.map +1 -1
- package/dist/format.modern.js +1 -1
- package/dist/format.modern.js.map +1 -1
- package/dist/format.module.js +1 -1
- package/dist/format.module.js.map +1 -1
- package/dist/format.umd.js +1 -1
- package/dist/format.umd.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Lightweight and fast library to format CSS with some very basic [rules](#formatting-rules). Our design goal is to format CSS in such a way that it's easy to inspect. Bundle size and runtime speed are more important than versatility and extensibility.
|
|
4
4
|
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Example output
|
|
8
|
+
|
|
5
9
|

|
|
6
10
|
|
|
7
11
|
## Installation
|
package/dist/format.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function r(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}var e=/*#__PURE__*/r(require("css-tree/parser"));function t(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function n(r,e){var n="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(n)return(n=n.call(r)).next.bind(n);if(Array.isArray(r)||(n=function(r,e){if(r){if("string"==typeof r)return t(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(r,e):void 0}}(r))||e&&r&&"number"==typeof r.length){n&&(r=n);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(r){return"\t".repeat(r)}function
|
|
1
|
+
function r(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}var e=/*#__PURE__*/r(require("css-tree/parser"));function t(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function n(r,e){var n="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(n)return(n=n.call(r)).next.bind(n);if(Array.isArray(r)||(n=function(r,e){if(r){if("string"==typeof r)return t(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(r,e):void 0}}(r))||e&&r&&"number"==typeof r.length){n&&(r=n);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(r){return"\t".repeat(r)}function l(r,e){return r.loc?e.substring(r.loc.start.offset,r.loc.end.offset):""}function u(r,e,t){var o="";return null!==r.prelude&&"SelectorList"===r.prelude.type&&(o+=function(r,e,t){for(var o,l="",u=n(r.children);!(o=u()).done;){var i=o.value;i!==r.children.first&&(l+="\n"),l+="Selector"===i.type?a(i,e,t):p(i,e,t),i!==r.children.last&&(l+=",")}return l}(r.prelude,e,t)),null!==r.block&&"Block"===r.block.type&&(o+=i(r.block,e,t)),o}function a(r,e,t){return o(e)+l(r,t)}function i(r,e,t){var l=r.children;if(l.isEmpty)return" {}";var a,i=" {\n";e++;for(var d,s=n(l);!(d=s()).done;){var y=d.value;"Declaration"===y.type?i+=f(y,e,t):"Rule"===y.type?(void 0!==a&&"Declaration"===a&&(i+="\n"),i+=u(y,e,t)):"Atrule"===y.type?(void 0!==a&&"Declaration"===a&&(i+="\n"),i+=c(y,e,t)):i+=p(y,e,t),y!==l.last&&(i+="Declaration"===y.type?"\n":"\n\n"),a=y.type}return i+="\n",(i+=o(--e))+"}"}function c(r,e,t){var n=o(e);return n+="@"+r.name,r.prelude&&(n+=" "+l(r.prelude,t)),n+(r.block&&"Block"===r.block.type?i(r.block,e,t):";")}function f(r,e,t){return o(e)+r.property+": "+l(r.value,t)+";"}function p(r,e,t){return o(e)+l(r,t).trim()}exports.format=function(r){return function(r,e,t){void 0===e&&(e=0);for(var o,l="",a=r.children,i=n(a);!(o=i()).done;){var f=o.value;l+="Rule"===f.type?u(f,e,t):"Atrule"===f.type?c(f,e,t):p(f,e,t),f!==a.last&&(l+="\n\n")}return l}(e.default(r,{positions:!0,parseAtrulePrelude:!1,parseCustomProperty:!1,parseValue:!1}),0,r)};
|
|
2
2
|
//# sourceMappingURL=format.cjs.map
|
package/dist/format.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.cjs","sources":["../index.js"],"sourcesContent":["import parse from 'css-tree/parser'\n\n/**\n * Indent a string\n * @param {number} size\n * @returns A string with {size} tabs\n */\nfunction indent(size) {\n\treturn '\\t'.repeat(size)\n}\n\n/**\n * @param {import('css-tree').CssNode} node\n * @param {string} css\n * @returns A portion of the CSS\n */\nfunction substr(node, css) {\n\tif (node.loc) {\n\t\treturn css.substring(node.loc.start.offset, node.loc.end.offset)\n\t}\n\treturn ''\n}\n\n/**\n *\n * @param {import('css-tree').Rule} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Rule\n */\nfunction print_rule(node, indent_level, css) {\n\tlet buffer = ''\n\n\tif (node.prelude && node.prelude.type === 'SelectorList') {\n\t\tbuffer += print_selectorlist(node.prelude, indent_level, css)\n\t}\n\n\tif (node.block && node.block.type === 'Block') {\n\t\tbuffer += print_block(node.block, indent_level, css)\n\t}\n\n\treturn buffer\n}\n\n/**\n * @param {import('css-tree').SelectorList} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted SelectorList\n */\nfunction print_selectorlist(node, indent_level, css) {\n\tlet buffer = ''\n\n\tfor (let selector of node.children) {\n\t\tif (selector !== node.children.first) {\n\t\t\tbuffer += '\\n'\n\t\t}\n\n\t\tif (selector.type === 'Selector') {\n\t\t\tbuffer += print_selector(selector, indent_level, css)\n\t\t} else {\n\t\t\tbuffer += print_unknown(selector, indent_level, css)\n\t\t}\n\n\t\tif (selector !== node.children.last) {\n\t\t\tbuffer += ','\n\t\t}\n\t}\n\treturn buffer\n}\n\n/**\n *\n * @param {import('css-tree').Selector} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Selector\n */\nfunction print_selector(node, indent_level, css) {\n\treturn indent(indent_level) + substr(node, css)\n}\n\n/**\n * @param {import('css-tree').Block} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Block\n */\nfunction print_block(node, indent_level, css) {\n\tlet children = node.children\n\n\tif (children.
|
|
1
|
+
{"version":3,"file":"format.cjs","sources":["../index.js"],"sourcesContent":["import parse from 'css-tree/parser'\n\n/**\n * Indent a string\n * @param {number} size\n * @returns A string with {size} tabs\n */\nfunction indent(size) {\n\treturn '\\t'.repeat(size)\n}\n\n/**\n * @param {import('css-tree').CssNode} node\n * @param {string} css\n * @returns A portion of the CSS\n */\nfunction substr(node, css) {\n\tif (node.loc) {\n\t\treturn css.substring(node.loc.start.offset, node.loc.end.offset)\n\t}\n\treturn ''\n}\n\n/**\n *\n * @param {import('css-tree').Rule} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Rule\n */\nfunction print_rule(node, indent_level, css) {\n\tlet buffer = ''\n\n\tif (node.prelude !== null && node.prelude.type === 'SelectorList') {\n\t\tbuffer += print_selectorlist(node.prelude, indent_level, css)\n\t}\n\n\tif (node.block !== null && node.block.type === 'Block') {\n\t\tbuffer += print_block(node.block, indent_level, css)\n\t}\n\n\treturn buffer\n}\n\n/**\n * @param {import('css-tree').SelectorList} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted SelectorList\n */\nfunction print_selectorlist(node, indent_level, css) {\n\tlet buffer = ''\n\n\tfor (let selector of node.children) {\n\t\tif (selector !== node.children.first) {\n\t\t\tbuffer += '\\n'\n\t\t}\n\n\t\tif (selector.type === 'Selector') {\n\t\t\tbuffer += print_selector(selector, indent_level, css)\n\t\t} else {\n\t\t\tbuffer += print_unknown(selector, indent_level, css)\n\t\t}\n\n\t\tif (selector !== node.children.last) {\n\t\t\tbuffer += ','\n\t\t}\n\t}\n\treturn buffer\n}\n\n/**\n *\n * @param {import('css-tree').Selector} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Selector\n */\nfunction print_selector(node, indent_level, css) {\n\treturn indent(indent_level) + substr(node, css)\n}\n\n/**\n * @param {import('css-tree').Block} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Block\n */\nfunction print_block(node, indent_level, css) {\n\tlet children = node.children\n\n\tif (children.isEmpty) {\n\t\treturn ' {}'\n\t}\n\n\tlet buffer = ' {\\n'\n\n\tindent_level++\n\n\tlet prev_type\n\n\tfor (let child of children) {\n\t\tif (child.type === 'Declaration') {\n\t\t\tbuffer += print_declaration(child, indent_level, css)\n\t\t} else if (child.type === 'Rule') {\n\t\t\tif (prev_type !== undefined && prev_type === 'Declaration') {\n\t\t\t\tbuffer += '\\n'\n\t\t\t}\n\t\t\tbuffer += print_rule(child, indent_level, css)\n\t\t} else if (child.type === 'Atrule') {\n\t\t\tif (prev_type !== undefined && prev_type === 'Declaration') {\n\t\t\t\tbuffer += '\\n'\n\t\t\t}\n\t\t\tbuffer += print_atrule(child, indent_level, css)\n\t\t} else {\n\t\t\tbuffer += print_unknown(child, indent_level, css)\n\t\t}\n\n\t\tif (child !== children.last) {\n\t\t\tif (child.type === 'Declaration') {\n\t\t\t\tbuffer += '\\n'\n\t\t\t} else {\n\t\t\t\tbuffer += '\\n\\n'\n\t\t\t}\n\t\t}\n\n\t\tprev_type = child.type\n\t}\n\n\tindent_level--\n\n\tbuffer += '\\n'\n\tbuffer += indent(indent_level)\n\tbuffer += '}'\n\n\treturn buffer\n}\n\n/**\n * @param {import('css-tree').Atrule} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Atrule\n */\nfunction print_atrule(node, indent_level, css) {\n\tlet buffer = indent(indent_level)\n\tbuffer += '@' + node.name\n\n\t// @font-face has no prelude\n\tif (node.prelude) {\n\t\tbuffer += ' ' + substr(node.prelude, css)\n\t}\n\n\tif (node.block && node.block.type === 'Block') {\n\t\tbuffer += print_block(node.block, indent_level, css)\n\t} else {\n\t\t// `@import url(style.css);` has no block, neither does `@layer layer1;`\n\t\tbuffer += ';'\n\t}\n\n\treturn buffer\n}\n\n/**\n * @param {import('css-tree').Declation} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Declaration\n */\nfunction print_declaration(node, indent_level, css) {\n\treturn indent(indent_level) + node.property + ': ' + substr(node.value, css) + ';'\n}\n\n/**\n * @param {import('css-tree').CssNode} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted unknown CSS string\n */\nfunction print_unknown(node, indent_level, css) {\n\treturn indent(indent_level) + substr(node, css).trim()\n}\n\n/**\n * @param {import('css-tree').Stylesheet} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Stylesheet\n */\nfunction print(node, indent_level = 0, css) {\n\tlet buffer = ''\n\tlet children = node.children\n\n\tfor (let child of children) {\n\t\tif (child.type === 'Rule') {\n\t\t\tbuffer += print_rule(child, indent_level, css)\n\t\t} else if (child.type === 'Atrule') {\n\t\t\tbuffer += print_atrule(child, indent_level, css)\n\t\t} else {\n\t\t\tbuffer += print_unknown(child, indent_level, css)\n\t\t}\n\n\t\tif (child !== children.last) {\n\t\t\tbuffer += '\\n\\n'\n\t\t}\n\t}\n\n\treturn buffer\n}\n\n/**\n * Take a string of CSS (minified or not) and format it with some simple rules\n * @param {string} css The original CSS\n * @returns {string} The newly formatted CSS\n */\nexport function format(css) {\n\tlet ast = parse(css, {\n\t\tpositions: true,\n\t\tparseAtrulePrelude: false,\n\t\tparseCustomProperty: false,\n\t\tparseValue: false,\n\t})\n\treturn print(ast, 0, css)\n}\n"],"names":["indent","size","repeat","substr","node","css","loc","substring","start","offset","end","print_rule","indent_level","buffer","prelude","type","_step","_iterator","_createForOfIteratorHelperLoose","children","done","selector","value","first","print_selector","print_unknown","last","print_selectorlist","block","print_block","isEmpty","prev_type","_step2","_iterator2","child","print_declaration","undefined","print_atrule","name","property","trim","_step3","_iterator3","print","parse","positions","parseAtrulePrelude","parseCustomProperty","parseValue"],"mappings":"+6BAOA,SAASA,EAAOC,GACf,MAAO,KAAKC,OAAOD,EACpB,CAOA,SAASE,EAAOC,EAAMC,GACrB,OAAID,EAAKE,IACDD,EAAIE,UAAUH,EAAKE,IAAIE,MAAMC,OAAQL,EAAKE,IAAII,IAAID,QAEnD,EACR,CASA,SAASE,EAAWP,EAAMQ,EAAcP,GACvC,IAAIQ,EAAS,GAUb,OARqB,OAAjBT,EAAKU,SAA0C,iBAAtBV,EAAKU,QAAQC,OACzCF,GAgBF,SAA4BT,EAAMQ,EAAcP,GAG/C,IAFA,IAEkCW,EAF9BH,EAAS,GAEbI,EAAAC,EAAqBd,EAAKe,YAAQH,EAAAC,KAAAG,MAAE,KAA3BC,EAAQL,EAAAM,MACZD,IAAajB,EAAKe,SAASI,QAC9BV,GAAU,MAIVA,GADqB,aAAlBQ,EAASN,KACFS,EAAeH,EAAUT,EAAcP,GAEvCoB,EAAcJ,EAAUT,EAAcP,GAG7CgB,IAAajB,EAAKe,SAASO,OAC9Bb,GAAU,IAEZ,CACA,OAAOA,CACR,CAnCYc,CAAmBvB,EAAKU,QAASF,EAAcP,IAGvC,OAAfD,EAAKwB,OAAsC,UAApBxB,EAAKwB,MAAMb,OACrCF,GAAUgB,EAAYzB,EAAKwB,MAAOhB,EAAcP,IAG1CQ,CACR,CAoCA,SAASW,EAAepB,EAAMQ,EAAcP,GAC3C,OAAOL,EAAOY,GAAgBT,EAAOC,EAAMC,EAC5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QAAlBO,IAAAA,IAAAA,EAAe,GAInC,IAHA,IAG0B6B,EAHtB5B,EAAS,GACTM,EAAWf,EAAKe,SAEpBuB,EAAAxB,EAAkBC,KAAQsB,EAAAC,KAAAtB,MAAE,CAAA,IAAnBc,EAAKO,EAAAnB,MAEZT,GADkB,SAAfqB,EAAMnB,KACCJ,EAAWuB,EAAOtB,EAAcP,GACjB,WAAf6B,EAAMnB,KACNsB,EAAaH,EAAOtB,EAAcP,GAElCoB,EAAcS,EAAOtB,EAAcP,GAG1C6B,IAAUf,EAASO,OACtBb,GAAU,OAEZ,CAEA,OAAOA,CACR,CAcQ8B,CANGC,EAAAA,QAAMvC,EAAK,CACpBwC,WAAW,EACXC,oBAAoB,EACpBC,qBAAqB,EACrBC,YAAY,IAEK,EAAG3C,EACtB"}
|
package/dist/format.modern.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"css-tree/parser";function t(e){return"\t".repeat(e)}function r(e,t){return e.loc?t.substring(e.loc.start.offset,e.loc.end.offset):""}function n(e,t,r){let n="";return e.prelude&&"SelectorList"===e.prelude.type&&(n+=function(e,t,r){let n="";for(let o of e.children)o!==e.children.first&&(n+="\n"),n+="Selector"===o.type?l(o,t,r):i(o,t,r),o!==e.children.last&&(n+=",");return n}(e.prelude,t,r)),e.block&&"Block"===e.block.type&&(n+=o(e.block,t,r)),n}function l(e,n,l){return t(n)+r(e,l)}function o(e,r,l){let o=e.children;if(
|
|
1
|
+
import e from"css-tree/parser";function t(e){return"\t".repeat(e)}function r(e,t){return e.loc?t.substring(e.loc.start.offset,e.loc.end.offset):""}function n(e,t,r){let n="";return null!==e.prelude&&"SelectorList"===e.prelude.type&&(n+=function(e,t,r){let n="";for(let o of e.children)o!==e.children.first&&(n+="\n"),n+="Selector"===o.type?l(o,t,r):i(o,t,r),o!==e.children.last&&(n+=",");return n}(e.prelude,t,r)),null!==e.block&&"Block"===e.block.type&&(n+=o(e.block,t,r)),n}function l(e,n,l){return t(n)+r(e,l)}function o(e,r,l){let o=e.children;if(o.isEmpty)return" {}";let p,f=" {\n";r++;for(let e of o)"Declaration"===e.type?f+=c(e,r,l):"Rule"===e.type?(void 0!==p&&"Declaration"===p&&(f+="\n"),f+=n(e,r,l)):"Atrule"===e.type?(void 0!==p&&"Declaration"===p&&(f+="\n"),f+=u(e,r,l)):f+=i(e,r,l),e!==o.last&&(f+="Declaration"===e.type?"\n":"\n\n"),p=e.type;return f+="\n",f+=t(--r),f+="}",f}function u(e,n,l){let u=t(n);return u+="@"+e.name,e.prelude&&(u+=" "+r(e.prelude,l)),u+=e.block&&"Block"===e.block.type?o(e.block,n,l):";",u}function c(e,n,l){return t(n)+e.property+": "+r(e.value,l)+";"}function i(e,n,l){return t(n)+r(e,l).trim()}function p(t){return function(e,t=0,r){let l="",o=e.children;for(let e of o)l+="Rule"===e.type?n(e,t,r):"Atrule"===e.type?u(e,t,r):i(e,t,r),e!==o.last&&(l+="\n\n");return l}(e(t,{positions:!0,parseAtrulePrelude:!1,parseCustomProperty:!1,parseValue:!1}),0,t)}export{p as format};
|
|
2
2
|
//# sourceMappingURL=format.modern.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.modern.js","sources":["../index.js"],"sourcesContent":["import parse from 'css-tree/parser'\n\n/**\n * Indent a string\n * @param {number} size\n * @returns A string with {size} tabs\n */\nfunction indent(size) {\n\treturn '\\t'.repeat(size)\n}\n\n/**\n * @param {import('css-tree').CssNode} node\n * @param {string} css\n * @returns A portion of the CSS\n */\nfunction substr(node, css) {\n\tif (node.loc) {\n\t\treturn css.substring(node.loc.start.offset, node.loc.end.offset)\n\t}\n\treturn ''\n}\n\n/**\n *\n * @param {import('css-tree').Rule} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Rule\n */\nfunction print_rule(node, indent_level, css) {\n\tlet buffer = ''\n\n\tif (node.prelude && node.prelude.type === 'SelectorList') {\n\t\tbuffer += print_selectorlist(node.prelude, indent_level, css)\n\t}\n\n\tif (node.block && node.block.type === 'Block') {\n\t\tbuffer += print_block(node.block, indent_level, css)\n\t}\n\n\treturn buffer\n}\n\n/**\n * @param {import('css-tree').SelectorList} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted SelectorList\n */\nfunction print_selectorlist(node, indent_level, css) {\n\tlet buffer = ''\n\n\tfor (let selector of node.children) {\n\t\tif (selector !== node.children.first) {\n\t\t\tbuffer += '\\n'\n\t\t}\n\n\t\tif (selector.type === 'Selector') {\n\t\t\tbuffer += print_selector(selector, indent_level, css)\n\t\t} else {\n\t\t\tbuffer += print_unknown(selector, indent_level, css)\n\t\t}\n\n\t\tif (selector !== node.children.last) {\n\t\t\tbuffer += ','\n\t\t}\n\t}\n\treturn buffer\n}\n\n/**\n *\n * @param {import('css-tree').Selector} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Selector\n */\nfunction print_selector(node, indent_level, css) {\n\treturn indent(indent_level) + substr(node, css)\n}\n\n/**\n * @param {import('css-tree').Block} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Block\n */\nfunction print_block(node, indent_level, css) {\n\tlet children = node.children\n\n\tif (children.
|
|
1
|
+
{"version":3,"file":"format.modern.js","sources":["../index.js"],"sourcesContent":["import parse from 'css-tree/parser'\n\n/**\n * Indent a string\n * @param {number} size\n * @returns A string with {size} tabs\n */\nfunction indent(size) {\n\treturn '\\t'.repeat(size)\n}\n\n/**\n * @param {import('css-tree').CssNode} node\n * @param {string} css\n * @returns A portion of the CSS\n */\nfunction substr(node, css) {\n\tif (node.loc) {\n\t\treturn css.substring(node.loc.start.offset, node.loc.end.offset)\n\t}\n\treturn ''\n}\n\n/**\n *\n * @param {import('css-tree').Rule} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Rule\n */\nfunction print_rule(node, indent_level, css) {\n\tlet buffer = ''\n\n\tif (node.prelude !== null && node.prelude.type === 'SelectorList') {\n\t\tbuffer += print_selectorlist(node.prelude, indent_level, css)\n\t}\n\n\tif (node.block !== null && node.block.type === 'Block') {\n\t\tbuffer += print_block(node.block, indent_level, css)\n\t}\n\n\treturn buffer\n}\n\n/**\n * @param {import('css-tree').SelectorList} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted SelectorList\n */\nfunction print_selectorlist(node, indent_level, css) {\n\tlet buffer = ''\n\n\tfor (let selector of node.children) {\n\t\tif (selector !== node.children.first) {\n\t\t\tbuffer += '\\n'\n\t\t}\n\n\t\tif (selector.type === 'Selector') {\n\t\t\tbuffer += print_selector(selector, indent_level, css)\n\t\t} else {\n\t\t\tbuffer += print_unknown(selector, indent_level, css)\n\t\t}\n\n\t\tif (selector !== node.children.last) {\n\t\t\tbuffer += ','\n\t\t}\n\t}\n\treturn buffer\n}\n\n/**\n *\n * @param {import('css-tree').Selector} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Selector\n */\nfunction print_selector(node, indent_level, css) {\n\treturn indent(indent_level) + substr(node, css)\n}\n\n/**\n * @param {import('css-tree').Block} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Block\n */\nfunction print_block(node, indent_level, css) {\n\tlet children = node.children\n\n\tif (children.isEmpty) {\n\t\treturn ' {}'\n\t}\n\n\tlet buffer = ' {\\n'\n\n\tindent_level++\n\n\tlet prev_type\n\n\tfor (let child of children) {\n\t\tif (child.type === 'Declaration') {\n\t\t\tbuffer += print_declaration(child, indent_level, css)\n\t\t} else if (child.type === 'Rule') {\n\t\t\tif (prev_type !== undefined && prev_type === 'Declaration') {\n\t\t\t\tbuffer += '\\n'\n\t\t\t}\n\t\t\tbuffer += print_rule(child, indent_level, css)\n\t\t} else if (child.type === 'Atrule') {\n\t\t\tif (prev_type !== undefined && prev_type === 'Declaration') {\n\t\t\t\tbuffer += '\\n'\n\t\t\t}\n\t\t\tbuffer += print_atrule(child, indent_level, css)\n\t\t} else {\n\t\t\tbuffer += print_unknown(child, indent_level, css)\n\t\t}\n\n\t\tif (child !== children.last) {\n\t\t\tif (child.type === 'Declaration') {\n\t\t\t\tbuffer += '\\n'\n\t\t\t} else {\n\t\t\t\tbuffer += '\\n\\n'\n\t\t\t}\n\t\t}\n\n\t\tprev_type = child.type\n\t}\n\n\tindent_level--\n\n\tbuffer += '\\n'\n\tbuffer += indent(indent_level)\n\tbuffer += '}'\n\n\treturn buffer\n}\n\n/**\n * @param {import('css-tree').Atrule} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Atrule\n */\nfunction print_atrule(node, indent_level, css) {\n\tlet buffer = indent(indent_level)\n\tbuffer += '@' + node.name\n\n\t// @font-face has no prelude\n\tif (node.prelude) {\n\t\tbuffer += ' ' + substr(node.prelude, css)\n\t}\n\n\tif (node.block && node.block.type === 'Block') {\n\t\tbuffer += print_block(node.block, indent_level, css)\n\t} else {\n\t\t// `@import url(style.css);` has no block, neither does `@layer layer1;`\n\t\tbuffer += ';'\n\t}\n\n\treturn buffer\n}\n\n/**\n * @param {import('css-tree').Declation} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Declaration\n */\nfunction print_declaration(node, indent_level, css) {\n\treturn indent(indent_level) + node.property + ': ' + substr(node.value, css) + ';'\n}\n\n/**\n * @param {import('css-tree').CssNode} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted unknown CSS string\n */\nfunction print_unknown(node, indent_level, css) {\n\treturn indent(indent_level) + substr(node, css).trim()\n}\n\n/**\n * @param {import('css-tree').Stylesheet} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Stylesheet\n */\nfunction print(node, indent_level = 0, css) {\n\tlet buffer = ''\n\tlet children = node.children\n\n\tfor (let child of children) {\n\t\tif (child.type === 'Rule') {\n\t\t\tbuffer += print_rule(child, indent_level, css)\n\t\t} else if (child.type === 'Atrule') {\n\t\t\tbuffer += print_atrule(child, indent_level, css)\n\t\t} else {\n\t\t\tbuffer += print_unknown(child, indent_level, css)\n\t\t}\n\n\t\tif (child !== children.last) {\n\t\t\tbuffer += '\\n\\n'\n\t\t}\n\t}\n\n\treturn buffer\n}\n\n/**\n * Take a string of CSS (minified or not) and format it with some simple rules\n * @param {string} css The original CSS\n * @returns {string} The newly formatted CSS\n */\nexport function format(css) {\n\tlet ast = parse(css, {\n\t\tpositions: true,\n\t\tparseAtrulePrelude: false,\n\t\tparseCustomProperty: false,\n\t\tparseValue: false,\n\t})\n\treturn print(ast, 0, css)\n}\n"],"names":["indent","size","repeat","substr","node","css","loc","substring","start","offset","end","print_rule","indent_level","buffer","prelude","type","selector","children","first","print_selector","print_unknown","last","print_selectorlist","block","print_block","isEmpty","prev_type","child","print_declaration","undefined","print_atrule","name","property","value","trim","format","print","parse","positions","parseAtrulePrelude","parseCustomProperty","parseValue"],"mappings":"+BAOA,SAASA,EAAOC,GACf,MAAO,KAAKC,OAAOD,EACpB,CAOA,SAASE,EAAOC,EAAMC,GACrB,OAAID,EAAKE,IACDD,EAAIE,UAAUH,EAAKE,IAAIE,MAAMC,OAAQL,EAAKE,IAAII,IAAID,QAEnD,EACR,CASA,SAASE,EAAWP,EAAMQ,EAAcP,GACvC,IAAIQ,EAAS,GAUb,OARqB,OAAjBT,EAAKU,SAA0C,iBAAtBV,EAAKU,QAAQC,OACzCF,GAgBF,SAA4BT,EAAMQ,EAAcP,GAC/C,IAAIQ,EAAS,GAEb,IAAK,IAAIG,KAAYZ,EAAKa,SACrBD,IAAaZ,EAAKa,SAASC,QAC9BL,GAAU,MAIVA,GADqB,aAAlBG,EAASD,KACFI,EAAeH,EAAUJ,EAAcP,GAEvCe,EAAcJ,EAAUJ,EAAcP,GAG7CW,IAAaZ,EAAKa,SAASI,OAC9BR,GAAU,KAGZ,OAAOA,CACR,CAnCYS,CAAmBlB,EAAKU,QAASF,EAAcP,IAGvC,OAAfD,EAAKmB,OAAsC,UAApBnB,EAAKmB,MAAMR,OACrCF,GAAUW,EAAYpB,EAAKmB,MAAOX,EAAcP,IAG1CQ,CACR,CAoCA,SAASM,EAAef,EAA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ACtC,IAAIQ,EAAS,GACTI,EAAWb,EAAKa,SAEpB,IAAK,IAAIU,KAASV,EAEhBJ,GADkB,SAAfc,EAAMZ,KACCJ,EAAWgB,EAAOf,EAAcP,GACjB,WAAfsB,EAAMZ,KACNe,EAAaH,EAAOf,EAAcP,GAElCe,EAAcO,EAAOf,EAAcP,GAG1CsB,IAAUV,EAASI,OACtBR,GAAU,QAIZ,OAAOA,CACR,CAcQuB,CANGC,EAAMhC,EAAK,CACpBiC,WAAW,EACXC,oBAAoB,EACpBC,qBAAqB,EACrBC,YAAY,IAEK,EAAGpC,EACtB"}
|
package/dist/format.module.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r from"css-tree/parser";function e(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function t(r,t){var n="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(n)return(n=n.call(r)).next.bind(n);if(Array.isArray(r)||(n=function(r,t){if(r){if("string"==typeof r)return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(r,t):void 0}}(r))||t&&r&&"number"==typeof r.length){n&&(r=n);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(r){return"\t".repeat(r)}function o(r,e){return r.loc?e.substring(r.loc.start.offset,r.loc.end.offset):""}function
|
|
1
|
+
import r from"css-tree/parser";function e(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function t(r,t){var n="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(n)return(n=n.call(r)).next.bind(n);if(Array.isArray(r)||(n=function(r,t){if(r){if("string"==typeof r)return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(r,t):void 0}}(r))||t&&r&&"number"==typeof r.length){n&&(r=n);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(r){return"\t".repeat(r)}function o(r,e){return r.loc?e.substring(r.loc.start.offset,r.loc.end.offset):""}function l(r,e,n){var o="";return null!==r.prelude&&"SelectorList"===r.prelude.type&&(o+=function(r,e,n){for(var o,l="",u=t(r.children);!(o=u()).done;){var i=o.value;i!==r.children.first&&(l+="\n"),l+="Selector"===i.type?a(i,e,n):p(i,e,n),i!==r.children.last&&(l+=",")}return l}(r.prelude,e,n)),null!==r.block&&"Block"===r.block.type&&(o+=u(r.block,e,n)),o}function a(r,e,t){return n(e)+o(r,t)}function u(r,e,o){var a=r.children;if(a.isEmpty)return" {}";var u,f=" {\n";e++;for(var s,d=t(a);!(s=d()).done;){var y=s.value;"Declaration"===y.type?f+=c(y,e,o):"Rule"===y.type?(void 0!==u&&"Declaration"===u&&(f+="\n"),f+=l(y,e,o)):"Atrule"===y.type?(void 0!==u&&"Declaration"===u&&(f+="\n"),f+=i(y,e,o)):f+=p(y,e,o),y!==a.last&&(f+="Declaration"===y.type?"\n":"\n\n"),u=y.type}return f+="\n",(f+=n(--e))+"}"}function i(r,e,t){var l=n(e);return l+="@"+r.name,r.prelude&&(l+=" "+o(r.prelude,t)),l+(r.block&&"Block"===r.block.type?u(r.block,e,t):";")}function c(r,e,t){return n(e)+r.property+": "+o(r.value,t)+";"}function p(r,e,t){return n(e)+o(r,t).trim()}function f(e){return function(r,e,n){void 0===e&&(e=0);for(var o,a="",u=r.children,c=t(u);!(o=c()).done;){var f=o.value;a+="Rule"===f.type?l(f,e,n):"Atrule"===f.type?i(f,e,n):p(f,e,n),f!==u.last&&(a+="\n\n")}return a}(r(e,{positions:!0,parseAtrulePrelude:!1,parseCustomProperty:!1,parseValue:!1}),0,e)}export{f as format};
|
|
2
2
|
//# sourceMappingURL=format.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.module.js","sources":["../index.js"],"sourcesContent":["import parse from 'css-tree/parser'\n\n/**\n * Indent a string\n * @param {number} size\n * @returns A string with {size} tabs\n */\nfunction indent(size) {\n\treturn '\\t'.repeat(size)\n}\n\n/**\n * @param {import('css-tree').CssNode} node\n * @param {string} css\n * @returns A portion of the CSS\n */\nfunction substr(node, css) {\n\tif (node.loc) {\n\t\treturn css.substring(node.loc.start.offset, node.loc.end.offset)\n\t}\n\treturn ''\n}\n\n/**\n *\n * @param {import('css-tree').Rule} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Rule\n */\nfunction print_rule(node, indent_level, css) {\n\tlet buffer = ''\n\n\tif (node.prelude && node.prelude.type === 'SelectorList') {\n\t\tbuffer += print_selectorlist(node.prelude, indent_level, css)\n\t}\n\n\tif (node.block && node.block.type === 'Block') {\n\t\tbuffer += print_block(node.block, indent_level, css)\n\t}\n\n\treturn buffer\n}\n\n/**\n * @param {import('css-tree').SelectorList} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted SelectorList\n */\nfunction print_selectorlist(node, indent_level, css) {\n\tlet buffer = ''\n\n\tfor (let selector of node.children) {\n\t\tif (selector !== node.children.first) {\n\t\t\tbuffer += '\\n'\n\t\t}\n\n\t\tif (selector.type === 'Selector') {\n\t\t\tbuffer += print_selector(selector, indent_level, css)\n\t\t} else {\n\t\t\tbuffer += print_unknown(selector, indent_level, css)\n\t\t}\n\n\t\tif (selector !== node.children.last) {\n\t\t\tbuffer += ','\n\t\t}\n\t}\n\treturn buffer\n}\n\n/**\n *\n * @param {import('css-tree').Selector} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Selector\n */\nfunction print_selector(node, indent_level, css) {\n\treturn indent(indent_level) + substr(node, css)\n}\n\n/**\n * @param {import('css-tree').Block} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Block\n */\nfunction print_block(node, indent_level, css) {\n\tlet children = node.children\n\n\tif (children.
|
|
1
|
+
{"version":3,"file":"format.module.js","sources":["../index.js"],"sourcesContent":["import parse from 'css-tree/parser'\n\n/**\n * Indent a string\n * @param {number} size\n * @returns A string with {size} tabs\n */\nfunction indent(size) {\n\treturn '\\t'.repeat(size)\n}\n\n/**\n * @param {import('css-tree').CssNode} node\n * @param {string} css\n * @returns A portion of the CSS\n */\nfunction substr(node, css) {\n\tif (node.loc) {\n\t\treturn css.substring(node.loc.start.offset, node.loc.end.offset)\n\t}\n\treturn ''\n}\n\n/**\n *\n * @param {import('css-tree').Rule} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Rule\n */\nfunction print_rule(node, indent_level, css) {\n\tlet buffer = ''\n\n\tif (node.prelude !== null && node.prelude.type === 'SelectorList') {\n\t\tbuffer += print_selectorlist(node.prelude, indent_level, css)\n\t}\n\n\tif (node.block !== null && node.block.type === 'Block') {\n\t\tbuffer += print_block(node.block, indent_level, css)\n\t}\n\n\treturn buffer\n}\n\n/**\n * @param {import('css-tree').SelectorList} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted SelectorList\n */\nfunction print_selectorlist(node, indent_level, css) {\n\tlet buffer = ''\n\n\tfor (let selector of node.children) {\n\t\tif (selector !== node.children.first) {\n\t\t\tbuffer += '\\n'\n\t\t}\n\n\t\tif (selector.type === 'Selector') {\n\t\t\tbuffer += print_selector(selector, indent_level, css)\n\t\t} else {\n\t\t\tbuffer += print_unknown(selector, indent_level, css)\n\t\t}\n\n\t\tif (selector !== node.children.last) {\n\t\t\tbuffer += ','\n\t\t}\n\t}\n\treturn buffer\n}\n\n/**\n *\n * @param {import('css-tree').Selector} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Selector\n */\nfunction print_selector(node, indent_level, css) {\n\treturn indent(indent_level) + substr(node, css)\n}\n\n/**\n * @param {import('css-tree').Block} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Block\n */\nfunction print_block(node, indent_level, css) {\n\tlet children = node.children\n\n\tif (children.isEmpty) {\n\t\treturn ' {}'\n\t}\n\n\tlet buffer = ' {\\n'\n\n\tindent_level++\n\n\tlet prev_type\n\n\tfor (let child of children) {\n\t\tif (child.type === 'Declaration') {\n\t\t\tbuffer += print_declaration(child, indent_level, css)\n\t\t} else if (child.type === 'Rule') {\n\t\t\tif (prev_type !== undefined && prev_type === 'Declaration') {\n\t\t\t\tbuffer += '\\n'\n\t\t\t}\n\t\t\tbuffer += print_rule(child, indent_level, css)\n\t\t} else if (child.type === 'Atrule') {\n\t\t\tif (prev_type !== undefined && prev_type === 'Declaration') {\n\t\t\t\tbuffer += '\\n'\n\t\t\t}\n\t\t\tbuffer += print_atrule(child, indent_level, css)\n\t\t} else {\n\t\t\tbuffer += print_unknown(child, indent_level, css)\n\t\t}\n\n\t\tif (child !== children.last) {\n\t\t\tif (child.type === 'Declaration') {\n\t\t\t\tbuffer += '\\n'\n\t\t\t} else {\n\t\t\t\tbuffer += '\\n\\n'\n\t\t\t}\n\t\t}\n\n\t\tprev_type = child.type\n\t}\n\n\tindent_level--\n\n\tbuffer += '\\n'\n\tbuffer += indent(indent_level)\n\tbuffer += '}'\n\n\treturn buffer\n}\n\n/**\n * @param {import('css-tree').Atrule} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Atrule\n */\nfunction print_atrule(node, indent_level, css) {\n\tlet buffer = indent(indent_level)\n\tbuffer += '@' + node.name\n\n\t// @font-face has no prelude\n\tif (node.prelude) {\n\t\tbuffer += ' ' + substr(node.prelude, css)\n\t}\n\n\tif (node.block && node.block.type === 'Block') {\n\t\tbuffer += print_block(node.block, indent_level, css)\n\t} else {\n\t\t// `@import url(style.css);` has no block, neither does `@layer layer1;`\n\t\tbuffer += ';'\n\t}\n\n\treturn buffer\n}\n\n/**\n * @param {import('css-tree').Declation} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Declaration\n */\nfunction print_declaration(node, indent_level, css) {\n\treturn indent(indent_level) + node.property + ': ' + substr(node.value, css) + ';'\n}\n\n/**\n * @param {import('css-tree').CssNode} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted unknown CSS string\n */\nfunction print_unknown(node, indent_level, css) {\n\treturn indent(indent_level) + substr(node, css).trim()\n}\n\n/**\n * @param {import('css-tree').Stylesheet} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Stylesheet\n */\nfunction print(node, indent_level = 0, css) {\n\tlet buffer = ''\n\tlet children = node.children\n\n\tfor (let child of children) {\n\t\tif (child.type === 'Rule') {\n\t\t\tbuffer += print_rule(child, indent_level, css)\n\t\t} else if (child.type === 'Atrule') {\n\t\t\tbuffer += print_atrule(child, indent_level, css)\n\t\t} else {\n\t\t\tbuffer += print_unknown(child, indent_level, css)\n\t\t}\n\n\t\tif (child !== children.last) {\n\t\t\tbuffer += '\\n\\n'\n\t\t}\n\t}\n\n\treturn buffer\n}\n\n/**\n * Take a string of CSS (minified or not) and format it with some simple rules\n * @param {string} css The original CSS\n * @returns {string} The newly formatted CSS\n */\nexport function format(css) {\n\tlet ast = parse(css, {\n\t\tpositions: true,\n\t\tparseAtrulePrelude: false,\n\t\tparseCustomProperty: false,\n\t\tparseValue: false,\n\t})\n\treturn print(ast, 0, css)\n}\n"],"names":["indent","size","repeat","substr","node","css","loc","substring","start","offset","end","print_rule","indent_level","buffer","prelude","type","_step","_iterator","_createForOfIteratorHelperLoose","children","done","selector","value","first","print_selector","print_unknown","last","print_selectorlist","block","print_block","isEmpty","prev_type","_step2","_iterator2","child","print_declaration","undefined","print_atrule","name","property","trim","format","_step3","_iterator3","print","parse","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EAAcS,EAAOtB,EAAcP,GAG1C6B,IAAUf,EAASO,OACtBb,GAAU,OAEZ,CAEA,OAAOA,CACR,CAcQ+B,CANGC,EAAMxC,EAAK,CACpByC,WAAW,EACXC,oBAAoB,EACpBC,qBAAqB,EACrBC,YAAY,IAEK,EAAG5C,EACtB"}
|
package/dist/format.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("css-tree/parser")):"function"==typeof define&&define.amd?define(["exports","css-tree/parser"],r):r((e||self).formatCss={},e.parse)}(this,function(e,r){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=/*#__PURE__*/t(r);function o(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("css-tree/parser")):"function"==typeof define&&define.amd?define(["exports","css-tree/parser"],r):r((e||self).formatCss={},e.parse)}(this,function(e,r){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=/*#__PURE__*/t(r);function o(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function l(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return o(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?o(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e){return"\t".repeat(e)}function a(e,r){return e.loc?r.substring(e.loc.start.offset,e.loc.end.offset):""}function i(e,r,t){var n="";return null!==e.prelude&&"SelectorList"===e.prelude.type&&(n+=function(e,r,t){for(var n,o="",u=l(e.children);!(n=u()).done;){var a=n.value;a!==e.children.first&&(o+="\n"),o+="Selector"===a.type?c(a,r,t):d(a,r,t),a!==e.children.last&&(o+=",")}return o}(e.prelude,r,t)),null!==e.block&&"Block"===e.block.type&&(n+=f(e.block,r,t)),n}function c(e,r,t){return u(r)+a(e,t)}function f(e,r,t){var n=e.children;if(n.isEmpty)return" {}";var o,a=" {\n";r++;for(var c,f=l(n);!(c=f()).done;){var y=c.value;"Declaration"===y.type?a+=s(y,r,t):"Rule"===y.type?(void 0!==o&&"Declaration"===o&&(a+="\n"),a+=i(y,r,t)):"Atrule"===y.type?(void 0!==o&&"Declaration"===o&&(a+="\n"),a+=p(y,r,t)):a+=d(y,r,t),y!==n.last&&(a+="Declaration"===y.type?"\n":"\n\n"),o=y.type}return a+="\n",(a+=u(--r))+"}"}function p(e,r,t){var n=u(r);return n+="@"+e.name,e.prelude&&(n+=" "+a(e.prelude,t)),n+(e.block&&"Block"===e.block.type?f(e.block,r,t):";")}function s(e,r,t){return u(r)+e.property+": "+a(e.value,t)+";"}function d(e,r,t){return u(r)+a(e,t).trim()}e.format=function(e){return function(e,r,t){void 0===r&&(r=0);for(var n,o="",u=e.children,a=l(u);!(n=a()).done;){var c=n.value;o+="Rule"===c.type?i(c,r,t):"Atrule"===c.type?p(c,r,t):d(c,r,t),c!==u.last&&(o+="\n\n")}return o}(n.default(e,{positions:!0,parseAtrulePrelude:!1,parseCustomProperty:!1,parseValue:!1}),0,e)}});
|
|
2
2
|
//# sourceMappingURL=format.umd.js.map
|
package/dist/format.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.umd.js","sources":["../index.js"],"sourcesContent":["import parse from 'css-tree/parser'\n\n/**\n * Indent a string\n * @param {number} size\n * @returns A string with {size} tabs\n */\nfunction indent(size) {\n\treturn '\\t'.repeat(size)\n}\n\n/**\n * @param {import('css-tree').CssNode} node\n * @param {string} css\n * @returns A portion of the CSS\n */\nfunction substr(node, css) {\n\tif (node.loc) {\n\t\treturn css.substring(node.loc.start.offset, node.loc.end.offset)\n\t}\n\treturn ''\n}\n\n/**\n *\n * @param {import('css-tree').Rule} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Rule\n */\nfunction print_rule(node, indent_level, css) {\n\tlet buffer = ''\n\n\tif (node.prelude && node.prelude.type === 'SelectorList') {\n\t\tbuffer += print_selectorlist(node.prelude, indent_level, css)\n\t}\n\n\tif (node.block && node.block.type === 'Block') {\n\t\tbuffer += print_block(node.block, indent_level, css)\n\t}\n\n\treturn buffer\n}\n\n/**\n * @param {import('css-tree').SelectorList} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted SelectorList\n */\nfunction print_selectorlist(node, indent_level, css) {\n\tlet buffer = ''\n\n\tfor (let selector of node.children) {\n\t\tif (selector !== node.children.first) {\n\t\t\tbuffer += '\\n'\n\t\t}\n\n\t\tif (selector.type === 'Selector') {\n\t\t\tbuffer += print_selector(selector, indent_level, css)\n\t\t} else {\n\t\t\tbuffer += print_unknown(selector, indent_level, css)\n\t\t}\n\n\t\tif (selector !== node.children.last) {\n\t\t\tbuffer += ','\n\t\t}\n\t}\n\treturn buffer\n}\n\n/**\n *\n * @param {import('css-tree').Selector} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Selector\n */\nfunction print_selector(node, indent_level, css) {\n\treturn indent(indent_level) + substr(node, css)\n}\n\n/**\n * @param {import('css-tree').Block} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Block\n */\nfunction print_block(node, indent_level, css) {\n\tlet children = node.children\n\n\tif (children.
|
|
1
|
+
{"version":3,"file":"format.umd.js","sources":["../index.js"],"sourcesContent":["import parse from 'css-tree/parser'\n\n/**\n * Indent a string\n * @param {number} size\n * @returns A string with {size} tabs\n */\nfunction indent(size) {\n\treturn '\\t'.repeat(size)\n}\n\n/**\n * @param {import('css-tree').CssNode} node\n * @param {string} css\n * @returns A portion of the CSS\n */\nfunction substr(node, css) {\n\tif (node.loc) {\n\t\treturn css.substring(node.loc.start.offset, node.loc.end.offset)\n\t}\n\treturn ''\n}\n\n/**\n *\n * @param {import('css-tree').Rule} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Rule\n */\nfunction print_rule(node, indent_level, css) {\n\tlet buffer = ''\n\n\tif (node.prelude !== null && node.prelude.type === 'SelectorList') {\n\t\tbuffer += print_selectorlist(node.prelude, indent_level, css)\n\t}\n\n\tif (node.block !== null && node.block.type === 'Block') {\n\t\tbuffer += print_block(node.block, indent_level, css)\n\t}\n\n\treturn buffer\n}\n\n/**\n * @param {import('css-tree').SelectorList} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted SelectorList\n */\nfunction print_selectorlist(node, indent_level, css) {\n\tlet buffer = ''\n\n\tfor (let selector of node.children) {\n\t\tif (selector !== node.children.first) {\n\t\t\tbuffer += '\\n'\n\t\t}\n\n\t\tif (selector.type === 'Selector') {\n\t\t\tbuffer += print_selector(selector, indent_level, css)\n\t\t} else {\n\t\t\tbuffer += print_unknown(selector, indent_level, css)\n\t\t}\n\n\t\tif (selector !== node.children.last) {\n\t\t\tbuffer += ','\n\t\t}\n\t}\n\treturn buffer\n}\n\n/**\n *\n * @param {import('css-tree').Selector} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Selector\n */\nfunction print_selector(node, indent_level, css) {\n\treturn indent(indent_level) + substr(node, css)\n}\n\n/**\n * @param {import('css-tree').Block} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Block\n */\nfunction print_block(node, indent_level, css) {\n\tlet children = node.children\n\n\tif (children.isEmpty) {\n\t\treturn ' {}'\n\t}\n\n\tlet buffer = ' {\\n'\n\n\tindent_level++\n\n\tlet prev_type\n\n\tfor (let child of children) {\n\t\tif (child.type === 'Declaration') {\n\t\t\tbuffer += print_declaration(child, indent_level, css)\n\t\t} else if (child.type === 'Rule') {\n\t\t\tif (prev_type !== undefined && prev_type === 'Declaration') {\n\t\t\t\tbuffer += '\\n'\n\t\t\t}\n\t\t\tbuffer += print_rule(child, indent_level, css)\n\t\t} else if (child.type === 'Atrule') {\n\t\t\tif (prev_type !== undefined && prev_type === 'Declaration') {\n\t\t\t\tbuffer += '\\n'\n\t\t\t}\n\t\t\tbuffer += print_atrule(child, indent_level, css)\n\t\t} else {\n\t\t\tbuffer += print_unknown(child, indent_level, css)\n\t\t}\n\n\t\tif (child !== children.last) {\n\t\t\tif (child.type === 'Declaration') {\n\t\t\t\tbuffer += '\\n'\n\t\t\t} else {\n\t\t\t\tbuffer += '\\n\\n'\n\t\t\t}\n\t\t}\n\n\t\tprev_type = child.type\n\t}\n\n\tindent_level--\n\n\tbuffer += '\\n'\n\tbuffer += indent(indent_level)\n\tbuffer += '}'\n\n\treturn buffer\n}\n\n/**\n * @param {import('css-tree').Atrule} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Atrule\n */\nfunction print_atrule(node, indent_level, css) {\n\tlet buffer = indent(indent_level)\n\tbuffer += '@' + node.name\n\n\t// @font-face has no prelude\n\tif (node.prelude) {\n\t\tbuffer += ' ' + substr(node.prelude, css)\n\t}\n\n\tif (node.block && node.block.type === 'Block') {\n\t\tbuffer += print_block(node.block, indent_level, css)\n\t} else {\n\t\t// `@import url(style.css);` has no block, neither does `@layer layer1;`\n\t\tbuffer += ';'\n\t}\n\n\treturn buffer\n}\n\n/**\n * @param {import('css-tree').Declation} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Declaration\n */\nfunction print_declaration(node, indent_level, css) {\n\treturn indent(indent_level) + node.property + ': ' + substr(node.value, css) + ';'\n}\n\n/**\n * @param {import('css-tree').CssNode} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted unknown CSS string\n */\nfunction print_unknown(node, indent_level, css) {\n\treturn indent(indent_level) + substr(node, css).trim()\n}\n\n/**\n * @param {import('css-tree').Stylesheet} node\n * @param {number} indent_level\n * @param {string} css\n * @returns {string} A formatted Stylesheet\n */\nfunction print(node, indent_level = 0, css) {\n\tlet buffer = ''\n\tlet children = node.children\n\n\tfor (let child of children) {\n\t\tif (child.type === 'Rule') {\n\t\t\tbuffer += print_rule(child, indent_level, css)\n\t\t} else if (child.type === 'Atrule') {\n\t\t\tbuffer += print_atrule(child, indent_level, css)\n\t\t} else {\n\t\t\tbuffer += print_unknown(child, indent_level, css)\n\t\t}\n\n\t\tif (child !== children.last) {\n\t\t\tbuffer += '\\n\\n'\n\t\t}\n\t}\n\n\treturn buffer\n}\n\n/**\n * Take a string of CSS (minified or not) and format it with some simple rules\n * @param {string} css The original CSS\n * @returns {string} The newly formatted CSS\n */\nexport function format(css) {\n\tlet ast = parse(css, {\n\t\tpositions: true,\n\t\tparseAtrulePrelude: false,\n\t\tparseCustomProperty: false,\n\t\tparseValue: false,\n\t})\n\treturn print(ast, 0, css)\n}\n"],"names":["indent","size","repeat","substr","node","css","loc","substring","start","offset","end","print_rule","indent_level","buffer","prelude","type","_step","_iterator","_createForOfIteratorHelperLoose","children","done","selector","value","first","print_selector","print_unknown","last","print_selectorlist","block","print_block","isEmpty","prev_type","_step2","_iterator2","child","print_declaration","undefined","print_atrule","name","property","trim","_step3","_iterator3","print","parse","positions","parseAtrulePrelude","parseCustomProperty","parseValue"],"mappings":"grCAOA,SAASA,EAAOC,GACf,MAAO,KAAKC,OAAOD,EACpB,CAOA,SAASE,EAAOC,EAAMC,GACrB,OAAID,EAAKE,IACDD,EAAIE,UAAUH,EAAKE,IAAIE,MAAMC,OAAQL,EAAKE,IAAII,IAAID,QAEnD,EACR,CASA,SAASE,EAAWP,EAAMQ,EAAcP,GACvC,IAAIQ,EAAS,GAUb,OARqB,OAAjBT,EAAKU,SAA0C,iBAAtBV,EAAKU,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