Comparing version 0.0.3 to 0.0.4
@@ -29,2 +29,6 @@ 'use strict'; | ||
_.each(srcJson, function(c) { | ||
if (c.domain.charAt(0) === '.') { | ||
c.domain = c.domain.slice(1); | ||
} | ||
var dst = { | ||
@@ -31,0 +35,0 @@ 'domain': c.domain, |
@@ -1,1 +0,1 @@ | ||
"use strict";function createObj(e,t){return void 0===e[t]&&(e[t]={}),e[t]}function pushValue(e,t,a){void 0!==e[t]&&(a[t]=e[t])}function etc2tc(e,t){if(!e||!t)return null;var a=JSON.parse(Fs.readFileSync(e,"utf8")),n={};return _.each(a,function(e){var t={domain:e.domain,path:e.path,key:e.name,creation:Moment(),lastAccessed:Moment()};pushValue(e,"value",t),pushValue(e,"maxAge",t),pushValue(e,"secure",t),pushValue(e,"httpOnly",t),pushValue(e,"extensions",t),pushValue(e,"creationIndex",t),pushValue(e,"hostOnly",t),pushValue(e,"pathIsDefault",t),void 0!==e.expirationDate&&(t.expires=Moment(parseInt(1e3*e.expirationDate))),createObj(createObj(createObj(n,e.domain),e.path),e.name),n[e.domain][e.path][e.name]=t}),Fs.writeFileSync(t,JSON.stringify(n),"utf8"),t}const Fs=require("fs"),_=require("lodash"),Moment=require("moment");module.exports=etc2tc; | ||
"use strict";function createObj(e,t){return void 0===e[t]&&(e[t]={}),e[t]}function pushValue(e,t,a){void 0!==e[t]&&(a[t]=e[t])}function etc2tc(e,t){if(!e||!t)return null;var a=JSON.parse(Fs.readFileSync(e,"utf8")),n={};return _.each(a,function(e){"."===e.domain.charAt(0)&&(e.domain=e.domain.slice(1));var t={domain:e.domain,path:e.path,key:e.name,creation:Moment(),lastAccessed:Moment()};pushValue(e,"value",t),pushValue(e,"maxAge",t),pushValue(e,"secure",t),pushValue(e,"httpOnly",t),pushValue(e,"extensions",t),pushValue(e,"creationIndex",t),pushValue(e,"hostOnly",t),pushValue(e,"pathIsDefault",t),void 0!==e.expirationDate&&(t.expires=Moment(parseInt(1e3*e.expirationDate))),createObj(createObj(createObj(n,e.domain),e.path),e.name),n[e.domain][e.path][e.name]=t}),Fs.writeFileSync(t,JSON.stringify(n),"utf8"),t}const Fs=require("fs"),_=require("lodash"),Moment=require("moment");module.exports=etc2tc; |
@@ -5,3 +5,3 @@ { | ||
"description": "Convert EditThisCookie json format to ToughCookie json file", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"main": "dist/etc2tc.js", | ||
@@ -8,0 +8,0 @@ "files": [ |
@@ -29,2 +29,6 @@ 'use strict'; | ||
_.each(srcJson, function(c) { | ||
if (c.domain.charAt(0) === '.') { | ||
c.domain = c.domain.slice(1); | ||
} | ||
var dst = { | ||
@@ -31,0 +35,0 @@ 'domain': c.domain, |
Sorry, the diff of this file is not supported yet
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
10447
116