From 9b8b57d1867736eb2bf6400c6453a3480e1adcfc Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 10 Dec 2019 11:50:01 -0700 Subject: [PATCH] Convert randomstring to typescript as a proof of concept --- src/{randomstring.js => randomstring.ts} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename src/{randomstring.js => randomstring.ts} (88%) diff --git a/src/randomstring.js b/src/randomstring.ts similarity index 88% rename from src/randomstring.js rename to src/randomstring.ts index 7ebe4ed78..3362c0b02 100644 --- a/src/randomstring.js +++ b/src/randomstring.ts @@ -1,5 +1,6 @@ /* Copyright 2018 New Vector Ltd +Copyright 2019 The Matrix.org Foundation C.I.C. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -export function randomString(len) { +export function randomString(len: number): string { let ret = ""; const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";