UNPKG

@angular/cdk

Version:

Angular Material Component Development Kit

1 lines 1.03 kB
{"version":3,"file":"coercion-private.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/coercion/private/observable.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {Observable, isObservable, of as observableOf} from 'rxjs';\n\n/**\n * Given either an Observable or non-Observable value, returns either the original\n * Observable, or wraps it in an Observable that emits the non-Observable value.\n */\nexport function coerceObservable<T>(data: T | Observable<T>): Observable<T> {\n if (!isObservable(data)) {\n return observableOf(data);\n }\n return data;\n}\n"],"names":["coerceObservable","data","isObservable","observableOf"],"mappings":";;AAaM,SAAUA,gBAAgBA,CAAIC,IAAuB,EAAA;AACzD,EAAA,IAAI,CAACC,YAAY,CAACD,IAAI,CAAC,EAAE;IACvB,OAAOE,EAAY,CAACF,IAAI,CAAC;AAC3B;AACA,EAAA,OAAOA,IAAI;AACb;;;;"}