Skip to content

Commit

Permalink
fix: fix typo in isValidJSIdentifier
Browse files Browse the repository at this point in the history
  • Loading branch information
nebrelbug committed Jul 2, 2024
1 parent 426f930 commit 45475e9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ try {

export { asyncFunc }

export function hasOwnProp (obj: object, prop: string) {
export function hasOwnProp(obj: object, prop: string) {
return Object.prototype.hasOwnProperty.call(obj, prop)
}

export function copyProps<T> (toObj: T, fromObj: T, notConfig?: boolean) {
export function copyProps<T>(toObj: T, fromObj: T, notConfig?: boolean) {
for (var key in fromObj) {
if (hasOwnProp((fromObj as unknown) as object, key)) {
if (hasOwnProp(fromObj as unknown as object, key)) {
if (
fromObj[key] != null &&
typeof fromObj[key] == 'object' &&
Expand All @@ -48,7 +48,7 @@ export function copyProps<T> (toObj: T, fromObj: T, notConfig?: boolean) {
return toObj
}

function trimWS (
function trimWS(
str: string,
env: SqrlConfig,
wsLeft: string | false,
Expand Down Expand Up @@ -114,8 +114,8 @@ function trimWS (
}

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

export { trimWS, isValidJSIdentifier }
export { isValidJSIdentifier, trimWS }

0 comments on commit 45475e9

Please sign in to comment.