Download backend/node_modules/@hapi/hoek/lib/escapeHeaderAttribute.js from chainr-ai/CHAINR: direct link, hf CLI and curl.
- Browser
- Download file 474 Bytes
-
https://huggingface.co/chainr-ai/CHAINR/resolve/main/backend/node_modules/%40hapi/hoek/lib/escapeHeaderAttribute.js
- Command line
-
hf download hf://chainr-ai/CHAINR/backend/node_modules/@hapi/hoek/lib/escapeHeaderAttribute.js
-
curl -L -o escapeHeaderAttribute.js https://huggingface.co/chainr-ai/CHAINR/resolve/main/backend/node_modules/%40hapi/hoek/lib/escapeHeaderAttribute.js
474 Bytes
| ; | |
| const Assert = require('./assert'); | |
| const internals = {}; | |
| module.exports = function (attribute) { | |
| // Allowed value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9, \, " | |
| Assert(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(attribute), 'Bad attribute value (' + attribute + ')'); | |
| return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"'); // Escape quotes and slash | |
| }; | |