/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
/** * Returns the content type for the specified URL. If no specific * content type can be determined, "text/plain" is returned. * * @return String * The content type.
*/ function getContentType(url) {
url = trimUrlQuery(url); const dot = url.lastIndexOf("."); if (dot >= 0) { const name = url.substring(dot + 1); if (name in contentMap) { return contentMap[name];
}
} return"text/plain";
}
function memoize(func) { const map = new Map();
return arg => { if (map.has(arg)) { return map.get(arg);
}
const result = func(arg);
map.set(arg, result); return result;
};
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.