MCPcopy Index your code
hub / github.com/postcss/postcss / rawBeforeDecl

Method rawBeforeDecl

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

Source from the content-addressed store, hash-verified

233 }
234
235 rawBeforeDecl(root, node) {
236 let value
237 root.walkDecls(i => {
238 if (typeof i.raws.before !== 'undefined') {
239 value = i.raws.before
240 if (value.includes('\n')) {
241 value = value.replace(/[^\n]+$/, '')
242 }
243 return false
244 }
245 })
246 if (typeof value === 'undefined') {
247 value = this.raw(node, null, 'beforeRule')
248 } else if (value) {
249 value = value.replace(/\S/g, '')
250 }
251 return value
252 }
253
254 rawBeforeOpen(root) {
255 let value

Callers

nothing calls this directly

Calls 2

rawMethod · 0.95
walkDeclsMethod · 0.80

Tested by

no test coverage detected