Comparing version 0.0.4 to 0.0.5
'use strict'; | ||
const Fs = require('fs'); | ||
const _ = require('lodash'); | ||
const Moment = require('moment'); | ||
var Fs = require('fs'); | ||
var _ = require('lodash'); | ||
var Moment = require('moment'); | ||
@@ -28,3 +28,3 @@ function createObj(obj, name) { | ||
_.each(srcJson, function(c) { | ||
_.each(srcJson, function (c) { | ||
if (c.domain.charAt(0) === '.') { | ||
@@ -71,2 +71,2 @@ c.domain = c.domain.slice(1); | ||
module.exports = etc2tc; | ||
module.exports = etc2tc; |
@@ -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){"."===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; | ||
"use strict";function createObj(e,a){return void 0===e[a]&&(e[a]={}),e[a]}function pushValue(e,a,t){void 0!==e[a]&&(t[a]=e[a])}function etc2tc(e,a){if(!e||!a)return null;var t=JSON.parse(Fs.readFileSync(e,"utf8")),n={};return _.each(t,function(e){"."===e.domain.charAt(0)&&(e.domain=e.domain.slice(1));var a={domain:e.domain,path:e.path,key:e.name,creation:Moment(),lastAccessed:Moment()};pushValue(e,"value",a),pushValue(e,"maxAge",a),pushValue(e,"secure",a),pushValue(e,"httpOnly",a),pushValue(e,"extensions",a),pushValue(e,"creationIndex",a),pushValue(e,"hostOnly",a),pushValue(e,"pathIsDefault",a),void 0!==e.expirationDate&&(a.expires=Moment(parseInt(1e3*e.expirationDate))),createObj(createObj(createObj(n,e.domain),e.path),e.name),n[e.domain][e.path][e.name]=a}),Fs.writeFileSync(a,JSON.stringify(n),"utf8"),a}var 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.4", | ||
"version": "0.0.5", | ||
"main": "dist/etc2tc.js", | ||
@@ -32,10 +32,12 @@ "files": [ | ||
"dependencies": { | ||
"lodash": "^4.16.6", | ||
"lodash": "^4.17.0", | ||
"moment": "^2.16.0" | ||
}, | ||
"devDependencies": { | ||
"babel-preset-es2015": "^6.18.0", | ||
"del": "^2.2.2", | ||
"gulp": "^3.9.1", | ||
"gulp-babel": "^6.1.2", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-sourcemaps": "^1.6.0", | ||
"gulp-sourcemaps": "^2.2.0", | ||
"gulp-uglify": "^2.0.0" | ||
@@ -42,0 +44,0 @@ }, |
@@ -25,4 +25,4 @@ 'use strict'; | ||
var srcJson = JSON.parse(Fs.readFileSync(srcFile, 'utf8')); | ||
var dstJson = {}; | ||
let srcJson = JSON.parse(Fs.readFileSync(srcFile, 'utf8')); | ||
let dstJson = {}; | ||
@@ -34,3 +34,3 @@ _.each(srcJson, function(c) { | ||
var dst = { | ||
let dst = { | ||
'domain': c.domain, | ||
@@ -37,0 +37,0 @@ 'path': c.path, |
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
10507
7
115
Updatedlodash@^4.17.0