@mytmpvpn/mytmpvpn-common 3.1.0 → 4.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.
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PEANUTS_CONFIG = void 0;
4
4
  const PEANUTS_CONFIG = {
5
- min: 5,
5
+ min: 1,
6
6
  max: 1000
7
7
  };
8
8
  exports.PEANUTS_CONFIG = PEANUTS_CONFIG;
@@ -20,5 +20,5 @@ interface getUserVpnFromParams {
20
20
  }
21
21
  declare function newUserVpn({ userId, region, version, ...rest }: newUserVpnParams): UserVpn;
22
22
  declare function getUserVpnFrom({ userId, vpnId, version, ...rest }: getUserVpnFromParams): UserVpn;
23
- declare function jsonToUserVpn(json: any): UserVpn;
23
+ declare function jsonToUserVpn(jsonString: any): UserVpn;
24
24
  export { type UserVpn, newUserVpn, getUserVpnFrom, jsonToUserVpn };
@@ -19,8 +19,8 @@ function getUserVpnFrom({ userId, vpnId, version = INITIAL_VERSION, ...rest }) {
19
19
  };
20
20
  }
21
21
  exports.getUserVpnFrom = getUserVpnFrom;
22
- function jsonToUserVpn(json) {
23
- const parsed = JSON.parse(json, (key, value) => {
22
+ function jsonToUserVpn(jsonString) {
23
+ const parsed = JSON.parse(jsonString, (key, value) => {
24
24
  if (key === 'createdAt') {
25
25
  return new Date(value);
26
26
  }
@@ -86,8 +86,8 @@ describe('Testing Vpn constructors', () => {
86
86
  },
87
87
  state: vpn_1.VpnState.Created,
88
88
  });
89
- const json = JSON.stringify(originalVpn);
90
- const userVpn = (0, uservpn_1.jsonToUserVpn)(json);
89
+ const jsonString = JSON.stringify(originalVpn);
90
+ const userVpn = (0, uservpn_1.jsonToUserVpn)(jsonString);
91
91
  expect(userVpn).toEqual(originalVpn);
92
92
  });
93
93
  it('Should shout when vpnId is empty', async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mytmpvpn/mytmpvpn-common",
3
- "version": "3.1.0",
3
+ "version": "4.0.0",
4
4
  "description": "Common library for all MyTmpVpn related projects",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [