(
from: readonly T[],
to: readonly T[],
diff: 'thorow' | 'stack',
logGroup?: (owner: T) => void,
)
| 291 | } |
| 292 | |
| 293 | function logOwnersDiff<T extends Solid.Owner>( |
| 294 | from: readonly T[], |
| 295 | to: readonly T[], |
| 296 | diff: 'thorow' | 'stack', |
| 297 | logGroup?: (owner: T) => void, |
| 298 | ): void { |
| 299 | const [getMark, owners] = diff === 'thorow' ? getDiffMap(from, to) : getStackDiffMap(from, to) |
| 300 | |
| 301 | paddedForEach( |
| 302 | owners, |
| 303 | owner => NODE_TYPE_NAMES[getOwnerType(owner)], |
| 304 | (type, owner) => { |
| 305 | const mark = getMark(owner) |
| 306 | const name = getNodeName(owner) |
| 307 | const label = (() => { |
| 308 | if (mark === 'added') |
| 309 | return [`${inGray(type)} %c${name}%c new`, STYLES.grayBackground, STYLES.new] |
| 310 | if (mark === 'removed') |
| 311 | return [ |
| 312 | `${inGray(type)} %c${name}`, |
| 313 | 'background: rgba(153, 153, 153, 0.15); padding: 0 0.2em; border-radius: 4px; text-decoration: line-through; color: #888', |
| 314 | ] |
| 315 | return [`${inGray(type)} %c${name}`, STYLES.grayBackground] |
| 316 | })() |
| 317 | if (logGroup) { |
| 318 | console.groupCollapsed(...label) |
| 319 | logGroup(owner) |
| 320 | console.groupEnd() |
| 321 | } else console.log(...label) |
| 322 | }, |
| 323 | ) |
| 324 | } |
| 325 | |
| 326 | export function logOwnerList<T extends Solid.Owner>( |
| 327 | owners: readonly T[], |
no test coverage detected
searching dependent graphs…