@speleotica/frcsdata 4.2.0 → 4.3.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.
package/string/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export declare const parseFrcsSurveyFile: (file: string, str: string) => Promise<import("..").FrcsSurveyFile>;
1
+ export declare const parseFrcsSurveyFile: (file: string, str: string, rest_0?: import("../parseFrcsSurveyFile").ParseFrcsSurveyFileOptions | undefined) => Promise<import("..").FrcsSurveyFile>;
2
2
  export declare const parseFrcsPlotFile: (file: string, str: string) => Promise<import("..").FrcsPlotFile>;
3
3
  export declare const parseFrcsTripSummaryFile: (file: string, str: string) => Promise<import("..").FrcsTripSummaryFile>;
package/string/index.js CHANGED
@@ -33,7 +33,10 @@ function _linesOf() {
33
33
  }
34
34
  var convert = function convert(fn) {
35
35
  return function (file, str) {
36
- return fn(file, linesOf(str));
36
+ for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
37
+ rest[_key - 2] = arguments[_key];
38
+ }
39
+ return fn.apply(void 0, [file, linesOf(str)].concat(rest));
37
40
  };
38
41
  };
39
42
  var parseFrcsSurveyFile = exports.parseFrcsSurveyFile = convert(_parseFrcsSurveyFile2["default"]);
package/web/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export declare const parseFrcsSurveyFile: {
2
- (file: File): Promise<import("..").FrcsSurveyFile>;
3
- (file: string, input: Blob | ReadableStream<Uint8Array>): Promise<import("..").FrcsSurveyFile>;
4
- };
1
+ import { ParseFrcsSurveyFileOptions } from '../parseFrcsSurveyFile';
2
+ import { FrcsSurveyFile } from '../FrcsSurveyFile';
3
+ export declare function parseFrcsSurveyFile(file: File, options?: ParseFrcsSurveyFileOptions): Promise<FrcsSurveyFile>;
4
+ export declare function parseFrcsSurveyFile(file: string, input: Blob | ReadableStream<Uint8Array>, options?: ParseFrcsSurveyFileOptions): Promise<FrcsSurveyFile>;
5
5
  export declare const parseFrcsPlotFile: {
6
6
  (file: File): Promise<import("..").FrcsPlotFile>;
7
7
  (file: string, input: Blob | ReadableStream<Uint8Array>): Promise<import("..").FrcsPlotFile>;
package/web/index.js CHANGED
@@ -4,7 +4,9 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.parseFrcsTripSummaryFile = exports.parseFrcsSurveyFile = exports.parseFrcsPlotFile = void 0;
7
+ exports.parseFrcsPlotFile = void 0;
8
+ exports.parseFrcsSurveyFile = parseFrcsSurveyFile;
9
+ exports.parseFrcsTripSummaryFile = void 0;
8
10
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
11
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
12
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
@@ -137,6 +139,12 @@ var convert = function convert(fn) {
137
139
  }
138
140
  return converted;
139
141
  };
140
- var parseFrcsSurveyFile = exports.parseFrcsSurveyFile = convert(_parseFrcsSurveyFile2["default"]);
142
+ function parseFrcsSurveyFile(file, input, options) {
143
+ if (file instanceof File) return (0, _parseFrcsSurveyFile2["default"])(file.name, linesOf(file), options);
144
+ if (input instanceof Blob || input instanceof ReadableStream) {
145
+ return (0, _parseFrcsSurveyFile2["default"])(file, linesOf(input), options);
146
+ }
147
+ throw new Error("input ust be a Blob or ReadableStream if file is not a File");
148
+ }
141
149
  var parseFrcsPlotFile = exports.parseFrcsPlotFile = convert(_parseFrcsPlotFile2["default"]);
142
150
  var parseFrcsTripSummaryFile = exports.parseFrcsTripSummaryFile = convert(_parseFrcsTripSummaryFile2["default"]);