@awesomeeng/awesome-utils
Advanced tools
Comparing version 1.4.2 to 1.4.3
{ | ||
"name": "@awesomeeng/awesome-utils", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"author": "the awesome engineering company", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
# AwesomeUtils Release Notes | ||
#### **Version 1.4.3** | ||
- AwesomeUtils.FS: Minor refactor for recursiveRmdirSync not removing sub-directories. | ||
#### **Version 1.4.2** | ||
- AwesomeUtils.ANSI: Fixes minor edge error. | ||
#### **Version 1.4.1** | ||
@@ -18,11 +26,21 @@ | ||
- AwesomeUtils.Workers: Switch worker locks to use threadId instead of processId since workers use the same processId as their parents. | ||
- AwesomeUtils.Workers: Renamed lock methods. no longer require SAB for lock objects. | ||
- AwesomeUtils.Workers: Adds lock/unlock for workers and SharedArrayBuffers. | ||
- AwesomeUtils.Workers: Added. Utilities for working with worker_threads. | ||
- AwesomeUtils.Request: Adds better parsing of contentType and contentEncoding. | ||
- AwesomeUtils.Request: Use lowercase header names, more in line with how node does it. | ||
- AwesomeUtils.Sequence: Added. For generating sequence number. | ||
- AwesomeUtils.Request: Added. HTTP Request utilities. | ||
- AwesomeUtils.Random: Fixed typo in names(). | ||
- AwesomeUtils.Compartor: Added. Utilities for sorting. | ||
- AwesomeUtils.Promise: Adds timeout(). | ||
@@ -33,4 +51,7 @@ | ||
- AwesomeUtils.Object: Adds Object.deepStrictEqual(). | ||
- AwesomeUtils.Promise: Fixes Promise.series() to work as expected. Prior to this the promises would each start when created, and then series() was just waiting on them resolving. Now you pass series an array and a function to execute for each cell in the array. If the function returns a promise, series() waits for that promise to resolve before moving to the next item in the series. This is a change to how series() is structured. | ||
- AwesomeUtils.Random: Adds Random.uuid(). | ||
- AwesomeUtils.Promise: Adds tests for Promise.sleep() and Promise.series(). | ||
@@ -37,0 +58,0 @@ |
@@ -218,3 +218,3 @@ // (c) 2018, The Awesome Engineering Company, https://awesomeneg.com | ||
stylize(style,s="") { | ||
stylize(style="",s="") { | ||
let styles = style.split(/,|\s/g); | ||
@@ -221,0 +221,0 @@ let f = styles.reduce((f,style)=>{ |
@@ -168,3 +168,3 @@ // (c) 2018, The Awesome Engineering Company, https://awesomeneg.com | ||
* @param {string} path | ||
* @return {void} | ||
* @return {void} | ||
*/ | ||
@@ -176,21 +176,28 @@ recursiveRmdirSync(path) { | ||
path = path.replace(/\\\\|\\/g,"/"); | ||
if (path==="/") throw new Error("rmdir on '/' is not allowed."); | ||
let stat = this.statSync(path); | ||
if (!stat) throw new Error("Invalid path, not found: "+path); | ||
let files = this.recursiveListSync(path,null,false); | ||
files = files.reverse(); | ||
if (stat.isDirectory()) { | ||
let files = this.recursiveListSync(path,null,false); | ||
let dir = path; | ||
let dirs = []; | ||
files.forEach((path)=>{ | ||
path = Path.resolve(dir,path); | ||
let stat = this.statSync(path); | ||
if (!stat) return; | ||
files.reverse().forEach((file)=>{ | ||
file = (path.endsWith("/") ? path : path+"/")+file; | ||
let stat = this.statSync(file); | ||
if (stat.isDirectory()) FS.rmdirSync(file); | ||
else FS.unlinkSync(file); | ||
}); | ||
if (stat.isDirectory()) { | ||
dirs.push(path); | ||
} | ||
else { | ||
FS.unlinkSync(path); | ||
} | ||
}); | ||
dirs.forEach((path)=>{ | ||
FS.rmdirSync(path); | ||
}); | ||
if (this.existsSync(path)) { | ||
FS.rmdirSync(path); | ||
} | ||
else { | ||
throw new Error("Cannot use recursiveRmdirSync on a non-directory: "+path); | ||
} | ||
} | ||
@@ -197,0 +204,0 @@ |
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
111176
2786