semantic-network
Version:
A utility library for manipulating a list of links that form a semantic interface to a network of resources.
16 lines • 715 B
JavaScript
import { Status } from './status';
import { dateToGMTHeader } from '../utils/dateToGMTHeader';
export class State {
constructor(status, eTag, lastModified) {
// ensure that UTC dates are converted across to GMT headers
const lastModifiedHeader = dateToGMTHeader(lastModified);
this.status = status || Status.unknown;
this.previousStatus = undefined;
this.singleton = new Set();
this.collection = new Set();
this.headers = {};
this.retrieved = undefined;
this.feedHeaders = Object.assign(Object.assign({}, (eTag && { etag: eTag })), (lastModifiedHeader && { 'last-modified': lastModifiedHeader }));
}
}
//# sourceMappingURL=state.js.map