This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Zaimki/src/buildTemplate.js

13 lines
387 B
JavaScript
Raw Normal View History

2020-07-22 13:19:23 -07:00
import {Template} from "./classes";
import Compressor from "./compressor";
import {templates} from "./data";
export default (path) => {
const templateStr = path.split(',');
const base = templates[templateStr[0]]
return templateStr.length === 1
? templates[templateStr[0]]
: Template.from(Compressor.uncompress(templateStr, base ? base.toArray() : null));
}