Socket
Socket
Sign inDemoInstall

@themezernx/sarclib

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

LICENSE

10

dist/SarcFile.d.ts

@@ -65,3 +65,3 @@ /// <reference types="node" />

* @param value the new default alignment
* @throws Error if alignment is not non-zero and a power of 2
* @throws Error if alignment is not non-zero or not a power of 2
*/

@@ -86,3 +86,3 @@ setDefaultAlignment(value: number): void;

*/
setLittleEndian(isLittleEndian: boolean): void;
setLittleEndian(isLittleEndian: true | false): void;
private readUInt16;

@@ -105,7 +105,7 @@ private readUInt32;

* @param filePath the sarc file path.
* @throws Error if the SARC archive is invalid or unsupported
* @throws Error if the SARC archive is invalid, unsupported, or not found
*/
loadFrom(filePath: string): void;
/**
* Save current SARC archive to file.
* Save current SARC archive to a `Buffer`.
*

@@ -119,3 +119,3 @@ * @param compression what Yaz0 compression level to use. `0`: no compression (fastest), `9`: best compression (slowest)

*
* @param filePath the save destination. Will use default file extensions: `.szs` (compressed) or `.sarc` (uncompressed)
* @param filePath the save destination. Will use `.szs` (compressed) or `.sarc` (uncompressed) if no file extension was provided.
* @param compression what Yaz0 compression level to use. `0`: no compression (fastest), `9`: best compression (slowest)

@@ -122,0 +122,0 @@ * @returns {string} full output file path

@@ -237,3 +237,3 @@ "use strict";

* @param value the new default alignment
* @throws Error if alignment is not non-zero and a power of 2
* @throws Error if alignment is not non-zero or not a power of 2
*/

@@ -376,3 +376,3 @@ SarcFile.prototype.setDefaultAlignment = function (value) {

* @param filePath the sarc file path.
* @throws Error if the SARC archive is invalid or unsupported
* @throws Error if the SARC archive is invalid, unsupported, or not found
*/

@@ -383,3 +383,3 @@ SarcFile.prototype.loadFrom = function (filePath) {

/**
* Save current SARC archive to file.
* Save current SARC archive to a `Buffer`.
*

@@ -443,3 +443,3 @@ * @param compression what Yaz0 compression level to use. `0`: no compression (fastest), `9`: best compression (slowest)

*
* @param filePath the save destination. Will use default file extensions: `.szs` (compressed) or `.sarc` (uncompressed)
* @param filePath the save destination. Will use `.szs` (compressed) or `.sarc` (uncompressed) if no file extension was provided.
* @param compression what Yaz0 compression level to use. `0`: no compression (fastest), `9`: best compression (slowest)

@@ -450,3 +450,3 @@ * @returns {string} full output file path

if (compression === void 0) { compression = 0; }
var finalPath = path.resolve(filePath + (compression != 0 ? ".szs" : ".sarc"));
var finalPath = path.resolve(filePath + (!/\.[^\/.]+$/.test(filePath) ? (compression != 0 ? ".szs" : ".sarc") : ""));
fs.writeFileSync(finalPath, this.save(compression));

@@ -453,0 +453,0 @@ return finalPath;

{
"name": "@themezernx/sarclib",
"version": "1.0.1",
"version": "1.0.2",
"description": "A library for packing and unpacking SARC/SZS archives.",

@@ -5,0 +5,0 @@ "repository": "https://github.com/ThemezerNX/SarcLib.git",

@@ -6,10 +6,6 @@ const path = require("path");

sarcBig.addFolderContentsFromPath(path.resolve("Psl-8.0.0")).then(()=> {
sarcBig.saveTo(path.join(__dirname, "Psl-8.0.0.decompressed.szs"));
const readSarc = new SarcFile();
readSarc.loadFrom(path.join(__dirname, "Psl-8.0.0.decompressed.szs"))
readSarc.extractTo(path.join(__dirname, "Psl-8.0.0.decompressed"))
sarcBig.addFolderContentsFromPath(path.resolve("test/testtheme")).then(()=> {
sarcBig.saveTo(path.join(__dirname, "testtheme-9compressed"), 0);
})
console.log("Done!");
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc