namirasoft-core
Advanced tools
| export declare function FindUp(fileName: string): string[]; |
| "use strict"; | ||
| var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| var desc = Object.getOwnPropertyDescriptor(m, k); | ||
| if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
| desc = { enumerable: true, get: function() { return m[k]; } }; | ||
| } | ||
| Object.defineProperty(o, k2, desc); | ||
| }) : (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| o[k2] = m[k]; | ||
| })); | ||
| var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
| Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
| }) : function(o, v) { | ||
| o["default"] = v; | ||
| }); | ||
| var __importStar = (this && this.__importStar) || function (mod) { | ||
| if (mod && mod.__esModule) return mod; | ||
| var result = {}; | ||
| if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
| __setModuleDefault(result, mod); | ||
| return result; | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.FindUp = void 0; | ||
| const fs = __importStar(require("fs")); | ||
| const path = __importStar(require("path")); | ||
| function FindUp(fileName) { | ||
| let currentDir = __dirname; | ||
| const rootDir = process.cwd(); | ||
| const foundFilePaths = []; | ||
| function searchRecursively(dir) { | ||
| const files = fs.readdirSync(dir); | ||
| if (files.includes(fileName)) { | ||
| foundFilePaths.push(path.join(dir, fileName)); | ||
| } | ||
| const parentDir = path.dirname(dir); | ||
| if (parentDir === dir || parentDir === rootDir) { | ||
| return; | ||
| } | ||
| searchRecursively(parentDir); | ||
| } | ||
| searchRecursively(currentDir); | ||
| return foundFilePaths; | ||
| } | ||
| exports.FindUp = FindUp; | ||
| //# sourceMappingURL=FindUp.js.map |
| {"version":3,"file":"FindUp.js","sourceRoot":"","sources":["../src/FindUp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,SAAgB,MAAM,CAAC,QAAgB;IAEnC,IAAI,UAAU,GAAW,SAAS,CAAC;IACnC,MAAM,OAAO,GAAW,OAAO,CAAC,GAAG,EAAE,CAAC;IACtC,MAAM,cAAc,GAAa,EAAE,CAAC;IACpC,SAAS,iBAAiB,CAAC,GAAW;QAElC,MAAM,KAAK,GAAa,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAC5B;YACI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;SACjD;QACD,MAAM,SAAS,GAAW,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,SAAS,KAAK,GAAG,IAAI,SAAS,KAAK,OAAO,EAC9C;YACI,OAAO;SACV;QACD,iBAAiB,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IACD,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC9B,OAAO,cAAc,CAAC;AAC1B,CAAC;AArBD,wBAqBC"} |
| import * as fs from 'fs'; | ||
| import * as path from 'path'; | ||
| export function FindUp(fileName: string): string[] | ||
| { | ||
| let currentDir: string = __dirname; | ||
| const rootDir: string = process.cwd(); | ||
| const foundFilePaths: string[] = []; | ||
| function searchRecursively(dir: string) | ||
| { | ||
| const files: string[] = fs.readdirSync(dir); | ||
| if (files.includes(fileName)) | ||
| { | ||
| foundFilePaths.push(path.join(dir, fileName)); | ||
| } | ||
| const parentDir: string = path.dirname(dir); | ||
| if (parentDir === dir || parentDir === rootDir) | ||
| { | ||
| return; | ||
| } | ||
| searchRecursively(parentDir); | ||
| } | ||
| searchRecursively(currentDir); | ||
| return foundFilePaths; | ||
| } |
@@ -8,2 +8,3 @@ "use strict"; | ||
| const fs_1 = __importDefault(require("fs")); | ||
| const FindUp_1 = require("./FindUp"); | ||
| class PackageService { | ||
@@ -19,11 +20,11 @@ static get(path) { | ||
| static getMain() { | ||
| // const paths = findUp.findUpSync('package.json'); | ||
| // if (paths) | ||
| // return this.get(paths[0]); | ||
| const paths = (0, FindUp_1.FindUp)('package.json'); | ||
| if (paths) | ||
| return this.get(paths[0]); | ||
| return null; | ||
| } | ||
| static getThis() { | ||
| // const paths = findUp.findUpSync('package.json'); | ||
| // if (paths) | ||
| // return this.get(paths[paths.length - 1]); | ||
| const paths = (0, FindUp_1.FindUp)('package.json'); | ||
| if (paths) | ||
| return this.get(paths[paths.length - 1]); | ||
| return null; | ||
@@ -30,0 +31,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"PackageService.js","sourceRoot":"","sources":["../src/PackageService.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AAEpB,MAAa,cAAc;IAEvB,MAAM,CAAC,GAAG,CAAC,IAAY;QAEnB,IAAI,IAAI,EACR;YACI,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;YACvD,IAAI,IAAI;gBACJ,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;SACvC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,MAAM,CAAC,OAAO;QAEV,mDAAmD;QACnD,aAAa;QACb,iCAAiC;QACjC,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,MAAM,CAAC,OAAO;QAEV,mDAAmD;QACnD,aAAa;QACb,gDAAgD;QAChD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,YAAY,IAAS;QAEjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IACD,OAAO;QAEH,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IAC1B,CAAC;IACD,QAAQ;QAEJ,OAAO,IAAI,CAAC,IAAI,CA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AI,CAAC;IACrB,CAAC;IACD,OAAO;QAEH,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IAC1B,CAAC;IACD,QAAQ;QAEJ,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;IAC3B,CAAC;IACD,cAAc;QAEV,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;IACjC,CAAC;IACD,OAAO;QAEH,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IAC1B,CAAC;IACD,OAAO;QAEH,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IAC1B,CAAC;IACD,UAAU;QAEN,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC7B,CAAC;CACJ;AAvDD,wCAuDC"} |
+1
-1
| { | ||
| "name": "namirasoft-core", | ||
| "description": "Namira Software Corporation Core NPM Package", | ||
| "version": "1.0.8", | ||
| "version": "1.0.9", | ||
| "main": "./dist/index.js", | ||
@@ -6,0 +6,0 @@ "types": "./dist/index.d.ts", |
| import fs from "fs"; | ||
| import { FindUp } from "./FindUp"; | ||
@@ -17,5 +18,5 @@ export class PackageService | ||
| { | ||
| // const paths = findUp.findUpSync('package.json'); | ||
| // if (paths) | ||
| // return this.get(paths[0]); | ||
| const paths = FindUp('package.json'); | ||
| if (paths) | ||
| return this.get(paths[0]); | ||
| return null; | ||
@@ -25,5 +26,5 @@ } | ||
| { | ||
| // const paths = findUp.findUpSync('package.json'); | ||
| // if (paths) | ||
| // return this.get(paths[paths.length - 1]); | ||
| const paths = FindUp('package.json'); | ||
| if (paths) | ||
| return this.get(paths[paths.length - 1]); | ||
| return null; | ||
@@ -30,0 +31,0 @@ } |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
220955
1.66%94
4.44%3215
2.32%7
40%