@transcend-io/cli 4.97.1 → 4.97.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.
@@ -0,0 +1,9 @@
1
+ import { ObjByString } from '@transcend-io/type-utils';
2
+ /**
3
+ * Given an object, remove all keys that are null-ish
4
+ *
5
+ * @param obj - Object
6
+ * @returns Object with null-ish values removed
7
+ */
8
+ export declare function filterNullishValuesFromObject<T extends ObjByString>(obj: T): T;
9
+ //# sourceMappingURL=filterNullishValuesFromObject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filterNullishValuesFromObject.d.ts","sourceRoot":"","sources":["../../src/ai/filterNullishValuesFromObject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,SAAS,WAAW,EACjE,GAAG,EAAE,CAAC,GACL,CAAC,CAYH"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.filterNullishValuesFromObject = void 0;
4
+ /**
5
+ * Given an object, remove all keys that are null-ish
6
+ *
7
+ * @param obj - Object
8
+ * @returns Object with null-ish values removed
9
+ */
10
+ function filterNullishValuesFromObject(obj) {
11
+ return Object.entries(obj).reduce((acc, [k, v]) => v !== null &&
12
+ v !== undefined &&
13
+ v !== '' &&
14
+ !(Array.isArray(v) && v.length === 0) &&
15
+ !(typeof v === 'object' && Object.keys(v).length === 0)
16
+ ? Object.assign(acc, { [k]: v })
17
+ : acc, {});
18
+ }
19
+ exports.filterNullishValuesFromObject = filterNullishValuesFromObject;
20
+ //# sourceMappingURL=filterNullishValuesFromObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filterNullishValuesFromObject.js","sourceRoot":"","sources":["../../src/ai/filterNullishValuesFromObject.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACH,SAAgB,6BAA6B,CAC3C,GAAM;IAEN,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAC/B,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CACd,CAAC,KAAK,IAAI;QACV,CAAC,KAAK,SAAS;QACf,CAAC,KAAK,EAAE;QACR,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;QACrC,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;QACrD,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAChC,CAAC,CAAC,GAAG,EACT,EAAO,CACR,CAAC;AACJ,CAAC;AAdD,sEAcC"}
@@ -1,4 +1,6 @@
1
+ export declare const json2Csv: any;
1
2
  export * from './TranscendAiPrompt';
2
3
  export * from './createHandlebarsWithHelpers';
3
4
  export * from './removeLinks';
5
+ export * from './filterNullishValuesFromObject';
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,KAAQ,CAAC;AAE9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,iCAAiC,CAAC"}
package/build/ai/index.js CHANGED
@@ -14,7 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.json2Csv = void 0;
18
+ const { parse } = require('json2csv');
19
+ exports.json2Csv = parse;
17
20
  __exportStar(require("./TranscendAiPrompt"), exports);
18
21
  __exportStar(require("./createHandlebarsWithHelpers"), exports);
19
22
  __exportStar(require("./removeLinks"), exports);
23
+ __exportStar(require("./filterNullishValuesFromObject"), exports);
20
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,gEAA8C;AAC9C,gDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEzB,QAAA,QAAQ,GAAG,KAAK,CAAC;AAE9B,sDAAoC;AACpC,gEAA8C;AAC9C,gDAA8B;AAC9B,kEAAgD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=filterNullValuesFromObject.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filterNullValuesFromObject.test.d.ts","sourceRoot":"","sources":["../../src/tests/filterNullValuesFromObject.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const chai_1 = require("chai");
4
+ const filterNullishValuesFromObject_1 = require("../ai/filterNullishValuesFromObject");
5
+ const TEST_DATA = {
6
+ test: 'data',
7
+ name: true,
8
+ cow: false,
9
+ key: null,
10
+ moose: null,
11
+ str: '',
12
+ cat: [],
13
+ mew: { dog: 2 },
14
+ woof: {},
15
+ };
16
+ describe('filterNullishValuesFromObject', () => {
17
+ it('should remove links', () => {
18
+ (0, chai_1.expect)((0, filterNullishValuesFromObject_1.filterNullishValuesFromObject)(TEST_DATA)).to.deep.equal({
19
+ test: 'data',
20
+ name: true,
21
+ cow: false,
22
+ mew: { dog: 2 },
23
+ });
24
+ });
25
+ });
26
+ //# sourceMappingURL=filterNullValuesFromObject.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filterNullValuesFromObject.test.js","sourceRoot":"","sources":["../../src/tests/filterNullValuesFromObject.test.ts"],"names":[],"mappings":";;AAAA,+BAA8B;AAE9B,uFAAoF;AAEpF,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,IAAI;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,IAAI;IACT,KAAK,EAAE,IAAI;IACX,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE;IACf,IAAI,EAAE,EAAE;CACT,CAAC;AAEF,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE;QAC7B,IAAA,aAAM,EAAC,IAAA,6DAA6B,EAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;YAC7D,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,IAAI;YACV,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE;SAChB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}