mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Allow null for cache data, according to HAR spec.
The HAR spec allows for afterRequest and beforeRequest to be null, see http://www.softwareishard.com/blog/har-12-spec/#cache. This has a different semantics from the fields being left out.
This commit is contained in:
@@ -89,6 +89,19 @@ const testEntry: harFormat.Entry = {
|
||||
pageref: "page_1"
|
||||
};
|
||||
|
||||
// Examples from http://www.softwareishard.com/blog/har-12-spec/#cache
|
||||
const testCacheNoInformation: harFormat.Cache = {
|
||||
};
|
||||
|
||||
const testNoCacheAfter: harFormat.Cache = {
|
||||
afterRequest: null
|
||||
};
|
||||
|
||||
const testCacheNotCached: harFormat.Cache = {
|
||||
beforeRequest: null,
|
||||
afterRequest: null
|
||||
};
|
||||
|
||||
const testLog: harFormat.Log = {
|
||||
version: "1.2",
|
||||
creator: testCreator,
|
||||
|
||||
Vendored
+2
-2
@@ -728,13 +728,13 @@ export interface Cache {
|
||||
*
|
||||
* Leave out this field if the information is not available.
|
||||
*/
|
||||
beforeRequest?: CacheDetails;
|
||||
beforeRequest?: CacheDetails | null;
|
||||
/**
|
||||
* State of a cache entry after the request.
|
||||
*
|
||||
* Leave out this field if the information is not available.
|
||||
*/
|
||||
afterRequest?: CacheDetails;
|
||||
afterRequest?: CacheDetails | null;
|
||||
/** A comment provided by the user or the application */
|
||||
comment?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user