@ribajs/utils
Advanced tools
Comparing version 1.9.0-beta.0 to 1.9.0-beta.1
{ | ||
"name": "@ribajs/utils", | ||
"description": "Utils module of Riba.js", | ||
"version": "1.9.0-beta.0", | ||
"version": "1.9.0-beta.1", | ||
"author": "Pascal Garber <pascal@artandcode.studio>", | ||
@@ -44,5 +44,5 @@ "contributors": [ | ||
"@babel/runtime-corejs3": "^7.11.2", | ||
"@ribajs/tsconfig": "1.9.0-beta.0", | ||
"@ribajs/tsconfig": "1.9.0-beta.1", | ||
"babel-jest": "^26.3.0" | ||
} | ||
} |
@@ -261,1 +261,21 @@ export const couldBeJson = (str?: string | null) => { | ||
}; | ||
// Get the class "that" | ||
/** | ||
* | ||
* @param that | ||
*/ | ||
export const classOf = (that: any) => { | ||
return that.constructor; | ||
}; | ||
/** | ||
* TODO: Would like to do it with class parameter T for the parent class: | ||
* | ||
export function classOf<T = any>(that: T) { | ||
return that.constructor as typeof T; | ||
}; | ||
* | ||
* but getting TypeScript error: | ||
* Property 'constructor' does not exist on type 'T'. | ||
*/ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23513
782