MCPcopy
hub / github.com/postcss/postcss / replaceValues

Method replaceValues

lib/container.js:289–305  ·  view source on GitHub ↗
(pattern, opts, callback)

Source from the content-addressed store, hash-verified

287 }
288
289 replaceValues(pattern, opts, callback) {
290 if (!callback) {
291 callback = opts
292 opts = {}
293 }
294
295 this.walkDecls(decl => {
296 if (opts.props && !opts.props.includes(decl.prop)) return
297 if (opts.fast && !decl.value.includes(opts.fast)) return
298
299 decl.value = decl.value.replace(pattern, callback)
300 })
301
302 this.markDirty()
303
304 return this
305 }
306
307 some(condition) {
308 return this.nodes.some(condition)

Callers 1

container.test.tsFile · 0.80

Calls 2

walkDeclsMethod · 0.95
markDirtyMethod · 0.80

Tested by

no test coverage detected