merge-options 3.0.0 → 3.0.4

Sign up to get free protection for your applications and to get access to all the features.
package/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ declare function mergeOptions(...options: any[]): any;
2
+ export = mergeOptions;
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- import isOptionObject from 'is-plain-obj';
2
+ const isOptionObject = require('is-plain-obj');
3
3
 
4
4
  const {hasOwnProperty} = Object.prototype;
5
5
  const {propertyIsEnumerable} = Object;
@@ -151,7 +151,7 @@ function merge(merged, source, config) {
151
151
  return mergeKeys(merged, source, getEnumerableOwnPropertyKeys(source), config);
152
152
  }
153
153
 
154
- export default function mergeOptions(...options) {
154
+ module.exports = function (...options) {
155
155
  const config = merge(clone(defaultMergeOptions), (this !== globalThis && this) || {}, defaultMergeOptions);
156
156
  let merged = {_: {}};
157
157
 
@@ -168,4 +168,4 @@ export default function mergeOptions(...options) {
168
168
  }
169
169
 
170
170
  return merged._;
171
- }
171
+ };
package/index.mjs ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Thin ESM wrapper for CJS named exports.
3
+ *
4
+ * Ref: https://redfin.engineering/node-modules-at-war-why-commonjs-and-es-modules-cant-get-along-9617135eeca1
5
+ */
6
+
7
+ import mergeOptions from './index.js';
8
+ export default mergeOptions;
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "merge-options",
3
- "version": "3.0.0",
4
- "type": "module",
3
+ "version": "3.0.4",
5
4
  "description": "Merge Option Objects",
6
5
  "license": "MIT",
7
6
  "repository": "schnittstabil/merge-options",
@@ -10,15 +9,25 @@
10
9
  "email": "michael@schnittstabil.de"
11
10
  },
12
11
  "engines": {
13
- "node": ">=14"
12
+ "node": ">=10"
14
13
  },
15
14
  "scripts": {
16
- "test": "xo && nyc ava",
15
+ "test": "xo && tsd && nyc ava",
16
+ "lint": "xo",
17
+ "unit": "ava",
18
+ "typecheck": "tsd",
17
19
  "clean": "rimraf .nyc_output/ coverage/",
18
20
  "coverage-html": "nyc ava && nyc report --reporter=html"
19
21
  },
22
+ "main": "./index.js",
23
+ "exports": {
24
+ "require": "./index.js",
25
+ "import": "./index.mjs"
26
+ },
20
27
  "files": [
21
- "index.js"
28
+ "index.d.ts",
29
+ "index.js",
30
+ "index.mjs"
22
31
  ],
23
32
  "keywords": [
24
33
  "merge",
@@ -34,6 +43,7 @@
34
43
  "coveralls": "^3.1.0",
35
44
  "nyc": "^15.1.0",
36
45
  "rimraf": "^3.0.2",
46
+ "tsd": "^0.13.1",
37
47
  "xo": "^0.33.0"
38
48
  },
39
49
  "dependencies": {