Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@actions/io

Package Overview
Dependencies
Maintainers
7
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@actions/io - npm Package Compare versions

Comparing version
2.0.0
to
3.0.0
+22
-67
lib/io-util.js

@@ -1,35 +0,1 @@

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -44,18 +10,7 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

};
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0;
exports.readlink = readlink;
exports.exists = exists;
exports.isDirectory = isDirectory;
exports.isRooted = isRooted;
exports.tryGetExecutablePath = tryGetExecutablePath;
exports.getCmdPath = getCmdPath;
const fs = __importStar(require("fs"));
const path = __importStar(require("path"));
_a = fs.promises
import * as fs from 'fs';
import * as path from 'path';
export const { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs.promises;
// export const {open} = 'fs'
, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
// export const {open} = 'fs'
exports.IS_WINDOWS = process.platform === 'win32';
export const IS_WINDOWS = process.platform === 'win32';
/**

@@ -72,3 +27,3 @@ * Custom implementation of readlink to ensure Windows junctions

*/
function readlink(fsPath) {
export function readlink(fsPath) {
return __awaiter(this, void 0, void 0, function* () {

@@ -78,3 +33,3 @@ const result = yield fs.promises.readlink(fsPath);

// since junctions on Windows are always directory links
if (exports.IS_WINDOWS && !result.endsWith('\\')) {
if (IS_WINDOWS && !result.endsWith('\\')) {
return `${result}\\`;

@@ -86,8 +41,8 @@ }

// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
exports.UV_FS_O_EXLOCK = 0x10000000;
exports.READONLY = fs.constants.O_RDONLY;
function exists(fsPath) {
export const UV_FS_O_EXLOCK = 0x10000000;
export const READONLY = fs.constants.O_RDONLY;
export function exists(fsPath) {
return __awaiter(this, void 0, void 0, function* () {
try {
yield (0, exports.stat)(fsPath);
yield stat(fsPath);
}

@@ -103,5 +58,5 @@ catch (err) {

}
function isDirectory(fsPath_1) {
export function isDirectory(fsPath_1) {
return __awaiter(this, arguments, void 0, function* (fsPath, useStat = false) {
const stats = useStat ? yield (0, exports.stat)(fsPath) : yield (0, exports.lstat)(fsPath);
const stats = useStat ? yield stat(fsPath) : yield lstat(fsPath);
return stats.isDirectory();

@@ -114,3 +69,3 @@ });

*/
function isRooted(p) {
export function isRooted(p) {
p = normalizeSeparators(p);

@@ -120,3 +75,3 @@ if (!p) {

}
if (exports.IS_WINDOWS) {
if (IS_WINDOWS) {
return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello

@@ -133,3 +88,3 @@ ); // e.g. C: or C:\hello

*/
function tryGetExecutablePath(filePath, extensions) {
export function tryGetExecutablePath(filePath, extensions) {
return __awaiter(this, void 0, void 0, function* () {

@@ -139,3 +94,3 @@ let stats = undefined;

// test file exists
stats = yield (0, exports.stat)(filePath);
stats = yield stat(filePath);
}

@@ -149,3 +104,3 @@ catch (err) {

if (stats && stats.isFile()) {
if (exports.IS_WINDOWS) {
if (IS_WINDOWS) {
// on Windows, test for valid extension

@@ -169,3 +124,3 @@ const upperExt = path.extname(filePath).toUpperCase();

try {
stats = yield (0, exports.stat)(filePath);
stats = yield stat(filePath);
}

@@ -179,3 +134,3 @@ catch (err) {

if (stats && stats.isFile()) {
if (exports.IS_WINDOWS) {
if (IS_WINDOWS) {
// preserve the case of the actual file (since an extension was appended)

@@ -185,3 +140,3 @@ try {

const upperName = path.basename(filePath).toUpperCase();
for (const actualName of yield (0, exports.readdir)(directory)) {
for (const actualName of yield readdir(directory)) {
if (upperName === actualName.toUpperCase()) {

@@ -211,3 +166,3 @@ filePath = path.join(directory, actualName);

p = p || '';
if (exports.IS_WINDOWS) {
if (IS_WINDOWS) {
// convert slashes on Windows

@@ -234,3 +189,3 @@ p = p.replace(/\//g, '\\');

// Get the path of cmd.exe in windows
function getCmdPath() {
export function getCmdPath() {
var _a;

@@ -237,0 +192,0 @@ return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;

+10
-51

@@ -1,35 +0,1 @@

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -44,12 +10,5 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

};
Object.defineProperty(exports, "__esModule", { value: true });
exports.cp = cp;
exports.mv = mv;
exports.rmRF = rmRF;
exports.mkdirP = mkdirP;
exports.which = which;
exports.findInPath = findInPath;
const assert_1 = require("assert");
const path = __importStar(require("path"));
const ioUtil = __importStar(require("./io-util"));
import { ok } from 'assert';
import * as path from 'path';
import * as ioUtil from './io-util.js';
/**

@@ -63,3 +22,3 @@ * Copies a file or folder.

*/
function cp(source_1, dest_1) {
export function cp(source_1, dest_1) {
return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) {

@@ -104,3 +63,3 @@ const { force, recursive, copySourceDirectory } = readCopyOptions(options);

*/
function mv(source_1, dest_1) {
export function mv(source_1, dest_1) {
return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) {

@@ -132,3 +91,3 @@ if (yield ioUtil.exists(dest)) {

*/
function rmRF(inputPath) {
export function rmRF(inputPath) {
return __awaiter(this, void 0, void 0, function* () {

@@ -163,5 +122,5 @@ if (ioUtil.IS_WINDOWS) {

*/
function mkdirP(fsPath) {
export function mkdirP(fsPath) {
return __awaiter(this, void 0, void 0, function* () {
(0, assert_1.ok)(fsPath, 'a path argument must be provided');
ok(fsPath, 'a path argument must be provided');
yield ioUtil.mkdir(fsPath, { recursive: true });

@@ -178,3 +137,3 @@ });

*/
function which(tool, check) {
export function which(tool, check) {
return __awaiter(this, void 0, void 0, function* () {

@@ -209,3 +168,3 @@ if (!tool) {

*/
function findInPath(tool) {
export function findInPath(tool) {
return __awaiter(this, void 0, void 0, function* () {

@@ -212,0 +171,0 @@ if (!tool) {

{
"name": "@actions/io",
"version": "2.0.0",
"version": "3.0.0",
"description": "Actions io lib",

@@ -12,4 +12,11 @@ "keywords": [

"license": "MIT",
"type": "module",
"main": "lib/io.js",
"types": "lib/io.d.ts",
"exports": {
".": {
"types": "./lib/io.d.ts",
"import": "./lib/io.js"
}
},
"directories": {

@@ -16,0 +23,0 @@ "lib": "lib",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet