Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

xutil

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xutil - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

34

lib/file.js

@@ -18,2 +18,5 @@ /* ================================================================

//static
var EMPTY = '';
function _touch(){

@@ -31,8 +34,37 @@

function _chmod(p, mode){
fs.chmodSync(p, mode);
}
function _readFile(p, encoding) {
return fs.readFileSync(p, encoding);
}
function _writeFile(p, data){
if(p === EMPTY) return false;
fs.writeFileSync(p, data);
}
function _isExistedFile(p){
if(p === EMPTY) return false;
return fs.existsSync(p) && fs.statSync(p).isFile();
}
function _isExistedDir(p){
if(p === EMPTY) return false;
return fs.existsSync(p) && fs.statSync(p).isDirectory();
}
var File = {
touch: _touch,
rm: _rm,
mkdir :_mkdir
mkdir :_mkdir,
chmod: _chmod,
isExistedFile: _isExistedFile,
isExistedDir: _isExistedDir,
readFile: _readFile,
writeFile: _writeFile
};
module.exports = File;

10

lib/string.js

@@ -16,5 +16,2 @@ /* ================================================================

function _trim(){
}
/**

@@ -32,4 +29,8 @@ * escape

function _trim(str){
return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}
var Str = {
trim: _touch,
trim: _trim,
escape: _escape

@@ -39,1 +40,2 @@ };

module.exports = Str;

@@ -31,1 +31,2 @@ /* ================================================================

module.exports = Type;

@@ -101,2 +101,14 @@ /* ================================================================

/**
* remove
*/
function _remove(arr, n) {
if(n<0){
return arr;
}
arr = arr.slice(0,n).concat(arr.slice(n+1,arr.length));
return arr;
}
/**
* indexOf

@@ -142,2 +154,3 @@ */

slice: _slice,
remove: _remove,
indexOf: _indexOf,

@@ -163,1 +176,2 @@ decode: _decode,

{
"name": "xutil",
"version": "0.0.4",
"version": "0.0.5",
"description": "xutil",

@@ -5,0 +5,0 @@ "bin": {

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc