add sample 2
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
|
||||
|
||||
export { default as sample } from "./sample"
|
||||
export { default as power } from "./sample"
|
||||
|
||||
export { default as sqrt } from "./sample2"
|
||||
|
||||
11
src/sample2.ts
Normal file
11
src/sample2.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
const sqrt = (n : number): number | undefined => {
|
||||
if( typeof n === "undefined" || n === null){
|
||||
return undefined
|
||||
}
|
||||
if(typeof n !== "number"){
|
||||
return undefined
|
||||
}
|
||||
return Math.sqrt(n)
|
||||
}
|
||||
|
||||
export default sqrt
|
||||
Reference in New Issue
Block a user