Skip to content

Commit fdd3d8e

Browse files
committed
Fail to tell esbuild to drop stuff
1 parent b0afb8f commit fdd3d8e

File tree

2 files changed

+28
-16
lines changed

2 files changed

+28
-16
lines changed

src/dict.mjs

+7-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
import { isEqual } from "./gleam.mjs";
77

88
const referenceMap = new WeakMap();
9-
const tempDataView = new DataView(new ArrayBuffer(8));
9+
const tempDataView = /* @__PURE__ */ new DataView(
10+
/* @__PURE__ */ new ArrayBuffer(8),
11+
);
1012
let referenceUID = 0;
1113
/**
1214
* hash the object by reference using a weak map and incrementing uid
@@ -308,7 +310,7 @@ function createNode(shift, key1, val1, key2hash, key2, val2) {
308310
key2hash,
309311
key2,
310312
val2,
311-
addedLeaf
313+
addedLeaf,
312314
);
313315
}
314316
/**
@@ -377,7 +379,7 @@ function assocArray(root, shift, hash, key, val, addedLeaf) {
377379
array: cloneAndSet(
378380
root.array,
379381
idx,
380-
createNode(shift + SHIFT, node.k, node.v, hash, key, val)
382+
createNode(shift + SHIFT, node.k, node.v, hash, key, val),
381383
),
382384
};
383385
}
@@ -441,7 +443,7 @@ function assocIndex(root, shift, hash, key, val, addedLeaf) {
441443
array: cloneAndSet(
442444
root.array,
443445
idx,
444-
createNode(shift + SHIFT, nodeKey, node.v, hash, key, val)
446+
createNode(shift + SHIFT, nodeKey, node.v, hash, key, val),
445447
),
446448
};
447449
} else {
@@ -528,7 +530,7 @@ function assocCollision(root, shift, hash, key, val, addedLeaf) {
528530
hash,
529531
key,
530532
val,
531-
addedLeaf
533+
addedLeaf,
532534
);
533535
}
534536
/**

src/gleam_stdlib.mjs

+21-11
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ export function to_string(term) {
4747
}
4848

4949
export function float_to_string(float) {
50-
const string = float.toString().replace('+', '');
50+
const string = float.toString().replace("+", "");
5151
if (string.indexOf(".") >= 0) {
5252
return string;
5353
} else {
5454
const index = string.indexOf("e");
5555
if (index >= 0) {
56-
return string.slice(0, index) + '.0' + string.slice(index);
56+
return string.slice(0, index) + ".0" + string.slice(index);
5757
} else {
5858
return string + ".0";
5959
}
@@ -186,7 +186,7 @@ export function pop_grapheme(string) {
186186
}
187187

188188
export function pop_codeunit(str) {
189-
return [str.charCodeAt(0)|0, str.slice(1)]
189+
return [str.charCodeAt(0) | 0, str.slice(1)];
190190
}
191191

192192
export function lowercase(string) {
@@ -256,12 +256,15 @@ export function string_slice(string, idx, len) {
256256

257257
return result;
258258
} else {
259-
return string.match(/./gsu).slice(idx, idx + len).join("");
259+
return string
260+
.match(/./gsu)
261+
.slice(idx, idx + len)
262+
.join("");
260263
}
261264
}
262265

263266
export function string_codeunit_slice(str, from, length) {
264-
return str.slice(from, from + length)
267+
return str.slice(from, from + length);
265268
}
266269
export function crop_string(string, substring) {
267270
return string.substring(string.indexOf(substring));
@@ -290,7 +293,8 @@ export function split_once(haystack, needle) {
290293
}
291294
}
292295

293-
const unicode_whitespaces = [
296+
/* @__PURE__ */
297+
const unicode_whitespaces = /* @__PURE__ */ [
294298
"\u0020", // Space
295299
"\u0009", // Horizontal tab
296300
"\u000A", // Line feed
@@ -302,10 +306,17 @@ const unicode_whitespaces = [
302306
"\u2029", // Paragraph separator
303307
].join("");
304308

305-
const trim_start_regex = new RegExp(`^[${unicode_whitespaces}]*`);
306-
const trim_end_regex = new RegExp(`[${unicode_whitespaces}]*$`);
307-
const trim_regex = new RegExp(
308-
`^[${unicode_whitespaces}]*(.*?)[${unicode_whitespaces}]*$`
309+
/* @__PURE__ */
310+
const trim_start_regex = /* @__PURE__ */ new RegExp(
311+
`^[${unicode_whitespaces}]*`,
312+
);
313+
/* @__PURE__ */
314+
const trim_end_regex = /* @__PURE__ */ new RegExp(
315+
/* @__PURE__ */ `[${unicode_whitespaces}]*$`,
316+
);
317+
/* @__PURE__ */
318+
const trim_regex = /* @__PURE__ */ new RegExp(
319+
/* @__PURE__ */ `^[${unicode_whitespaces}]*(.*?)[${unicode_whitespaces}]*$`,
309320
);
310321

311322
export function trim(string) {
@@ -1014,4 +1025,3 @@ export function bit_array_starts_with(bits, prefix) {
10141025

10151026
return true;
10161027
}
1017-

0 commit comments

Comments
 (0)