ag-common 0.0.710 → 0.0.711

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 +1,3 @@
1
- export declare function loadCsvAsJson<T extends Record<string | number, any>>(filePath: string): T[];
1
+ export declare function loadCsvAsJson<T extends Record<string | number, any>>(p: {
2
+ fileData: string;
3
+ }): T[];
@@ -1,15 +1,10 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.loadCsvAsJson = void 0;
7
- const fs_1 = __importDefault(require("fs"));
8
4
  const math_1 = require("./math");
9
5
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
- function loadCsvAsJson(filePath) {
11
- const fileData = fs_1.default.readFileSync(filePath, 'utf8');
12
- const lines = fileData.split(/[\r]?\n/);
6
+ function loadCsvAsJson(p) {
7
+ const lines = p.fileData.split(/[\r]?\n/);
13
8
  let sep = ',';
14
9
  if (lines[0].split(',').length === 1 && lines[0].split(';').length > 1) {
15
10
  sep = ';';
@@ -4,8 +4,6 @@ export * from './binary';
4
4
  export * from './csv';
5
5
  export * from './date';
6
6
  export * from './email';
7
- export * from './fetch';
8
- export * from './fs';
9
7
  export * from './func';
10
8
  export * from './generator';
11
9
  export * from './groupBy';
@@ -20,8 +20,6 @@ __exportStar(require("./binary"), exports);
20
20
  __exportStar(require("./csv"), exports);
21
21
  __exportStar(require("./date"), exports);
22
22
  __exportStar(require("./email"), exports);
23
- __exportStar(require("./fetch"), exports);
24
- __exportStar(require("./fs"), exports);
25
23
  __exportStar(require("./func"), exports);
26
24
  __exportStar(require("./generator"), exports);
27
25
  __exportStar(require("./groupBy"), exports);
@@ -1,4 +1,6 @@
1
- export declare const convertXmlToJson: (xmlFilePath: string) => Promise<any>;
1
+ export declare const convertXmlToJson: (p: {
2
+ xmlData: string;
3
+ }) => Promise<any>;
2
4
  export declare class XMLParser {
3
5
  private stack;
4
6
  private currentObject;
@@ -1,27 +1,5 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
25
3
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
4
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
5
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -33,12 +11,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
11
  };
34
12
  Object.defineProperty(exports, "__esModule", { value: true });
35
13
  exports.XMLParser = exports.convertXmlToJson = void 0;
36
- /* eslint-disable @typescript-eslint/no-explicit-any */
37
- const fs = __importStar(require("fs"));
38
- const convertXmlToJson = (xmlFilePath) => __awaiter(void 0, void 0, void 0, function* () {
39
- const xmlData = yield fs.readFileSync(xmlFilePath, 'utf8');
14
+ const convertXmlToJson = (p) => __awaiter(void 0, void 0, void 0, function* () {
40
15
  const parser = new XMLParser();
41
- const ret = parser.parse(xmlData);
16
+ const ret = parser.parse(p.xmlData);
42
17
  return ret;
43
18
  });
44
19
  exports.convertXmlToJson = convertXmlToJson;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './api';
2
2
  export * from './common';
3
+ export * from './node';
3
4
  export * from './ui';
package/dist/index.js CHANGED
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./api"), exports);
18
18
  __exportStar(require("./common"), exports);
19
+ __exportStar(require("./node"), exports);
19
20
  __exportStar(require("./ui"), exports);
@@ -0,0 +1,2 @@
1
+ export * from './fetch';
2
+ export * from './fs';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./fetch"), exports);
18
+ __exportStar(require("./fs"), exports);
@@ -0,0 +1 @@
1
+ export * from './helpers';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./helpers"), exports);
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.710",
2
+ "version": "0.0.711",
3
3
  "name": "ag-common",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
File without changes
File without changes
File without changes
File without changes