🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@openzim/libzim

Package Overview
Dependencies
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openzim/libzim - npm Package Compare versions

Comparing version
3.3.0
to
3.4.0
+8
-0
dist/index.d.ts

@@ -185,2 +185,10 @@ export class IntegrityCheck {

get hasNewNamespaceScheme(): boolean;
getClusterCacheMaxSize(): number;
getClusterCacheCurrentSize(): number;
setClusterCacheMaxSize(nbClusters: number): void;
getDirentCacheMaxSize(): number;
getDirentCacheCurrentSize(): number;
setDirentCacheMaxSize(nbDirents: number): void;
getDirentLookupCacheMaxSize(): number;
setDirentLookupCacheMaxSize(nbRanges: number): void;

@@ -187,0 +195,0 @@ static validate(zimPath: string, checksToRun: symbol[]): boolean; // list of IntegrityCheck

+1
-1

@@ -5,3 +5,3 @@ {

"types": "dist/index.d.js",
"version": "3.3.0",
"version": "3.4.0",
"description": "Libzim bindings for NodeJS",

@@ -8,0 +8,0 @@ "type": "module",

@@ -414,2 +414,81 @@ #pragma once

Napi::Value getClusterCacheMaxSize(const Napi::CallbackInfo &info) {
try {
return Napi::Value::From(info.Env(), archive_->getClusterCacheMaxSize());
} catch (const std::exception &err) {
throw Napi::Error::New(info.Env(), err.what());
}
}
Napi::Value getClusterCacheCurrentSize(const Napi::CallbackInfo &info) {
try {
return Napi::Value::From(info.Env(),
archive_->getClusterCacheCurrentSize());
} catch (const std::exception &err) {
throw Napi::Error::New(info.Env(), err.what());
}
}
void setClusterCacheMaxSize(const Napi::CallbackInfo &info) {
try {
if (!info[0].IsNumber()) {
throw Napi::Error::New(info.Env(), "Expected a number");
}
auto nbClusters = info[0].As<Napi::Number>().Uint32Value();
archive_->setClusterCacheMaxSize(nbClusters);
} catch (const std::exception &err) {
throw Napi::Error::New(info.Env(), err.what());
}
}
Napi::Value getDirentCacheMaxSize(const Napi::CallbackInfo &info) {
try {
return Napi::Value::From(info.Env(), archive_->getDirentCacheMaxSize());
} catch (const std::exception &err) {
throw Napi::Error::New(info.Env(), err.what());
}
}
Napi::Value getDirentCacheCurrentSize(const Napi::CallbackInfo &info) {
try {
return Napi::Value::From(info.Env(),
archive_->getDirentCacheCurrentSize());
} catch (const std::exception &err) {
throw Napi::Error::New(info.Env(), err.what());
}
}
void setDirentCacheMaxSize(const Napi::CallbackInfo &info) {
try {
if (!info[0].IsNumber()) {
throw Napi::Error::New(info.Env(), "Expected a number");
}
auto nbDirents = info[0].As<Napi::Number>().Uint32Value();
archive_->setDirentCacheMaxSize(nbDirents);
} catch (const std::exception &err) {
throw Napi::Error::New(info.Env(), err.what());
}
}
Napi::Value getDirentLookupCacheMaxSize(const Napi::CallbackInfo &info) {
try {
return Napi::Value::From(info.Env(),
archive_->getDirentLookupCacheMaxSize());
} catch (const std::exception &err) {
throw Napi::Error::New(info.Env(), err.what());
}
}
void setDirentLookupCacheMaxSize(const Napi::CallbackInfo &info) {
try {
if (!info[0].IsNumber()) {
throw Napi::Error::New(info.Env(), "Expected a number");
}
auto nbRanges = info[0].As<Napi::Number>().Uint32Value();
archive_->setDirentLookupCacheMaxSize(nbRanges);
} catch (const std::exception &err) {
throw Napi::Error::New(info.Env(), err.what());
}
}
static Napi::Value validate(const Napi::CallbackInfo &info) {

@@ -489,2 +568,18 @@ Napi::Env env = info.Env();

InstanceMethod<&Archive::checkIntegrity>("checkIntegrity"),
InstanceMethod<&Archive::getClusterCacheMaxSize>(
"getClusterCacheMaxSize"),
InstanceMethod<&Archive::getClusterCacheCurrentSize>(
"getClusterCacheCurrentSize"),
InstanceMethod<&Archive::setClusterCacheMaxSize>(
"setClusterCacheMaxSize"),
InstanceMethod<&Archive::getDirentCacheMaxSize>(
"getDirentCacheMaxSize"),
InstanceMethod<&Archive::getDirentCacheCurrentSize>(
"getDirentCacheCurrentSize"),
InstanceMethod<&Archive::setDirentCacheMaxSize>(
"setDirentCacheMaxSize"),
InstanceMethod<&Archive::getDirentLookupCacheMaxSize>(
"getDirentLookupCacheMaxSize"),
InstanceMethod<&Archive::setDirentLookupCacheMaxSize>(
"setDirentLookupCacheMaxSize"),
InstanceAccessor<&Archive::isMultiPart>("isMultiPart"),

@@ -491,0 +586,0 @@ InstanceAccessor<&Archive::hasNewNamespaceScheme>(

@@ -185,2 +185,10 @@ export class IntegrityCheck {

get hasNewNamespaceScheme(): boolean;
getClusterCacheMaxSize(): number;
getClusterCacheCurrentSize(): number;
setClusterCacheMaxSize(nbClusters: number): void;
getDirentCacheMaxSize(): number;
getDirentCacheCurrentSize(): number;
setDirentCacheMaxSize(nbDirents: number): void;
getDirentLookupCacheMaxSize(): number;
setDirentLookupCacheMaxSize(nbRanges: number): void;

@@ -187,0 +195,0 @@ static validate(zimPath: string, checksToRun: symbol[]): boolean; // list of IntegrityCheck

Sorry, the diff of this file is not supported yet