@jest-games-org/backend-package-object-helpers 1.0.0 → 1.0.2

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.
package/dist/index.esm.js CHANGED
@@ -1,4 +1,22 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- const tslib_1 = require("tslib");
3
- tslib_1.__exportStar(require("./modules"), exports);
1
+ /**
2
+ * Decodes the given object.
3
+ * @param encodedObject The encoded object.
4
+ * @returns The decoded object.
5
+ */
6
+ const decodeObject = (encodedObject) => {
7
+ // Return the decoded object.
8
+ return JSON.parse(Buffer.from(encodedObject, 'base64').toString());
9
+ };
10
+
11
+ /**
12
+ * Encodes the given object.
13
+ * @param decodedObject The decoded object.
14
+ * @returns The encoded object.
15
+ */
16
+ const encodeObject = (decodedObject) => {
17
+ // Return the encoded object.
18
+ return Buffer.from(JSON.stringify(decodedObject)).toString('base64');
19
+ };
20
+
21
+ export { decodeObject, encodeObject };
4
22
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/index.ts"],"sourcesContent":["export * from './modules';\n"],"names":[],"mappings":";;AAAA,OAA0B,CAAA,YAAA,CAAA,OAAA,CAAA,WAAA,CAAA,EAAA,OAAA,CAAA"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/modules/shared/helpers/decodeObject.ts","../src/modules/shared/helpers/encodeObject.ts"],"sourcesContent":[null,null],"names":[],"mappings":"AAAA;;;;AAIG;AACU,MAAA,YAAY,GAAG,CAAI,aAAqB,KAAO;;AAE1D,IAAA,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AACrE;;ACRA;;;;AAIG;AACU,MAAA,YAAY,GAAG,CAAI,aAAgB,KAAY;;AAE1D,IAAA,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACvE;;;;"}
package/dist/index.js ADDED
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Decodes the given object.
5
+ * @param encodedObject The encoded object.
6
+ * @returns The decoded object.
7
+ */
8
+ const decodeObject = (encodedObject) => {
9
+ // Return the decoded object.
10
+ return JSON.parse(Buffer.from(encodedObject, 'base64').toString());
11
+ };
12
+
13
+ /**
14
+ * Encodes the given object.
15
+ * @param decodedObject The decoded object.
16
+ * @returns The encoded object.
17
+ */
18
+ const encodeObject = (decodedObject) => {
19
+ // Return the encoded object.
20
+ return Buffer.from(JSON.stringify(decodedObject)).toString('base64');
21
+ };
22
+
23
+ exports.decodeObject = decodeObject;
24
+ exports.encodeObject = encodeObject;
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/modules/shared/helpers/decodeObject.ts","../src/modules/shared/helpers/encodeObject.ts"],"sourcesContent":[null,null],"names":[],"mappings":";;AAAA;;;;AAIG;AACU,MAAA,YAAY,GAAG,CAAI,aAAqB,KAAO;;AAE1D,IAAA,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AACrE;;ACRA;;;;AAIG;AACU,MAAA,YAAY,GAAG,CAAI,aAAgB,KAAY;;AAE1D,IAAA,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACvE;;;;;"}
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@jest-games-org/backend-package-object-helpers",
3
3
  "description": "This backend package provides object helper methods for shared functionality.",
4
- "version": "1.0.0",
4
+ "version": "1.0.2",
5
5
  "author": "jest-games-llc",
6
6
  "license": "ISC",
7
- "main": "dist/index.cjs.js",
7
+ "main": "dist/index.js",
8
8
  "module": "dist/index.esm.js",
9
9
  "types": "dist/index.d.ts",
10
10
  "private": false,
11
11
  "keywords": [
12
- "Backend",
13
- "Package",
14
- "Object",
12
+ "Backend",
13
+ "Package",
14
+ "Object",
15
15
  "Helpers"
16
16
  ],
17
17
  "repository": {
@@ -23,14 +23,13 @@
23
23
  },
24
24
  "homepage": "https://github.com/jest-games-org//backend-package-object-helpers#readme",
25
25
  "scripts": {
26
- "build": "rm -rf dist && tsc --emitDeclarationOnly && rollup -c",
26
+ "build": "rm -rf dist && rollup -c && tsc --emitDeclarationOnly",
27
27
  "format": "prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\"",
28
28
  "lint": "eslint --ignore-path .eslintignore --ext .js,.ts .",
29
- "publish-package": "yarn publish --access public",
30
29
  "test": "jest"
31
30
  },
32
31
  "devDependencies": {
33
- "@jest-games-org/backend-package-object-types": "1.0.2",
32
+ "@jest-games-org/backend-package-object-types": "1.0.3",
34
33
  "@rollup/plugin-commonjs": "24.0.1",
35
34
  "@rollup/plugin-node-resolve": "15.0.1",
36
35
  "@rollup/plugin-typescript": "11.0.0",
package/dist/index.cjs.js DELETED
@@ -1,6 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const tslib_1 = require("tslib");
5
- tslib_1.__exportStar(require("./modules"), exports);
6
- //# sourceMappingURL=index.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/index.ts"],"sourcesContent":["export * from './modules';\n"],"names":[],"mappings":";;;;AAAA,OAA0B,CAAA,YAAA,CAAA,OAAA,CAAA,WAAA,CAAA,EAAA,OAAA,CAAA;;"}
@@ -1 +0,0 @@
1
- export * from './modules';
@@ -1 +0,0 @@
1
- export * from './shared';
@@ -1,6 +0,0 @@
1
- /**
2
- * Decodes the given object.
3
- * @param encodedObject The encoded object.
4
- * @returns The decoded object.
5
- */
6
- export declare const decodeObject: <O>(encodedObject: string) => O;
@@ -1,6 +0,0 @@
1
- /**
2
- * Encodes the given object.
3
- * @param decodedObject The decoded object.
4
- * @returns The encoded object.
5
- */
6
- export declare const encodeObject: <O>(decodedObject: O) => string;
@@ -1,2 +0,0 @@
1
- export { decodeObject } from './decodeObject';
2
- export { encodeObject } from './encodeObject';
@@ -1 +0,0 @@
1
- export * from './helpers';
File without changes
File without changes