(selector, callback)
| 379 | } |
| 380 | |
| 381 | walkRules(selector, callback) { |
| 382 | if (!callback) { |
| 383 | callback = selector |
| 384 | |
| 385 | return this.walk((child, i) => { |
| 386 | if (child.type === 'rule') { |
| 387 | return callback(child, i) |
| 388 | } |
| 389 | }) |
| 390 | } |
| 391 | if (selector instanceof RegExp) { |
| 392 | return this.walk((child, i) => { |
| 393 | if (child.type === 'rule' && selector.test(child.selector)) { |
| 394 | return callback(child, i) |
| 395 | } |
| 396 | }) |
| 397 | } |
| 398 | return this.walk((child, i) => { |
| 399 | if (child.type === 'rule' && child.selector === selector) { |
| 400 | return callback(child, i) |
| 401 | } |
| 402 | }) |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | Container.registerParse = dependant => { |
no test coverage detected