@railgun-community/shared-models 5.1.5 → 5.1.8

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.
@@ -7,4 +7,5 @@ export * from './format';
7
7
  export * from './gas';
8
8
  export * from './network';
9
9
  export * from './promises';
10
+ export * from './util';
10
11
  export * from './versions';
@@ -23,5 +23,6 @@ __exportStar(require("./format"), exports);
23
23
  __exportStar(require("./gas"), exports);
24
24
  __exportStar(require("./network"), exports);
25
25
  __exportStar(require("./promises"), exports);
26
+ __exportStar(require("./util"), exports);
26
27
  __exportStar(require("./versions"), exports);
27
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,kDAAgC;AAChC,4CAA0B;AAC1B,sDAAoC;AACpC,0CAAwB;AACxB,2CAAyB;AACzB,wCAAsB;AACtB,4CAA0B;AAC1B,6CAA2B;AAC3B,6CAA2B","sourcesContent":["export * from './artifact-v2';\nexport * from './available-rpc';\nexport * from './compare';\nexport * from './fallback-provider';\nexport * from './error';\nexport * from './format';\nexport * from './gas';\nexport * from './network';\nexport * from './promises';\nexport * from './versions';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,kDAAgC;AAChC,4CAA0B;AAC1B,sDAAoC;AACpC,0CAAwB;AACxB,2CAAyB;AACzB,wCAAsB;AACtB,4CAA0B;AAC1B,6CAA2B;AAC3B,yCAAuB;AACvB,6CAA2B","sourcesContent":["export * from './artifact-v2';\nexport * from './available-rpc';\nexport * from './compare';\nexport * from './fallback-provider';\nexport * from './error';\nexport * from './format';\nexport * from './gas';\nexport * from './network';\nexport * from './promises';\nexport * from './util';\nexport * from './versions';\n"]}
@@ -0,0 +1,3 @@
1
+ /// <reference types="../types/global" />
2
+ export declare const isDefined: <T>(a: T | null | undefined) => a is T;
3
+ export declare const removeUndefineds: <T>(a: Optional<T>[]) => T[];
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.removeUndefineds = exports.isDefined = void 0;
4
+ const isDefined = (a) => {
5
+ return typeof a !== 'undefined' && a !== null;
6
+ };
7
+ exports.isDefined = isDefined;
8
+ const removeUndefineds = (a) => {
9
+ const newArray = [];
10
+ for (const item of a) {
11
+ if ((0, exports.isDefined)(item)) {
12
+ newArray.push(item);
13
+ }
14
+ }
15
+ return newArray;
16
+ };
17
+ exports.removeUndefineds = removeUndefineds;
18
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/utils/util.ts"],"names":[],"mappings":";;;AAAO,MAAM,SAAS,GAAG,CAAI,CAAuB,EAAU,EAAE;IAC9D,OAAO,OAAO,CAAC,KAAK,WAAW,IAAI,CAAC,KAAK,IAAI,CAAC;AAChD,CAAC,CAAC;AAFW,QAAA,SAAS,aAEpB;AAEK,MAAM,gBAAgB,GAAG,CAAI,CAAgB,EAAO,EAAE;IAC3D,MAAM,QAAQ,GAAQ,EAAE,CAAC;IACzB,KAAK,MAAM,IAAI,IAAI,CAAC,EAAE;QACpB,IAAI,IAAA,iBAAS,EAAC,IAAI,CAAC,EAAE;YACnB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACrB;KACF;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AARW,QAAA,gBAAgB,oBAQ3B","sourcesContent":["export const isDefined = <T>(a: T | undefined | null): a is T => {\n return typeof a !== 'undefined' && a !== null;\n};\n\nexport const removeUndefineds = <T>(a: Optional<T>[]): T[] => {\n const newArray: T[] = [];\n for (const item of a) {\n if (isDefined(item)) {\n newArray.push(item);\n }\n }\n return newArray;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@railgun-community/shared-models",
3
- "version": "5.1.5",
3
+ "version": "5.1.8",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -22,10 +22,10 @@
22
22
  "test": "npm run compile-test && mocha 'src/**/__tests__/*.test.ts'"
23
23
  },
24
24
  "peerDependencies": {
25
- "ethers": "^6.4.0"
25
+ "ethers": "^6.5.1"
26
26
  },
27
27
  "devDependencies": {
28
- "ethers": "^6.4.0",
28
+ "ethers": "^6.5.1",
29
29
  "@types/chai": "^4.3.4",
30
30
  "@types/chai-as-promised": "^7.1.5",
31
31
  "@types/mocha": "^10.0.1",