MCPcopy
hub / github.com/hapijs/hapi / entity

Method entity

lib/toolkit.js:202–213  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

200 }
201
202 entity(options) {
203
204 Hoek.assert(options, 'Entity method missing required options');
205 Hoek.assert(options.etag || options.modified, 'Entity methods missing required options key');
206
207 this.request._entity = options;
208
209 const entity = this.request._core.Response.entity(options.etag, options);
210 if (this.request._core.Response.unmodified(this.request, entity)) {
211 return this.response().code(304).takeover();
212 }
213 }
214
215 state(name, value, options) {
216

Callers

nothing calls this directly

Calls 5

unmodifiedMethod · 0.80
entityMethod · 0.65
takeoverMethod · 0.65
codeMethod · 0.65
responseMethod · 0.65

Tested by

no test coverage detected