MCPcopy
hub / github.com/axios/axios / toObjectSet

Function toObjectSet

lib/utils.js:791–803  ·  view source on GitHub ↗
(arrayOrString, delimiter)

Source from the content-addressed store, hash-verified

789 * @returns {Object} An object with keys from the array or string, values set to true.
790 */
791const toObjectSet = (arrayOrString, delimiter) => {
792 const obj = {};
793
794 const define = (arr) => {
795 arr.forEach((value) => {
796 obj[value] = true;
797 });
798 };
799
800 isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
801
802 return obj;
803};
804
805const noop = () => {};
806

Callers

nothing calls this directly

Calls 1

defineFunction · 0.85

Tested by

no test coverage detected