@injectivelabs/exceptions 1.10.13-beta.4 → 1.10.13-beta.5

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,4 +1,5 @@
1
1
  export * from './exceptions';
2
2
  export * from './exception';
3
+ export * from './utils';
3
4
  export * from './types';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
package/dist/cjs/index.js CHANGED
@@ -16,5 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./exceptions"), exports);
18
18
  __exportStar(require("./exception"), exports);
19
+ __exportStar(require("./utils"), exports);
19
20
  __exportStar(require("./types"), exports);
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,8CAA2B;AAC3B,0CAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,8CAA2B;AAC3B,0CAAuB;AACvB,0CAAuB"}
@@ -1,2 +1,6 @@
1
1
  export declare const toPascalCase: (str: string) => string;
2
+ export declare const formatNotificationDescription: (description: string) => {
3
+ description: string;
4
+ tooltip: string;
5
+ };
2
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,QAAS,MAAM,KAAG,MASW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,QAAS,MAAM,KAAG,MASW,CAAA;AAEtD,eAAO,MAAM,6BAA6B,gBAAiB,MAAM;;;CAchE,CAAA"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toPascalCase = void 0;
3
+ exports.formatNotificationDescription = exports.toPascalCase = void 0;
4
4
  const toPascalCase = (str) => `${str}`
5
5
  .toLowerCase()
6
6
  .replace(new RegExp(/[-_]+/, 'g'), ' ')
@@ -8,4 +8,18 @@ const toPascalCase = (str) => `${str}`
8
8
  .replace(new RegExp(/\s+(.)(\w*)/, 'g'), (_$1, $2, $3) => `${$2.toUpperCase() + $3}`)
9
9
  .replace(new RegExp(/\w/), (s) => s.toUpperCase());
10
10
  exports.toPascalCase = toPascalCase;
11
+ const formatNotificationDescription = (description) => {
12
+ const DESCRIPTION_CHARACTER_LIMIT = 60;
13
+ if (description.length <= DESCRIPTION_CHARACTER_LIMIT) {
14
+ return {
15
+ description,
16
+ tooltip: '',
17
+ };
18
+ }
19
+ return {
20
+ description: description.slice(0, DESCRIPTION_CHARACTER_LIMIT) + ' ...',
21
+ tooltip: description,
22
+ };
23
+ };
24
+ exports.formatNotificationDescription = formatNotificationDescription;
11
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;AAAO,MAAM,YAAY,GAAG,CAAC,GAAW,EAAU,EAAE,CAClD,GAAG,GAAG,EAAE;KACL,WAAW,EAAE;KACb,OAAO,CAAC,IAAI,MAAM,CAAC,OAA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ACL,WAAW;YACX,OAAO,EAAE,EAAE;SACZ,CAAA;KACF;IAED,OAAO;QACL,WAAW,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,2BAA2B,CAAC,GAAG,MAAM;QACvE,OAAO,EAAE,WAAW;KACrB,CAAA;AACH,CAAC,CAAA;AAdY,QAAA,6BAA6B,iCAczC"}
@@ -1,4 +1,5 @@
1
1
  export * from './exceptions';
2
2
  export * from './exception';
3
+ export * from './utils';
3
4
  export * from './types';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
package/dist/esm/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './exceptions';
2
2
  export * from './exception';
3
+ export * from './utils';
3
4
  export * from './types';
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
@@ -1,2 +1,6 @@
1
1
  export declare const toPascalCase: (str: string) => string;
2
+ export declare const formatNotificationDescription: (description: string) => {
3
+ description: string;
4
+ tooltip: string;
5
+ };
2
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,QAAS,MAAM,KAAG,MASW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,QAAS,MAAM,KAAG,MASW,CAAA;AAEtD,eAAO,MAAM,6BAA6B,gBAAiB,MAAM;;;CAchE,CAAA"}
@@ -4,4 +4,17 @@ export const toPascalCase = (str) => `${str}`
4
4
  .replace(new RegExp(/[^\w\s]/, 'g'), '')
5
5
  .replace(new RegExp(/\s+(.)(\w*)/, 'g'), (_$1, $2, $3) => `${$2.toUpperCase() + $3}`)
6
6
  .replace(new RegExp(/\w/), (s) => s.toUpperCase());
7
+ export const formatNotificationDescription = (description) => {
8
+ const DESCRIPTION_CHARACTER_LIMIT = 60;
9
+ if (description.length <= DESCRIPTION_CHARACTER_LIMIT) {
10
+ return {
11
+ description,
12
+ tooltip: '',
13
+ };
14
+ }
15
+ return {
16
+ description: description.slice(0, DESCRIPTION_CHARACTER_LIMIT) + ' ...',
17
+ tooltip: description,
18
+ };
19
+ };
7
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAW,EAAU,EAAE,CAClD,GAAG,GAAG,EAAE;KACL,WAAW,EAAE;KACb,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC;KACtC,OAAO,CAAC,IAAI,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;KACvC,OAAO,CACN,IAAI,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,EAC9B,CAAC,GAAG,EAAE,EAAE,E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
  "name": "@injectivelabs/exceptions",
3
3
  "description": "List of exceptions that can be reused throughout Injective's projects.",
4
- "version": "1.10.13-beta.4",
4
+ "version": "1.10.13-beta.5",
5
5
  "sideEffects": false,
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs/index.js",
@@ -37,5 +37,5 @@
37
37
  "link-module-alias": "^1.2.0",
38
38
  "shx": "^0.3.2"
39
39
  },
40
- "gitHead": "b71e6335063098eac4d400615382beb7ed0c7f3f"
40
+ "gitHead": "aa5604043da82faac6c5a0432364201080c02011"
41
41
  }