@mixvideo/jianying
Version:
剪映草稿文件工具包 - 解析、分析和生成剪映项目文件
37 lines (32 loc) • 904 B
JavaScript
;
var fs = require('fs');
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n.default = e;
return Object.freeze(n);
}
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
// src/index.ts
function parse(filePath) {
if (!fs__namespace.existsSync(filePath)) {
throw new Error(`\u6587\u4EF6\u4E0D\u5B58\u5728: ${filePath}`);
}
const content = fs__namespace.readFileSync(filePath, "utf-8");
const draft = JSON.parse(content);
return draft;
}
exports.parse = parse;
//# sourceMappingURL=index.js.map
//# sourceMappingURL=index.js.map