From b4dd405a5aad7b866ca23df18c8cacb0f715f728 Mon Sep 17 00:00:00 2001 From: curben <2809763-curben@users.noreply.gitlab.com> Date: Tue, 3 Sep 2019 03:48:42 +0100 Subject: [PATCH] style: array destructuring https://github.com/airbnb/javascript#destructuring--array --- scripts/cloudinary.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cloudinary.js b/scripts/cloudinary.js index 87512f5..e067aad 100644 --- a/scripts/cloudinary.js +++ b/scripts/cloudinary.js @@ -10,8 +10,8 @@ hexo.extend.tag.register('cloudinary', (args) => { const user = 'curben' - const fileName = args[0] - const alt = args[1] || '' + let [fileName, alt] = args + if (!alt) alt = '' let modern = '' let legacy = '' const link = 'https://cdn.statically.io/img/res.cloudinary.com/' + user