Comparing version 0.0.15 to 0.0.16
@@ -152,4 +152,17 @@ "use strict"; | ||
return await this.add(db, parseInt(`-${number}`)) | ||
const content = await this.get(db); | ||
if(isNaN(content)) { | ||
throw new TypeError(this.message["errors"]["blankNumber"]); | ||
} | ||
let newNumber = content - number; | ||
if(newNumber <= 0) { | ||
await this.delete(db); | ||
return 0; | ||
} | ||
return await this.set(db, newNumber) | ||
} | ||
@@ -156,0 +169,0 @@ |
@@ -40,3 +40,3 @@ { | ||
}, | ||
"version": "0.0.15" | ||
"version": "0.0.16" | ||
} |
@@ -5,3 +5,3 @@ # CroxyDB | ||
# What's new in 0.0.15? | ||
# What's new in 0.0.16? | ||
- Fixed bugs. | ||
@@ -8,0 +8,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
47461
1371