21 lines
493 B
TypeScript
21 lines
493 B
TypeScript
import { HttpParameterCodec } from '@angular/common/http';
|
|
|
|
export class HttpUrlEncodingCodec implements HttpParameterCodec {
|
|
encodeKey(k: string): string {
|
|
return this.standardEncoding(k);
|
|
}
|
|
encodeValue(v: string): string {
|
|
return this.standardEncoding(v);
|
|
}
|
|
decodeKey(k: string): string {
|
|
return decodeURIComponent(k);
|
|
}
|
|
decodeValue(v: string) {
|
|
return decodeURIComponent(v);
|
|
}
|
|
|
|
standardEncoding(v: string): string {
|
|
return encodeURIComponent(v);
|
|
}
|
|
}
|