MCPcopy
hub / github.com/postcss/postcss / rawBeforeComment

Method rawBeforeComment

lib/stringifier.js:216–233  ·  view source on GitHub ↗
(root, node)

Source from the content-addressed store, hash-verified

214 }
215
216 rawBeforeComment(root, node) {
217 let value
218 root.walkComments(i => {
219 if (typeof i.raws.before !== 'undefined') {
220 value = i.raws.before
221 if (value.includes('\n')) {
222 value = value.replace(/[^\n]+$/, '')
223 }
224 return false
225 }
226 })
227 if (typeof value === 'undefined') {
228 value = this.raw(node, null, 'beforeDecl')
229 } else if (value) {
230 value = value.replace(/\S/g, '')
231 }
232 return value
233 }
234
235 rawBeforeDecl(root, node) {
236 let value

Callers

nothing calls this directly

Calls 2

rawMethod · 0.95
walkCommentsMethod · 0.80

Tested by

no test coverage detected