@yarnpkg/libzip
Advanced tools
Comparing version 3.0.1 to 3.1.0
@@ -1,2 +0,1 @@ | ||
/// <reference types="emscripten" /> | ||
export * from './common'; | ||
@@ -3,0 +2,0 @@ export declare function getLibzipSync(): { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getLibzipPromise = exports.getLibzipSync = void 0; | ||
exports.getLibzipSync = getLibzipSync; | ||
exports.getLibzipPromise = getLibzipPromise; | ||
const tslib_1 = require("tslib"); | ||
@@ -15,3 +16,2 @@ const instance_1 = require("./instance"); | ||
} | ||
exports.getLibzipSync = getLibzipSync; | ||
async function getLibzipPromise() { | ||
@@ -31,2 +31,1 @@ const instance = (0, instance_1.tryInstance)(); | ||
} | ||
exports.getLibzipPromise = getLibzipPromise; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="emscripten" /> | ||
import { Libzip } from './makeInterface'; | ||
@@ -3,0 +2,0 @@ export declare let cachedInstance: Libzip | undefined; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.tryInstance = exports.getInstance = exports.setFactory = exports.cachedInstance = void 0; | ||
exports.cachedInstance = void 0; | ||
exports.setFactory = setFactory; | ||
exports.getInstance = getInstance; | ||
exports.tryInstance = tryInstance; | ||
let registeredFactory = () => { | ||
@@ -10,3 +13,2 @@ throw new Error(`Assertion failed: No libzip instance is available, and no factory was configured`); | ||
} | ||
exports.setFactory = setFactory; | ||
function getInstance() { | ||
@@ -17,6 +19,4 @@ if (typeof exports.cachedInstance === `undefined`) | ||
} | ||
exports.getInstance = getInstance; | ||
function tryInstance() { | ||
return exports.cachedInstance; | ||
} | ||
exports.tryInstance = tryInstance; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="emscripten" /> | ||
import type { LibzipEmscriptenModule } from './emscripten'; | ||
@@ -3,0 +2,0 @@ export type Libzip = ReturnType<typeof makeInterface>; |
@@ -1,3 +0,1 @@ | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import { PortablePath } from '@yarnpkg/fslib'; | ||
@@ -4,0 +2,0 @@ import fs from 'fs'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.mountMemoryDrive = void 0; | ||
exports.mountMemoryDrive = mountMemoryDrive; | ||
const tslib_1 = require("tslib"); | ||
@@ -37,2 +37,1 @@ const fslib_1 = require("@yarnpkg/fslib"); | ||
} | ||
exports.mountMemoryDrive = mountMemoryDrive; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="emscripten" /> | ||
export * from './common'; | ||
@@ -3,0 +2,0 @@ export declare function getLibzipSync(): { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getLibzipPromise = exports.getLibzipSync = void 0; | ||
exports.getLibzipSync = getLibzipSync; | ||
exports.getLibzipPromise = getLibzipPromise; | ||
const tslib_1 = require("tslib"); | ||
@@ -16,6 +17,4 @@ const instance_1 = require("./instance"); | ||
} | ||
exports.getLibzipSync = getLibzipSync; | ||
async function getLibzipPromise() { | ||
return (0, instance_1.getInstance)(); | ||
} | ||
exports.getLibzipPromise = getLibzipPromise; |
@@ -1,7 +0,4 @@ | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import { Dirent, DirentNoPath } from '@yarnpkg/fslib'; | ||
import { WatchOptions, WatchCallback, Watcher, Dir, Stats, BigIntStats, StatSyncOptions, StatOptions } from '@yarnpkg/fslib'; | ||
import { FakeFS, MkdirOptions, RmdirOptions, WriteFileOptions, OpendirOptions } from '@yarnpkg/fslib'; | ||
import { FakeFS, MkdirOptions, RmdirOptions, RmOptions, WriteFileOptions, OpendirOptions } from '@yarnpkg/fslib'; | ||
import { CreateReadStreamOptions, CreateWriteStreamOptions, BasePortableFakeFS, ExtractHintOptions, WatchFileCallback, WatchFileOptions, StatWatcher } from '@yarnpkg/fslib'; | ||
@@ -198,2 +195,4 @@ import { FSPath, PortablePath, Filename } from '@yarnpkg/fslib'; | ||
rmdirSync(p: PortablePath, { recursive }?: RmdirOptions): void; | ||
rmPromise(p: PortablePath, opts?: RmOptions): Promise<void>; | ||
rmSync(p: PortablePath, { recursive }?: RmOptions): void; | ||
private hydrateDirectory; | ||
@@ -200,0 +199,0 @@ linkPromise(existingP: PortablePath, newP: PortablePath): Promise<void>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ZipFS = exports.LibzipError = exports.makeEmptyArchive = exports.DEFAULT_COMPRESSION_LEVEL = void 0; | ||
exports.ZipFS = exports.LibzipError = exports.DEFAULT_COMPRESSION_LEVEL = void 0; | ||
exports.makeEmptyArchive = makeEmptyArchive; | ||
const tslib_1 = require("tslib"); | ||
@@ -43,3 +44,2 @@ const fslib_1 = require("@yarnpkg/fslib"); | ||
} | ||
exports.makeEmptyArchive = makeEmptyArchive; | ||
class LibzipError extends Error { | ||
@@ -1004,2 +1004,23 @@ constructor(message, code) { | ||
} | ||
async rmPromise(p, opts) { | ||
return this.rmSync(p, opts); | ||
} | ||
rmSync(p, { recursive = false } = {}) { | ||
if (this.readOnly) | ||
throw fslib_5.errors.EROFS(`rm '${p}'`); | ||
if (recursive) { | ||
this.removeSync(p); | ||
return; | ||
} | ||
const resolvedP = this.resolveFilename(`rm '${p}'`, p); | ||
const directoryListing = this.listings.get(resolvedP); | ||
if (!directoryListing) | ||
throw fslib_5.errors.ENOTDIR(`rm '${p}'`); | ||
if (directoryListing.size > 0) | ||
throw fslib_5.errors.ENOTEMPTY(`rm '${p}'`); | ||
const index = this.entries.get(resolvedP); | ||
if (typeof index === `undefined`) | ||
throw fslib_5.errors.EINVAL(`rm '${p}'`); | ||
this.deleteEntry(p, index); | ||
} | ||
hydrateDirectory(resolvedP) { | ||
@@ -1006,0 +1027,0 @@ const index = this.libzip.dir.add(this.zip, fslib_6.ppath.relative(fslib_6.PortablePath.root, resolvedP)); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ZipOpenFS = exports.getArchivePart = void 0; | ||
exports.ZipOpenFS = void 0; | ||
exports.getArchivePart = getArchivePart; | ||
const fslib_1 = require("@yarnpkg/fslib"); | ||
@@ -31,3 +32,2 @@ const fslib_2 = require("@yarnpkg/fslib"); | ||
} | ||
exports.getArchivePart = getArchivePart; | ||
class ZipOpenFS extends fslib_1.MountFS { | ||
@@ -34,0 +34,0 @@ static async openPromise(fn, opts) { |
{ | ||
"name": "@yarnpkg/libzip", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"license": "BSD-2-Clause", | ||
@@ -45,7 +45,7 @@ "main": "./lib/sync.js", | ||
"@types/emscripten": "^1.39.6", | ||
"@yarnpkg/fslib": "^3.0.2", | ||
"@yarnpkg/fslib": "^3.1.0", | ||
"tslib": "^2.4.0" | ||
}, | ||
"peerDependencies": { | ||
"@yarnpkg/fslib": "^3.0.2" | ||
"@yarnpkg/fslib": "^3.1.0" | ||
}, | ||
@@ -52,0 +52,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
513962
5671
Updated@yarnpkg/fslib@^3.1.0