0

I am using few in-house angular libraries, published on company's local npm repository. There is also a code base maintained, but i have noticed the latest code is not checked in for latest published version. (Bad set-up)

I am looking into possibilities for recover the original code from node_modules for these libraries. I could see only declaration files (.d.ts) and bunch of .js

"es2015": "fesm2015/my-angular-lib.js",
"esm2015": "esm2015/my-angular-lib.js",
"esm5": "esm5/my-angular-lib.js",
"fesm2015": "fesm2015/my-angular-lib.js",
"fesm5": "fesm5/my-angular-lib.js",
"license": "MIT",
"main": "bundles/my-angular-lib.umd.js",
"metadata": "my-angular-lib.metadata.json",
"module": "fesm5/my-angular-lib.js",
"name": "my-angular-lib",
"sideEffects": false,
"typings": "my-angular-lib.d.ts",
"version": "1.1.31"

Is there any standard way to recover the original code?

I could recover few libs by referring code in js but some libs codebase is big and i want to avoid manual task and errors.

capt.Nemo
  • 1
  • 1
  • If it was not published with sourceMaps, I don't think this is possible – David Jun 04 '19 at 09:38
  • Simply go to their github repository and check the source code. –  Jun 04 '19 at 09:40
  • @David thanks for quick reply, ng-packagr is used to build output to dist and /dist is published "npm publish dist", How do I check if it is published with sourceMaps ? – capt.Nemo Jun 04 '19 at 09:56
  • @Maryannah unfortunately its in-house built lib, developer "forgot" to check-in code before publishing. – capt.Nemo Jun 04 '19 at 09:56
  • @capt.Nemo if you have it in your package file, then it's somewhere. Now you just need to know where ! –  Jun 04 '19 at 10:03
  • @Maryannah Yes, I have access to published distribution of the package, which contains declaration files (.d.ts) and converted .js files. Now I want to recover original .ts files from this published package. – capt.Nemo Jun 04 '19 at 10:15

0 Answers0