Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / base / node_modules / define-property / index.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/base/node_modules/define-property/index.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/base/node_modules/define-property/index.js
new file mode 100644 (file)
index 0000000..27c19eb
--- /dev/null
@@ -0,0 +1,31 @@
+/*!
+ * define-property <https://github.com/jonschlinkert/define-property>
+ *
+ * Copyright (c) 2015, 2017, Jon Schlinkert.
+ * Released under the MIT License.
+ */
+
+'use strict';
+
+var isDescriptor = require('is-descriptor');
+
+module.exports = function defineProperty(obj, prop, val) {
+  if (typeof obj !== 'object' && typeof obj !== 'function') {
+    throw new TypeError('expected an object or function.');
+  }
+
+  if (typeof prop !== 'string') {
+    throw new TypeError('expected `prop` to be a string.');
+  }
+
+  if (isDescriptor(val) && ('set' in val || 'get' in val)) {
+    return Object.defineProperty(obj, prop, val);
+  }
+
+  return Object.defineProperty(obj, prop, {
+    configurable: true,
+    enumerable: false,
+    writable: true,
+    value: val
+  });
+};