Skip to content

Commit 7bb0806

Browse files
committed
appease esbuild minification naming
1 parent dd1b59f commit 7bb0806

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

minify.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
#!/usr/bin/env bash
2-
2+
# Output the "no mod" file to "build/urlfor.js" since esbuild names the map
3+
# source whatever the original input file is named.
34

45
file=urlform.js
56
minfile=urlform.min.js
67
match="//////////////////////////////Regex_match_for_truncation_for_umd"
78
line_num=$(grep -n "$match" $file | cut -d : -f 1)
89
echo "Line number for truncation: $line_num"
9-
head -n $(($line_num - 1)) $file > nomod.js
10-
11-
12-
esbuild nomod.js --minify --sourcemap --outfile=$minfile
13-
14-
rm nomod.js
10+
mkdir build
11+
head -n $(($line_num - 1)) $file > build/urlform.js
12+
esbuild build/urlform.js --minify --sourcemap --outfile=$minfile
13+
rm -r build
1514

1615
# Add back in UMD Module.
1716
tail -n +$(($line_num + 1)) $file >> $minfile

urlform.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -815,10 +815,13 @@ function GetQuagParts(formOptions) {
815815
*
816816
* On duplicate the default behavior overwrites query pairs with fragment pairs.
817817
*
818-
* @param {FormOptions} formOptions
818+
* @param {FormOptions} [formOptions]
819819
* @returns {QuagParts.pairs}
820820
*/
821821
function GetURLKeyValue(formOptions) {
822+
if (isEmpty(formOptions)) {
823+
formOptions = GetDefaultFormOptions();
824+
}
822825
let qp = GetQuagParts(formOptions);
823826
return qp.pairs;
824827
}
@@ -1086,11 +1089,11 @@ function isBool(bool) {
10861089

10871090
//////////////////////////////Regex_match_for_truncation_for_umd
10881091
// UMD export see https://github.com/Cyphrme/UMD_tutorial
1089-
(function (global, factory) {
1092+
(function(global, factory) {
10901093
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
10911094
typeof define === 'function' && define.amd ? define(['exports'], factory) :
10921095
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.URLForm = {}));
1093-
})(this, (function (exports) {
1096+
})(this, (function(exports) {
10941097
exports.Init = Init;
10951098
exports.PopulateFromValues = PopulateFromValues;
10961099
exports.Populate = Populate;

urlform.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

urlform.min.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)