@krish985/maths 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function maxOfArray(arr) {
4
+ if (arr.length == 0)
5
+ throw new Error("Array is empty");
6
+ let max = arr[0];
7
+ for (let i = 0; i < arr.length; i++) {
8
+ max = Math.max(max, arr[i]);
9
+ }
10
+ return max;
11
+ }
12
+ function fistEl(str) {
13
+ if (str.length == 0)
14
+ throw new Error('String is empty');
15
+ return str.charAt(0);
16
+ }
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,SAAS,UAAU,CAAC,GAAa;IAC7B,IAAG,GAAG,CAAC,MAAM,IAAI,CAAC;QAAG,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAA;IACtD,IAAI,GAAG,GAAY,GAAG,CAAC,CAAC,CAAE,CAAC;IAE3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAClC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAE,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC;AAED,SAAS,MAAM,CAAC,GAAY;IACxB,IAAG,GAAG,CAAC,MAAM,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;IACtD,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AACxB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "@krish985/maths",
3
+ "version": "1.0.0",
4
+ "main": "src/index.js",
5
+ "scripts": {
6
+ "test": "echo \"Error: no test specified\" && exit 1"
7
+ },
8
+ "keywords": [],
9
+ "author": "",
10
+ "license": "ISC",
11
+ "description": ""
12
+ }
package/src/index.ts ADDED
@@ -0,0 +1,15 @@
1
+ function maxOfArray(arr: number[]) {
2
+ if(arr.length == 0) throw new Error("Array is empty")
3
+ let max: number = arr[0]!;
4
+
5
+ for (let i = 0; i < arr.length; i++) {
6
+ max = Math.max(max, arr[i]!);
7
+ }
8
+
9
+ return max;
10
+ }
11
+
12
+ function fistEl(str : string){
13
+ if(str.length == 0) throw new Error('String is empty')
14
+ return str.charAt(0)
15
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ // Visit https://aka.ms/tsconfig to read more about this file
3
+ "compilerOptions": {
4
+ // File Layout
5
+ "rootDir": "./src",
6
+ "outDir": "./dist",
7
+
8
+ // Environment Settings
9
+ // See also https://aka.ms/tsconfig/module
10
+ "module": "nodenext",
11
+ "target": "esnext",
12
+ "types": [],
13
+ // For nodejs:
14
+ // "lib": ["esnext"],
15
+ // "types": ["node"],
16
+ // and npm install -D @types/node
17
+
18
+ // Other Outputs
19
+ "sourceMap": true,
20
+ "declaration": true,
21
+ "declarationMap": true,
22
+
23
+ // Stricter Typechecking Options
24
+ "noUncheckedIndexedAccess": true,
25
+ "exactOptionalPropertyTypes": true,
26
+
27
+ // Style Options
28
+ // "noImplicitReturns": true,
29
+ // "noImplicitOverride": true,
30
+ // "noUnusedLocals": true,
31
+ // "noUnusedParameters": true,
32
+ // "noFallthroughCasesInSwitch": true,
33
+ // "noPropertyAccessFromIndexSignature": true,
34
+
35
+ // Recommended Options
36
+ "strict": true,
37
+ "jsx": "react-jsx",
38
+ "verbatimModuleSyntax": true,
39
+ "isolatedModules": true,
40
+ "noUncheckedSideEffectImports": true,
41
+ "moduleDetection": "force",
42
+ "skipLibCheck": true,
43
+ }
44
+ }