some deletions
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / node_modules / map-obj / index.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/stylelint/node_modules/map-obj/index.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/stylelint/node_modules/map-obj/index.js
deleted file mode 100644 (file)
index 2a19cde..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-'use strict';
-
-// customized for this use-case
-const isObject = x =>
-       typeof x === 'object' &&
-       x !== null &&
-       !(x instanceof RegExp) &&
-       !(x instanceof Error) &&
-       !(x instanceof Date);
-
-module.exports = function mapObj(obj, fn, opts, seen) {
-       opts = Object.assign({
-               deep: false,
-               target: {}
-       }, opts);
-
-       seen = seen || new WeakMap();
-
-       if (seen.has(obj)) {
-               return seen.get(obj);
-       }
-
-       seen.set(obj, opts.target);
-
-       const target = opts.target;
-       delete opts.target;
-
-       for (const key of Object.keys(obj)) {
-               const val = obj[key];
-               const res = fn(key, val, obj);
-               let newVal = res[1];
-
-               if (opts.deep && isObject(newVal)) {
-                       if (Array.isArray(newVal)) {
-                               newVal = newVal.map(x => isObject(x) ? mapObj(x, fn, opts, seen) : x);
-                       } else {
-                               newVal = mapObj(newVal, fn, opts, seen);
-                       }
-               }
-
-               target[res[0]] = newVal;
-       }
-
-       return target;
-};