@rsdk/common.node 6.0.0-next.1 → 6.0.0-next.11
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-obj.js","sourceRoot":"","sources":["../../src/serialization/read-obj.ts"],"names":[],"mappings":";;;;;;AAAA,qCAAyC;AACzC,0DAA6B;AAE7B,qCAAgD;AAChD,yDAAgD;AAEhD;;;;;;GAMG;AACI,MAAM,OAAO,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"read-obj.js","sourceRoot":"","sources":["../../src/serialization/read-obj.ts"],"names":[],"mappings":";;;;;;AAAA,qCAAyC;AACzC,0DAA6B;AAE7B,qCAAgD;AAChD,yDAAgD;AAEhD;;;;;;GAMG;AACI,MAAM,OAAO,GAAG,KAAK,EAAe,UAAkB,EAAc,EAAE;IAC3E,IAAI,CAAC,mBAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,6BAAoB,CAAC,UAAU,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,MAAM,GAAG,6BAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAChD,MAAM,OAAO,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAE9C,OAAO,6BAAU,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAM,CAAC;AAC3D,CAAC,CAAC;AATW,QAAA,OAAO,WASlB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdk/common.node",
|
|
3
|
-
"version": "6.0.0-next.
|
|
3
|
+
"version": "6.0.0-next.11",
|
|
4
4
|
"description": "Useful common classes, functions and types",
|
|
5
5
|
"license": "Apache License 2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"prepublishOnly": "npm run build"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@rsdk/common": "6.0.0-next.
|
|
17
|
+
"@rsdk/common": "6.0.0-next.11",
|
|
18
|
+
"@sinclair/typebox": "^0.34.9",
|
|
18
19
|
"dotenv": "^16.3.1",
|
|
19
|
-
"rxjs": "^7.8.1",
|
|
20
20
|
"toml": "^3.0.0",
|
|
21
21
|
"yaml": "^2.6.1"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "e4a3d962f23e2c4ea39ec08e07628290f54812a6"
|
|
24
24
|
}
|
|
@@ -11,7 +11,7 @@ import { Serializer } from './serializer.class';
|
|
|
11
11
|
* @param {string} pathToFile Absolute path to file.
|
|
12
12
|
* @returns {any}
|
|
13
13
|
*/
|
|
14
|
-
export const readObj = async (pathToFile: string): Promise<
|
|
14
|
+
export const readObj = async <T = unknown>(pathToFile: string): Promise<T> => {
|
|
15
15
|
if (!path.isAbsolute(pathToFile)) {
|
|
16
16
|
throw new NotAbsolutePathError(pathToFile);
|
|
17
17
|
}
|
|
@@ -19,5 +19,5 @@ export const readObj = async (pathToFile: string): Promise<unknown> => {
|
|
|
19
19
|
const format = Serializer.getFormat(pathToFile);
|
|
20
20
|
const content = await fs.readFile(pathToFile);
|
|
21
21
|
|
|
22
|
-
return Serializer.parse(content.toString(), format);
|
|
22
|
+
return Serializer.parse(content.toString(), format) as T;
|
|
23
23
|
};
|