File: default_value

package info (click to toggle)
node-rollup-plugin-replace 5.0.1%2Bds%2B~2.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,220 kB
  • sloc: javascript: 1,158; makefile: 10
file content (16 lines) | stat: -rw-r--r-- 477 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Description: don't use default values for arguments
Author: Julien Puydt
Forwarded: not-needed

--- a/legacy/src/index.js
+++ b/legacy/src/index.js
@@ -35,7 +35,8 @@
 	}, {});
 }
 
-export default function replace(options = {}) {
+export default function replace(options) {
+        if (!options) options = {};
 	const filter = createFilter(options.include, options.exclude);
 	const { delimiters } = options;
 	const functionValues = mapToFunctions(getReplacements(options));