MCPcopy
hub / github.com/postcss/postcss / walkDecls

Method walkDecls

lib/container.js:358–379  ·  view source on GitHub ↗
(prop, callback)

Source from the content-addressed store, hash-verified

356 }
357
358 walkDecls(prop, callback) {
359 if (!callback) {
360 callback = prop
361 return this.walk((child, i) => {
362 if (child.type === 'decl') {
363 return callback(child, i)
364 }
365 })
366 }
367 if (prop instanceof RegExp) {
368 return this.walk((child, i) => {
369 if (child.type === 'decl' && prop.test(child.prop)) {
370 return callback(child, i)
371 }
372 })
373 }
374 return this.walk((child, i) => {
375 if (child.type === 'decl' && child.prop === prop) {
376 return callback(child, i)
377 }
378 })
379 }
380
381 walkRules(selector, callback) {
382 if (!callback) {

Callers 9

replaceValuesMethod · 0.95
rawBeforeDeclMethod · 0.80
rawColonMethod · 0.80
map.test.tsFile · 0.80
postcss.test.tsFile · 0.80
OnceFunction · 0.80
DeclarationFunction · 0.80
visitor.test.tsFile · 0.80
container.test.tsFile · 0.80

Calls 1

walkMethod · 0.95

Tested by 2

OnceFunction · 0.64
DeclarationFunction · 0.64