Download ADOOR_ACE/node_modules/express-http-proxy/lib/as.js from thisisAce/adoor-store: direct link, hf CLI and curl.
- Browser
- Download file 714 Bytes
-
https://huggingface.co/thisisAce/adoor-store/resolve/main/ADOOR_ACE/node_modules/express-http-proxy/lib/as.js
- Command line
-
hf download hf://thisisAce/adoor-store/ADOOR_ACE/node_modules/express-http-proxy/lib/as.js
-
curl -L -o as.js https://huggingface.co/thisisAce/adoor-store/resolve/main/ADOOR_ACE/node_modules/express-http-proxy/lib/as.js
714 Bytes
| ; | |
| /* | |
| * Trivial convenience methods for parsing Buffers | |
| */ | |
| function asBuffer(body, options) { | |
| var ret; | |
| if (Buffer.isBuffer(body)) { | |
| ret = body; | |
| } else if (typeof body === 'object') { | |
| ret = new Buffer(JSON.stringify(body), options.reqBodyEncoding); | |
| } else if (typeof body === 'string') { | |
| ret = new Buffer(body, options.reqBodyEncoding); | |
| } | |
| return ret; | |
| } | |
| function asBufferOrString(body) { | |
| var ret; | |
| if (Buffer.isBuffer(body)) { | |
| ret = body; | |
| } else if (typeof body === 'object') { | |
| ret = JSON.stringify(body); | |
| } else if (typeof body === 'string') { | |
| ret = body; | |
| } | |
| return ret; | |
| } | |
| module.exports = { | |
| buffer: asBuffer, | |
| bufferOrString: asBufferOrString | |
| }; | |