TenantAtlas/apps/platform/.pnpm-store/v10/files/24/87b5fd6c7afec406972ffbf5a12afabe7a4c42ef642203530297b60693c87a5b5440a8f66b53649a33b476f32944a7e5c4f5cb179e31764e053b2abdf0e933
ahmido 1fec9c6f9d
Some checks failed
Main Confidence / confidence (push) Failing after 45s
feat: compress governance operator outcomes (#253)
## Summary
- introduce surface-aware compressed governance outcomes and reuse the shared truth/explanation seams for operator-first summaries
- apply the compressed outcome hierarchy across baseline, evidence, review, review-pack, canonical review/evidence, and artifact-oriented operation-run surfaces
- expand spec 214 fixtures and Pest coverage, and fix tenant-panel route assertions by generating explicit tenant-panel URLs in the affected Filament tests

## Validation
- `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent`
- focused governance compression suite from `specs/214-governance-outcome-compression/quickstart.md` passed (`68` tests, `445` assertions)
- `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Filament/InventoryItemResourceTest.php tests/Feature/Filament/BackupSetUiEnforcementTest.php tests/Feature/Filament/RestoreRunUiEnforcementTest.php` passed (`18` tests, `81` assertions)

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #253
2026-04-19 12:30:36 +00:00

67 lines
2.4 KiB
Plaintext

import { Observable } from '../Observable';
import { Falsy, OperatorFunction } from '../types';
import { operate } from '../util/lift';
import { createOperatorSubscriber } from './OperatorSubscriber';
export function every<T>(predicate: BooleanConstructor): OperatorFunction<T, Exclude<T, Falsy> extends never ? false : boolean>;
/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */
export function every<T>(
predicate: BooleanConstructor,
thisArg: any
): OperatorFunction<T, Exclude<T, Falsy> extends never ? false : boolean>;
/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */
export function every<T, A>(
predicate: (this: A, value: T, index: number, source: Observable<T>) => boolean,
thisArg: A
): OperatorFunction<T, boolean>;
export function every<T>(predicate: (value: T, index: number, source: Observable<T>) => boolean): OperatorFunction<T, boolean>;
/**
* Returns an Observable that emits whether or not every item of the source satisfies the condition specified.
*
* <span class="informal">If all values pass predicate before the source completes, emits true before completion,
* otherwise emit false, then complete.</span>
*
* ![](every.png)
*
* ## Example
*
* A simple example emitting true if all elements are less than 5, false otherwise
*
* ```ts
* import { of, every } from 'rxjs';
*
* of(1, 2, 3, 4, 5, 6)
* .pipe(every(x => x < 5))
* .subscribe(x => console.log(x)); // -> false
* ```
*
* @param predicate A function for determining if an item meets a specified condition.
* @param thisArg Optional object to use for `this` in the callback.
* @return A function that returns an Observable of booleans that determines if
* all items of the source Observable meet the condition specified.
*/
export function every<T>(
predicate: (value: T, index: number, source: Observable<T>) => boolean,
thisArg?: any
): OperatorFunction<T, boolean> {
return operate((source, subscriber) => {
let index = 0;
source.subscribe(
createOperatorSubscriber(
subscriber,
(value) => {
if (!predicate.call(thisArg, value, index++, source)) {
subscriber.next(false);
subscriber.complete();
}
},
() => {
subscriber.next(true);
subscriber.complete();
}
)
);
});
}