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

season

Package Overview
Dependencies
Maintainers
4
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

season - npm Package Compare versions

Comparing version 4.0.3 to 5.0.0

spec/fixtures/empty-line.cson

53

lib/cson.js

@@ -99,2 +99,5 @@ (function() {

contents = fs.readFileSync(objectPath, 'utf8');
if (contents.trim().length === 0) {
return null;
}
if (csonCache && path.extname(objectPath) === '.cson') {

@@ -114,29 +117,31 @@ cachePath = getCachePath(contents);

var cachePath;
if (contents.trim().length === 0) {
return typeof callback === "function" ? callback(null, null) : void 0;
}
if (error != null) {
return typeof callback === "function" ? callback(error) : void 0;
}
if (csonCache && path.extname(objectPath) === '.cson') {
cachePath = getCachePath(contents);
return fs.stat(cachePath, function(error, stat) {
if (stat != null ? stat.isFile() : void 0) {
return fs.readFile(cachePath, 'utf8', function(error, cached) {
var parsed;
try {
parsed = JSON.parse(cached);
} catch (_error) {
error = _error;
try {
parseContents(objectPath, cachePath, contents, callback);
} catch (_error) {}
return;
}
return typeof callback === "function" ? callback(null, parsed) : void 0;
});
} else {
return parseContents(objectPath, cachePath, contents, callback);
}
});
} else {
if (csonCache && path.extname(objectPath) === '.cson') {
cachePath = getCachePath(contents);
return fs.stat(cachePath, function(error, stat) {
if (stat != null ? stat.isFile() : void 0) {
return fs.readFile(cachePath, 'utf8', function(error, cached) {
var parsed;
try {
parsed = JSON.parse(cached);
} catch (_error) {
error = _error;
try {
parseContents(objectPath, cachePath, contents, callback);
} catch (_error) {}
return;
}
return typeof callback === "function" ? callback(null, parsed) : void 0;
});
} else {
return parseContents(objectPath, cachePath, contents, callback);
}
});
} else {
return parseContents(objectPath, null, contents, callback);
}
return parseContents(objectPath, null, contents, callback);
}

@@ -143,0 +148,0 @@ };

{
"name": "season",
"version": "4.0.3",
"version": "5.0.0",
"description": "CSON utilities",

@@ -5,0 +5,0 @@ "licenses": [

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