MCPcopy Create free account
hub / github.com/CoderOpen/waimai / parseAttrs

Function parseAttrs

front/common/html-parser.js:257–270  ·  view source on GitHub ↗
(attrs)

Source from the content-addressed store, hash-verified

255}
256
257function parseAttrs(attrs) {
258 return attrs.reduce(function (pre, attr) {
259 var value = attr.value;
260 var name = attr.name;
261
262 if (pre[name]) {
263 pre[name] = pre[name] + " " + value;
264 } else {
265 pre[name] = value;
266 }
267
268 return pre;
269 }, {});
270}
271
272function parseHtml(html) {
273 html = removeDOCTYPE(html);

Callers 1

parseHtmlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected