From cd1fe7db29585dcbd53c65b4f868f08800231590 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 20 Feb 2018 17:20:06 +0200 Subject: [PATCH] feature(package) jonny v2.0.3 --- client/client.js | 2 +- client/dom/buffer.js | 4 ++-- client/dom/index.js | 2 +- client/dom/load.js | 2 +- client/dom/storage.js | 8 ++++---- common/util.js | 2 -- package.json | 2 +- server/config.js | 2 +- 8 files changed, 11 insertions(+), 13 deletions(-) diff --git a/client/client.js b/client/client.js index ce8d5ee8..f6fc2656 100644 --- a/client/client.js +++ b/client/client.js @@ -5,7 +5,7 @@ const rendy = require('rendy'); const exec = require('execon'); const Images = require('./dom/images'); const join = require('join-io/www/join'); -const jonny = require('jonny'); +const jonny = require('jonny/legacy'); const { apiURL, diff --git a/client/dom/buffer.js b/client/dom/buffer.js index 3c118867..39ce58ae 100644 --- a/client/dom/buffer.js +++ b/client/dom/buffer.js @@ -2,7 +2,7 @@ /* global CloudCmd */ -const jonny = require('jonny'); +const jonny = require('jonny/legacy'); const exec = require('execon'); const Storage = require('./storage'); @@ -105,7 +105,7 @@ function BufferProto() { const copy = Storage.get.bind(Storage, COPY); const cut = Storage.get.bind(Storage, CUT); - exec.parallel([copy, cut], function(error, cp, ct) { + exec.parallel([copy, cut], (error, cp, ct) => { const opStr = cp ? 'copy' : 'move'; const opData = cp || ct; const Operation = CloudCmd.Operation; diff --git a/client/dom/index.js b/client/dom/index.js index 67712240..369431ca 100644 --- a/client/dom/index.js +++ b/client/dom/index.js @@ -4,7 +4,7 @@ const itype = require('itype/legacy'); const exec = require('execon'); -const jonny = require('jonny'); +const jonny = require('jonny/legacy'); const Util = require('../../common/util'); const { diff --git a/client/dom/load.js b/client/dom/load.js index 1db6f128..b8007b71 100644 --- a/client/dom/load.js +++ b/client/dom/load.js @@ -1,7 +1,7 @@ 'use strict'; const itype = require('itype/legacy'); -const jonny = require('jonny'); +const jonny = require('jonny/legacy'); const Emitify = require('emitify/legacy'); const exec = require('execon'); const Images = require('./images'); diff --git a/client/dom/storage.js b/client/dom/storage.js index 84e08b2d..48cb263c 100644 --- a/client/dom/storage.js +++ b/client/dom/storage.js @@ -1,8 +1,10 @@ 'use strict'; const itype = require('itype/legacy'); -const jonny = require('jonny'); +const jonny = require('jonny/legacy'); const exec = require('execon'); +const tryCatch = require('try-catch'); +const setItem = localStorage.setItem.bind(localStorage); /* приватный переключатель возможности работы с кэшем */ let Allowed; @@ -49,9 +51,7 @@ module.exports.set = (name, data, callback) => { str = jonny.stringify(data); if (Allowed && name) - error = exec.try(() => { - localStorage.setItem(name, str || data); - }); + [error] = tryCatch(setItem, name, str || data); exec(callback, error); diff --git a/common/util.js b/common/util.js index adf5063a..8f0f50b9 100644 --- a/common/util.js +++ b/common/util.js @@ -1,13 +1,11 @@ 'use strict'; const exec = require('execon'); -const jonny = require('jonny'); const Scope = typeof window !== 'undefined' ? window : global; module.exports.getStrBigFirst = getStrBigFirst; module.exports.kebabToCamelCase = kebabToCamelCase; -module.exports.json = jonny; module.exports.escapeRegExp = (str) => { const isStr = typeof str === 'string'; diff --git a/package.json b/package.json index 3238230c..a742695d 100644 --- a/package.json +++ b/package.json @@ -133,7 +133,7 @@ "jaguar": "^3.0.0", "jju": "^1.3.0", "join-io": "^2.0.0", - "jonny": "^1.0.0", + "jonny": "^2.0.3", "markdown-it": "^8.0.0", "mellow": "^2.0.0", "minimist": "^1.2.0", diff --git a/server/config.js b/server/config.js index a6f69bb0..736538c4 100644 --- a/server/config.js +++ b/server/config.js @@ -16,7 +16,7 @@ const squad = require('squad/legacy'); const promisify = require('es6-promisify').promisify; const pullout = promisify(require('pullout/legacy')); const ponse = require('ponse'); -const jonny = require('jonny'); +const jonny = require('jonny/legacy'); const jju = require('jju'); const writejson = require('writejson'); const tryCatch = require('try-catch');