build: fix build and add examples

This commit is contained in:
2025-02-05 23:55:00 +08:00
parent f00c1d1aef
commit 58d7b3c89e
127 changed files with 1340 additions and 3841 deletions

View File

@@ -8,9 +8,13 @@ import {
withInterceptors,
withLegacyInterceptors,
} from '@ngify/http';
import { InjectionToken, Optional, type Provider } from 'injection-js';
import {
InjectionToken,
Optional,
type Provider,
} from '@outposts/injection-js';
import type { ArrayOrNullableOne } from '../utils/types';
export { HttpParams, HttpParamsOptions } from './params';
export { HttpParams, type HttpParamsOptions } from './params';
export const HTTP_FEATURES = new InjectionToken<HttpFeature[]>('HTTP_FEATURES');

View File

@@ -88,6 +88,7 @@ function paramParser(
// The `window.location.search` can be used while creating an instance of the `HttpParams` class
// (e.g. `new HttpParams({ fromString: window.location.search })`). The `window.location.search`
// may start with the `?` char, so we strip it if it's present.
// biome-ignore lint/performance/useTopLevelRegex: <explanation>
const params: string[] = rawParams.replace(/^\?/, '').split('&');
params.forEach((param: string) => {
const eqIdx = param.indexOf('=');
@@ -304,7 +305,7 @@ export class HttpParams {
toNgify(): NgifyHttpParams {
this.init();
return new NgifyHttpParams().appendAll(
Object.fromEntries(this.map.entries())
Object.fromEntries(this.map!.entries())
);
}