feat: transfer comments property to File CoreProperties like numbering.
This commit is contained in:
@ -1,8 +1,18 @@
|
||||
import { File } from "file";
|
||||
import { Compiler } from "./next-compiler";
|
||||
|
||||
/**
|
||||
* Use blanks to prettify
|
||||
*/
|
||||
export enum PrettityType {
|
||||
NONE = "",
|
||||
WITH_2_BLANKS = " ",
|
||||
WITH_4_BLANKS = " ",
|
||||
WITH_TAB = "\t"
|
||||
}
|
||||
|
||||
export class Packer {
|
||||
public static async toBuffer(file: File, prettify?: boolean | string): Promise<Buffer> {
|
||||
public static async toBuffer(file: File, prettify?: boolean | PrettityType): Promise<Buffer> {
|
||||
const zip = this.compiler.compile(file, prettify);
|
||||
const zipData = await zip.generateAsync({
|
||||
type: "nodebuffer",
|
||||
@ -13,7 +23,7 @@ export class Packer {
|
||||
return zipData;
|
||||
}
|
||||
|
||||
public static async toBase64String(file: File, prettify?: boolean): Promise<string> {
|
||||
public static async toBase64String(file: File, prettify?: boolean | PrettityType): Promise<string> {
|
||||
const zip = this.compiler.compile(file, prettify);
|
||||
const zipData = await zip.generateAsync({
|
||||
type: "base64",
|
||||
@ -24,7 +34,7 @@ export class Packer {
|
||||
return zipData;
|
||||
}
|
||||
|
||||
public static async toBlob(file: File, prettify?: boolean): Promise<Blob> {
|
||||
public static async toBlob(file: File, prettify?: boolean | PrettityType): Promise<Blob> {
|
||||
const zip = this.compiler.compile(file, prettify);
|
||||
const zipData = await zip.generateAsync({
|
||||
type: "blob",
|
||||
|
Reference in New Issue
Block a user