UNPKG

node-djiparsetxt

Version:

command-line application that reads a DJI '.txt' file and outputs a json.

37 lines 1.62 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.ParseRecordsCommand = void 0; var ServiceManager_1 = require("../common/ServiceManager"); var Command_1 = require("./Command"); var ParseRecordsCommand = /** @class */ (function (_super) { __extends(ParseRecordsCommand, _super); function ParseRecordsCommand() { return _super !== null && _super.apply(this, arguments) || this; } ParseRecordsCommand.prototype.exec = function (options) { var serviceMan = this.serviceMan; var fileParsingService = serviceMan.get_service(ServiceManager_1.ServiceTypes.FileParsing); var file = options.file; if (file.buffer === null) { return fileParsingService.createEmptyCache(); } var recordsCache = fileParsingService.parse_records(file.buffer); return recordsCache; }; return ParseRecordsCommand; }(Command_1.Command)); exports.ParseRecordsCommand = ParseRecordsCommand; //# sourceMappingURL=ParseRecordsCommand.js.map