Skip to content

Commit c363d01

Browse files
committed
add max and min, spell out log
1 parent b61dc50 commit c363d01

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ui/url_hash_binding.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ export class UrlHashBinding extends RefCounted {
129129
if (stateString !== this.prevStateString) {
130130
this.prevStateString = stateString;
131131
const userFunc = this.viewer.urlHashRateLimit.value;
132-
const safeFunc = /^[x */\+\-\d\(\)le]*$/;
132+
const safeFunc = /^[xelogmaxin */\+\-\d\(\)]*$/;
133133
if (safeFunc.test(userFunc)) {
134134
const translatedFunc = userFunc
135-
.replaceAll("l", "Math.log")
135+
.replaceAll("log", "Math.log")
136136
.replaceAll("e", "Math.E");
137137
this.urlHashRateLimit.value = eval(
138138
`'use strict';(x) => ${translatedFunc}`,

0 commit comments

Comments
 (0)