MCPcopy Create free account
hub / github.com/thinkjs/thinkjs / file

Function file

lib/extend/context.js:238–252  ·  view source on GitHub ↗

* get or set file data * @param {String} name * @param {Mixed} value

(name, value)

Source from the content-addressed store, hash-verified

236 * @param {Mixed} value
237 */
238 file(name, value) {
239 if (!this[FILE]) {
240 this[FILE] = Object.assign({}, this.request.body && this.request.body.file);
241 }
242 if (!name) return this[FILE];
243 if (helper.isObject(name)) {
244 this[FILE] = Object.assign(this[FILE], name);
245 return this;
246 }
247 if (value === undefined) {
248 return this[FILE][name];
249 }
250 this[FILE][name] = value;
251 return this;
252 },
253 /**
254 * get or set cookie
255 * @param {String} name

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…