Skip to content

Commit 45475e9

Browse files
committed
fix: fix typo in isValidJSIdentifier
1 parent 426f930 commit 45475e9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/utils.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ try {
2222

2323
export { asyncFunc }
2424

25-
export function hasOwnProp (obj: object, prop: string) {
25+
export function hasOwnProp(obj: object, prop: string) {
2626
return Object.prototype.hasOwnProperty.call(obj, prop)
2727
}
2828

29-
export function copyProps<T> (toObj: T, fromObj: T, notConfig?: boolean) {
29+
export function copyProps<T>(toObj: T, fromObj: T, notConfig?: boolean) {
3030
for (var key in fromObj) {
31-
if (hasOwnProp((fromObj as unknown) as object, key)) {
31+
if (hasOwnProp(fromObj as unknown as object, key)) {
3232
if (
3333
fromObj[key] != null &&
3434
typeof fromObj[key] == 'object' &&
@@ -48,7 +48,7 @@ export function copyProps<T> (toObj: T, fromObj: T, notConfig?: boolean) {
4848
return toObj
4949
}
5050

51-
function trimWS (
51+
function trimWS(
5252
str: string,
5353
env: SqrlConfig,
5454
wsLeft: string | false,
@@ -114,8 +114,8 @@ function trimWS (
114114
}
115115

116116
// credit to pugjs/pug
117-
function isValidJSIdentifier (str: string) {
118-
return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name);
117+
function isValidJSIdentifier(name: string) {
118+
return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name)
119119
}
120120

121-
export { trimWS, isValidJSIdentifier }
121+
export { isValidJSIdentifier, trimWS }

0 commit comments

Comments
 (0)