Skip to content

Commit

Permalink
ditch substr_raw() (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartveneman authored Sep 20, 2024
1 parent 47be43a commit dc39cd7
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,6 @@ export function format(css, { minify = false } = {}) {
return css.slice(loc.start.offset, loc.end.offset)
}

/**
* @param {import('css-tree').CssNode} node
* @returns A portion of the CSS
*/
function substr_raw(node) {
let loc = node.loc
if (!loc) return EMPTY_STRING
return css.slice(loc.start.offset, loc.end.offset)
}

/**
* @param {import('css-tree').Rule} node
* @returns {string} A formatted Rule
Expand Down Expand Up @@ -472,7 +462,7 @@ export function format(css, { minify = false } = {}) {
* @returns {string} A formatted unknown CSS string
*/
function print_unknown(node, indent_level) {
return indent(indent_level) + substr_raw(node).trim()
return indent(indent_level) + substr(node).trim()
}

/**
Expand Down

0 comments on commit dc39cd7

Please sign in to comment.