From b7320c52ad2ccd1b220b9c693f7b06b15e0354e9 Mon Sep 17 00:00:00 2001 From: Limon Monte Date: Sun, 23 Jan 2022 10:44:27 +0200 Subject: [PATCH] Use prettier for auto-formatting (#2385) --- .eslintrc.js | 10 +- .prettierrc.js | 3 + cypress/.eslintrc.js | 8 +- cypress/integration/accessibility.spec.js | 28 +- cypress/integration/api.spec.js | 40 +- cypress/integration/bindClickHandler.spec.js | 2 +- .../integration/methods/clickConfirm.spec.js | 4 +- cypress/integration/methods/close.spec.js | 14 +- cypress/integration/methods/destroy.spec.js | 62 ++- .../methods/getFocusableElements.spec.js | 2 +- cypress/integration/methods/getInput.spec.js | 2 +- cypress/integration/methods/input.spec.js | 79 +-- .../integration/methods/showLoading.spec.js | 5 +- cypress/integration/methods/timer.spec.js | 29 +- cypress/integration/methods/update.spec.js | 31 +- cypress/integration/mixins.spec.js | 31 +- .../params/allowOutsideClick.spec.js | 12 +- .../integration/params/customClass.spec.js | 18 +- cypress/integration/params/grow.spec.js | 18 +- cypress/integration/params/html.spec.js | 4 +- cypress/integration/params/icon.spec.js | 13 +- cypress/integration/params/image.spec.js | 4 +- cypress/integration/params/inputValue.spec.js | 16 +- cypress/integration/params/position.spec.js | 101 ++-- cypress/integration/params/preConfirm.spec.js | 42 +- cypress/integration/params/preDeny.spec.js | 44 +- .../integration/params/progressSteps.spec.js | 6 +- cypress/integration/params/showClass.spec.js | 6 +- .../params/stopKeydownPropagation.spec.js | 2 +- cypress/integration/params/template.spec.js | 27 +- .../params/validationMessage.spec.js | 7 +- cypress/integration/scrollbar.spec.js | 12 +- cypress/integration/tests.spec.js | 96 ++-- cypress/integration/toast.spec.js | 10 +- cypress/utils.js | 15 +- gulpfile.js | 133 +++-- package.json | 5 +- release.config.js | 35 +- src/SweetAlert.js | 19 +- src/buttons-handlers.js | 54 +- src/globalState.js | 2 +- src/instanceMethods/_destroy.js | 2 +- src/instanceMethods/close.js | 48 +- .../enable-disable-elements.js | 14 +- src/instanceMethods/getInput.js | 2 +- src/instanceMethods/hideLoading.js | 7 +- src/instanceMethods/progress-steps.js | 2 +- src/instanceMethods/update.js | 33 +- src/instanceMethods/validation-message.js | 4 +- src/keydown-handler.js | 34 +- src/popup-click-handler.js | 4 +- src/privateMethods.js | 2 +- src/privateProps.js | 2 +- src/staticMethods.js | 6 +- src/staticMethods/argsToParams.js | 2 +- src/staticMethods/bindClickHandler.js | 2 +- src/staticMethods/dom.js | 2 +- src/staticMethods/fire.js | 4 +- src/staticMethods/mixin.js | 4 +- src/staticMethods/showLoading.js | 5 +- src/utils/DismissReason.js | 2 +- src/utils/Timer.js | 12 +- src/utils/aria.js | 4 +- src/utils/classes.js | 8 +- src/utils/defaultInputValidators.js | 2 +- src/utils/dom/animationEndEvent.js | 2 +- src/utils/dom/domUtils.js | 21 +- src/utils/dom/getters.js | 10 +- src/utils/dom/init.js | 8 +- src/utils/dom/inputUtils.js | 45 +- src/utils/dom/parseHtmlToContainer.js | 17 +- src/utils/dom/renderers/renderActions.js | 6 +- src/utils/dom/renderers/renderContainer.js | 6 +- src/utils/dom/renderers/renderContent.js | 6 +- src/utils/dom/renderers/renderIcon.js | 37 +- src/utils/dom/renderers/renderInput.js | 49 +- src/utils/dom/renderers/renderPopup.js | 3 +- .../dom/renderers/renderProgressSteps.js | 2 +- src/utils/getTemplateParams.js | 8 +- src/utils/iosFix.js | 21 +- src/utils/params.js | 4 +- src/utils/setParameters.js | 10 +- src/utils/utils.js | 8 +- sweetalert2.code-workspace | 19 + test/.eslintrc.js | 11 - tools/build-dist.js | 1 + .../{purge-jsdelivr.js => purge-jsdelivr.mjs} | 10 +- yarn.lock | 494 +++++++++--------- 88 files changed, 1105 insertions(+), 951 deletions(-) create mode 100644 .prettierrc.js create mode 100644 sweetalert2.code-workspace delete mode 100644 test/.eslintrc.js rename tools/{purge-jsdelivr.js => purge-jsdelivr.mjs} (70%) diff --git a/.eslintrc.js b/.eslintrc.js index 4d4821db6..3117b4b32 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,10 +1,10 @@ module.exports = { - extends: [ - '@sweetalert2/eslint-config', - 'plugin:no-unsanitized/DOM' - ], + extends: ['@sweetalert2/eslint-config', 'plugin:no-unsanitized/DOM'], + plugins: ['import'], rules: { 'import/extensions': ['error', 'always'], '@typescript-eslint/ban-ts-comment': 0, - } + '@typescript-eslint/no-empty-interface': 0, + '@typescript-eslint/no-explicit-any': 0, + }, } diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 000000000..718bb26ee --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,3 @@ +module.exports = { + ...require('@sweetalert2/prettier-config'), +} diff --git a/cypress/.eslintrc.js b/cypress/.eslintrc.js index 62ba4b0fb..dbf4865ab 100644 --- a/cypress/.eslintrc.js +++ b/cypress/.eslintrc.js @@ -1,13 +1,11 @@ module.exports = { - plugins: [ - 'cypress' - ], + plugins: ['cypress'], env: { - 'cypress/globals': true + 'cypress/globals': true, }, rules: { 'no-unsanitized/property': 0, 'no-unused-expressions': 0, 'import/extensions': 0, - } + }, } diff --git a/cypress/integration/accessibility.spec.js b/cypress/integration/accessibility.spec.js index 49ad73d0b..c2d69c6d0 100644 --- a/cypress/integration/accessibility.spec.js +++ b/cypress/integration/accessibility.spec.js @@ -26,7 +26,7 @@ describe('Accessibility:', () => { button.focus() SwalWithoutAnimation.fire({ - returnFocus: false + returnFocus: false, }) Swal.clickConfirm() @@ -68,7 +68,7 @@ describe('Accessibility:', () => { document.body.appendChild(div) SwalWithoutAnimation.fire({ - target: div + target: div, }) expect(div.hasAttribute('aria-hidden')).to.be.false }) @@ -78,7 +78,7 @@ describe('Accessibility:', () => { document.body.appendChild(div) SwalWithoutAnimation.fire({ - backdrop: false + backdrop: false, }) expect(div.hasAttribute('aria-hidden')).to.be.false }) @@ -94,7 +94,7 @@ describe('Accessibility:', () => { didClose: () => { expect(divAriaHiddenTrue.getAttribute('aria-hidden')).to.equal('true') done() - } + }, }) expect(div.hasAttribute('aria-hidden')).to.be.false Swal.close() @@ -144,7 +144,7 @@ describe('should trap focus in modals', () => { triggerKeydownEvent(document.activeElement, 'Tab') expect(document.activeElement).to.equal(Swal.getInput()) done() - } + }, }) }) @@ -167,7 +167,7 @@ describe('should trap focus in modals', () => { triggerKeydownEvent(document.activeElement, 'Tab', { shiftKey: true }) expect(document.activeElement).to.equal(Swal.getInput()) done() - } + }, }) }) @@ -185,7 +185,7 @@ describe('should trap focus in modals', () => { triggerKeydownEvent(document.activeElement, 'ArrowLeft') expect(document.activeElement).to.equal(Swal.getConfirmButton()) done() - } + }, }) }) }) @@ -196,12 +196,12 @@ describe('Focus', () => { expect(document.activeElement).to.equal(document.querySelector('.swal2-confirm')) SwalWithoutAnimation.fire({ text: 'Modal with two buttons', - showCancelButton: true + showCancelButton: true, }) expect(document.activeElement).to.equal(document.querySelector('.swal2-confirm')) SwalWithoutAnimation.fire({ text: 'Modal with no focusable elements in it', - showConfirmButton: false + showConfirmButton: false, }) expect(document.activeElement).to.equal(document.querySelector('.swal2-modal')) SwalWithoutAnimation.fire({ @@ -210,13 +210,13 @@ describe('Focus', () => { didOpen: () => { expect(document.activeElement).to.equal(document.querySelector('.swal2-input')) done() - } + }, }) }) it('focusConfirm', () => { Swal.fire({ - showCancelButton: true + showCancelButton: true, }) expect(document.activeElement).to.equal(Swal.getConfirmButton()) const anchor = document.createElement('a') @@ -225,7 +225,7 @@ describe('Focus', () => { Swal.fire({ html: anchor, showCancelButton: true, - focusConfirm: false + focusConfirm: false, }) expect(document.activeElement.outerHTML).to.equal(anchor.outerHTML) }) @@ -234,7 +234,7 @@ describe('Focus', () => { Swal.fire({ text: 'Modal with Cancel button focused', showCancelButton: true, - focusCancel: true + focusCancel: true, }) expect(document.activeElement).to.equal(Swal.getCancelButton()) }) @@ -243,7 +243,7 @@ describe('Focus', () => { Swal.fire({ text: 'Modal with Deny button focused', showDenyButton: true, - focusDeny: true + focusDeny: true, }) expect(document.activeElement).to.equal(Swal.getDenyButton()) }) diff --git a/cypress/integration/api.spec.js b/cypress/integration/api.spec.js index 11abc4ac7..f297876f3 100644 --- a/cypress/integration/api.spec.js +++ b/cypress/integration/api.spec.js @@ -2,12 +2,12 @@ import { Swal } from '../utils' describe('API', () => { it('properties of `Swal` class are consistent', (done) => { - const assertConsistent = postfix => { + const assertConsistent = (postfix) => { const currentSwalPropNames = Object.keys(Swal) // const extraPropNames = currentSwalPropNames.filter(key => !initialSwalPropNames.includes(key)) // expect(extraPropNames.length, 0).to.be.eql(`# of extra properties ${postfix}`) // expect(extraPropNames.join(','), '').to.be.eql(`extra property names ${postfix}`) - const missingProps = currentSwalPropNames.filter(key => !currentSwalPropNames.includes(key)) + const missingProps = currentSwalPropNames.filter((key) => !currentSwalPropNames.includes(key)) expect(missingProps.length).to.equal(0, `# of missing properties ${postfix}`) expect(missingProps.join(',')).to.equal('', `missing property names ${postfix}`) } @@ -17,7 +17,7 @@ describe('API', () => { didOpen: () => { assertConsistent('after opening first swal') Swal.clickConfirm() - } + }, }).then(() => { assertConsistent('after closing first swal') done() @@ -25,7 +25,7 @@ describe('API', () => { }) it('ways to instantiate', () => { - expect((new Swal('foo')) instanceof Swal).to.be.true + expect(new Swal('foo') instanceof Swal).to.be.true expect(Swal.fire('foo') instanceof Swal).to.be.true }) @@ -39,29 +39,31 @@ describe('API', () => { it('extending swal', (done) => { const MySwal = class extends Swal { - static argsToParams (args) { + static argsToParams(args) { expect(args).to.be.eql(['arg']) return { title: 'title' } } - _main (params) { + _main(params) { expect(params).to.be.eql({ title: 'title' }) - return super._main({ - input: 'text', - inputValue: 'inputValue', - didOpen: () => MySwal.clickConfirm() - }).then(result => { - expect(result).to.be.eql({ - value: 'inputValue', - isConfirmed: true, - isDenied: false, - isDismissed: false, + return super + ._main({ + input: 'text', + inputValue: 'inputValue', + didOpen: () => MySwal.clickConfirm(), + }) + .then((result) => { + expect(result).to.be.eql({ + value: 'inputValue', + isConfirmed: true, + isDenied: false, + isDismissed: false, + }) + return 'result' }) - return 'result' - }) } } - MySwal.fire('arg').then(result => { + MySwal.fire('arg').then((result) => { expect(result).to.equal('result') done() }) diff --git a/cypress/integration/bindClickHandler.spec.js b/cypress/integration/bindClickHandler.spec.js index 6e1348797..e7dfe709b 100644 --- a/cypress/integration/bindClickHandler.spec.js +++ b/cypress/integration/bindClickHandler.spec.js @@ -4,7 +4,7 @@ describe('bindClickHandler', () => { it('bindClickHandler', () => { SwalWithoutAnimation.bindClickHandler() SwalWithoutAnimation.mixin({ - toast: true + toast: true, }).bindClickHandler('data-swal-toast-template') const template = document.createElement('template') diff --git a/cypress/integration/methods/clickConfirm.spec.js b/cypress/integration/methods/clickConfirm.spec.js index 3367223c4..0947baa2e 100644 --- a/cypress/integration/methods/clickConfirm.spec.js +++ b/cypress/integration/methods/clickConfirm.spec.js @@ -6,8 +6,8 @@ describe('clickConfirm()', () => { input: 'radio', inputOptions: { one: 'one', - two: 'two' - } + two: 'two', + }, }).then((result) => { expect(result).to.eql({ value: 'two', diff --git a/cypress/integration/methods/close.spec.js b/cypress/integration/methods/close.spec.js index 69dbf952b..713229df8 100644 --- a/cypress/integration/methods/close.spec.js +++ b/cypress/integration/methods/close.spec.js @@ -7,13 +7,13 @@ describe('close()', () => { willClose: () => { expect(Swal.getPopup().classList.contains('swal2-hide')).to.be.true done() - } + }, }) Swal.close() }) it('resolves when calling Swal.close()', (done) => { - Swal.fire().then(result => { + Swal.fire().then((result) => { expect(result).to.be.eql({ isConfirmed: false, isDenied: false, @@ -29,7 +29,7 @@ describe('close()', () => { willClose: () => { expect(Swal.isVisible()).to.be.true done() - } + }, }) Swal.close() }) @@ -39,7 +39,7 @@ describe('close()', () => { didClose: () => { expect(Swal.isVisible()).to.be.false done() - } + }, }) Swal.close() }) @@ -53,10 +53,10 @@ describe('close()', () => { didOpen: () => { expect(Swal.getInput()).to.not.be.null done() - } + }, }) expect(Swal.isVisible()).to.be.true - } + }, }) Swal.close() }) @@ -67,7 +67,7 @@ describe('close()', () => { Swal.close() expect(Swal.isVisible()).to.be.false done() - } + }, }) Swal.close() }) diff --git a/cypress/integration/methods/destroy.spec.js b/cypress/integration/methods/destroy.spec.js index 56673e687..8e431e364 100644 --- a/cypress/integration/methods/destroy.spec.js +++ b/cypress/integration/methods/destroy.spec.js @@ -21,13 +21,15 @@ describe('_destroy()', () => { it('should empty the private methods after having received a reject of an async call', (done) => { let instance = null Swal.fire({ - preConfirm: () => new Promise((resolve, reject) => cy.wait(500).then(() => reject(new Error('msg3')))) - }).then(() => { - // - }).catch(() => { - expect(privateMethods.swalPromiseResolve.get(instance)).to.equal(undefined) - done() + preConfirm: () => new Promise((resolve, reject) => cy.wait(500).then(() => reject(new Error('msg3')))), }) + .then(() => { + // + }) + .catch(() => { + expect(privateMethods.swalPromiseResolve.get(instance)).to.equal(undefined) + done() + }) instance = globalState.currentInstance Swal.clickConfirm() Swal.fire({}) @@ -36,7 +38,7 @@ describe('_destroy()', () => { it('should empty the private methods after having received a resolve of an async call', (done) => { let instance = null Swal.fire({ - preConfirm: () => new Promise((resolve) => cy.wait(500).then(resolve)) + preConfirm: () => new Promise((resolve) => cy.wait(500).then(resolve)), }).then(() => { expect(privateMethods.swalPromiseResolve.get(instance)).to.equal(undefined) done() @@ -49,16 +51,17 @@ describe('_destroy()', () => { it('should empty the private methods after the result of an async call in preConfirm even when another unrelated swal is fired', (done) => { let instance = null Swal.fire({ - preConfirm: () => new Promise((resolve) => { - Swal.fire({ - test: 'Unrelated Swal', - didOpen: () => { - expect(privateProps.innerParams.get(instance)).to.equal(undefined) - expect(privateMethods.swalPromiseResolve.get(instance)).to.not.equal(undefined) - } - }) - cy.wait(500).then(resolve) - }) + preConfirm: () => + new Promise((resolve) => { + Swal.fire({ + test: 'Unrelated Swal', + didOpen: () => { + expect(privateProps.innerParams.get(instance)).to.equal(undefined) + expect(privateMethods.swalPromiseResolve.get(instance)).to.not.equal(undefined) + }, + }) + cy.wait(500).then(resolve) + }), }).then(() => { expect(privateMethods.swalPromiseResolve.get(instance)).to.equal(undefined) done() @@ -69,16 +72,17 @@ describe('_destroy()', () => { it('should destroy privateMethods after the result of an async call in preDeny even when another unrelated swal is fired', (done) => { let instance = null Swal.fire({ - preDeny: () => new Promise((resolve) => { - Swal.fire({ - test: 'Unrelated Swal', - didOpen: () => { - expect(privateProps.innerParams.get(instance)).to.equal(undefined) - expect(privateMethods.swalPromiseResolve.get(instance)).to.not.equal(undefined) - } - }) - cy.wait(500).then(resolve) - }) + preDeny: () => + new Promise((resolve) => { + Swal.fire({ + test: 'Unrelated Swal', + didOpen: () => { + expect(privateProps.innerParams.get(instance)).to.equal(undefined) + expect(privateMethods.swalPromiseResolve.get(instance)).to.not.equal(undefined) + }, + }) + cy.wait(500).then(resolve) + }), }).then(() => { expect(privateMethods.swalPromiseResolve.get(instance)).to.equal(undefined) done() @@ -99,9 +103,9 @@ describe('_destroy()', () => { expect(isResolved).to.equal(false) expect(privateMethods.swalPromiseResolve.get(instance)).to.not.equal(undefined) Swal.clickConfirm() - } + }, }) - } + }, }).then(() => { isResolved = true expect(privateMethods.swalPromiseResolve.get(instance)).to.equal(undefined) diff --git a/cypress/integration/methods/getFocusableElements.spec.js b/cypress/integration/methods/getFocusableElements.spec.js index 4d5a4869f..21d4a1c54 100644 --- a/cypress/integration/methods/getFocusableElements.spec.js +++ b/cypress/integration/methods/getFocusableElements.spec.js @@ -14,7 +14,7 @@ describe('getFocusableElements() method', () => { `, showDenyButton: true, showCancelButton: true, - showCloseButton: true + showCloseButton: true, }) const focusableElements = Swal.getFocusableElements() expect(focusableElements.length).to.equal(10) diff --git a/cypress/integration/methods/getInput.spec.js b/cypress/integration/methods/getInput.spec.js index 73cfd7dbe..5a86374f6 100644 --- a/cypress/integration/methods/getInput.spec.js +++ b/cypress/integration/methods/getInput.spec.js @@ -9,7 +9,7 @@ describe('getInput()', () => { expect(Swal.getInput()).to.be.null done() }, TIMEOUT) - } + }, }) Swal.close() }) diff --git a/cypress/integration/methods/input.spec.js b/cypress/integration/methods/input.spec.js index dd8c4dc97..80de1f9ec 100644 --- a/cypress/integration/methods/input.spec.js +++ b/cypress/integration/methods/input.spec.js @@ -1,4 +1,5 @@ -import { $, Swal, SwalWithoutAnimation, isVisible, isHidden, triggerKeydownEvent, dispatchCustomEvent, TIMEOUT } from '../../utils' +import { isVisible } from '../../../src/utils/dom' +import { $, Swal, SwalWithoutAnimation, isHidden, triggerKeydownEvent, dispatchCustomEvent, TIMEOUT } from '../../utils' import { toArray } from '../../../src/utils/utils' import defaultInputValidators from '../../../src/utils/defaultInputValidators' @@ -6,7 +7,9 @@ describe('Input', () => { it('should throw console error about unexpected input type', () => { const spy = cy.spy(console, 'error') Swal.fire({ input: 'invalid-input-type' }) - expect(spy).to.be.calledWith('SweetAlert2: Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "invalid-input-type"') + expect(spy).to.be.calledWith( + 'SweetAlert2: Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "invalid-input-type"' + ) }) it('input text', (done) => { @@ -25,7 +28,7 @@ describe('Input', () => { it('input textarea', (done) => { Swal.fire({ input: 'textarea', - inputAutoTrim: false + inputAutoTrim: false, }).then((result) => { expect(result.value).to.equal('hola!') done() @@ -80,7 +83,7 @@ describe('Input', () => { Swal.fire({ input: 'select', inputOptions: { uno: 1, dos: 2 }, - inputPlaceholder: 'Choose a number' + inputPlaceholder: 'Choose a number', }).then((result) => { expect(result.value).to.equal(selected) done() @@ -98,8 +101,8 @@ describe('Input', () => { const selected = 'três ponto um' Swal.fire({ input: 'select', - inputOptions: { 'um': 1.0, 'dois': 2.0, 'três': { 'três ponto um': 3.1, 'três ponto dois': 3.2 } }, - inputPlaceholder: 'Choose an item' + inputOptions: { um: 1.0, dois: 2.0, três: { 'três ponto um': 3.1, 'três ponto dois': 3.2 } }, + inputPlaceholder: 'Choose an item', }).then((result) => { expect(result.value).to.equal(selected) done() @@ -117,8 +120,11 @@ describe('Input', () => { const selected = 'três ponto dois' Swal.fire({ input: 'select', - inputOptions: { 'dois': { 'dois ponto um': 2.1, 'dois ponto dois': 2.2 }, 'três': { 'três ponto um': 3.1, 'três ponto dois': 3.2 } }, - inputPlaceholder: 'Choose an item' + inputOptions: { + dois: { 'dois ponto um': 2.1, 'dois ponto dois': 2.2 }, + três: { 'três ponto um': 3.1, 'três ponto dois': 3.2 }, + }, + inputPlaceholder: 'Choose an item', }).then((result) => { expect(result.value).to.equal(selected) done() @@ -142,7 +148,7 @@ describe('Input', () => { expect(Swal.getInput().value).to.equal('one') done() }, TIMEOUT) - } + }, }) }) @@ -150,7 +156,7 @@ describe('Input', () => { Swal.fire({ input: 'select', inputOptions: { - toPromise: () => Promise.resolve({ three: 3, four: 4 }) + toPromise: () => Promise.resolve({ three: 3, four: 4 }), }, didOpen: () => { setTimeout(() => { @@ -158,14 +164,14 @@ describe('Input', () => { expect(Swal.getInput().value).to.equal('three') done() }, TIMEOUT) - } + }, }) }) it('input text w/ inputPlaceholder as configuration', () => { Swal.fire({ input: 'text', - inputPlaceholder: 'placeholder text' + inputPlaceholder: 'placeholder text', }) expect(Swal.getInput().value).to.equal('') expect(Swal.getInput().placeholder).to.equal('placeholder text') @@ -204,7 +210,7 @@ describe('Input', () => { SwalWithoutAnimation.fire({ input: 'select', inputOptions, - inputValue: 1 + inputValue: 1, }) expect($('.swal2-select').querySelectorAll('option').length).to.equal(2) expect($('.swal2-select option:nth-child(1)').innerHTML).to.equal('Richard Stallman') @@ -228,7 +234,7 @@ describe('Input', () => { SwalWithoutAnimation.fire({ input: 'select', inputOptions, - inputValue: 1 + inputValue: 1, }) expect($('.swal2-select').querySelectorAll('option').length).to.equal(5) expect($('.swal2-select').querySelectorAll('optgroup').length).to.equal(1) @@ -262,7 +268,7 @@ describe('Input', () => { SwalWithoutAnimation.fire({ input: 'select', inputOptions, - inputValue: '1000' + inputValue: '1000', }) expect($('.swal2-select').querySelectorAll('option').length).to.equal(5) expect($('.swal2-select').querySelectorAll('optgroup').length).to.equal(2) @@ -286,7 +292,7 @@ describe('Input', () => { Swal.fire({ input: 'radio', inputOptions, - inputValue: 1 + inputValue: 1, }) expect($('.swal2-radio').querySelectorAll('label').length).to.equal(2) expect($('.swal2-radio label:nth-child(1)').textContent).to.equal('Richard Stallman') @@ -301,8 +307,8 @@ describe('Input', () => { input: 'radio', inputOptions: { one: 'one', - two: 'two' - } + two: 'two', + }, }) expect($('.swal2-radio').querySelectorAll('label').length).to.equal(2) expect($('.swal2-radio').querySelectorAll('input[type="radio"]').length).to.equal(2) @@ -349,7 +355,8 @@ describe('Input', () => { returnInputValueOnDeny: true, }) Swal.clickDeny() - expect(spy.calledWith('SweetAlert2: The "input" parameter is needed to be set when using returnInputValueOnDeny')).to.be.true + expect(spy.calledWith('SweetAlert2: The "input" parameter is needed to be set when using returnInputValueOnDeny')) + .to.be.true }) it('disable/enable input', () => { @@ -358,7 +365,7 @@ describe('Input', () => { Swal.enableInput() Swal.fire({ - input: 'text' + input: 'text', }) Swal.disableInput() @@ -370,8 +377,8 @@ describe('Input', () => { input: 'radio', inputOptions: { one: 'one', - two: 'two' - } + two: 'two', + }, }) Swal.disableInput() @@ -387,26 +394,22 @@ describe('Input', () => { it('should throw console error about unexpected type of InputOptions', () => { const spy = cy.spy(console, 'error') Swal.fire({ input: 'select', inputOptions: 'invalid-input-options' }) - expect(spy.calledWith('SweetAlert2: Unexpected type of inputOptions! Expected object, Map or Promise, got string')).to.be.true + expect(spy.calledWith('SweetAlert2: Unexpected type of inputOptions! Expected object, Map or Promise, got string')) + .to.be.true }) it('multiple inputs', (done) => { Swal.fire({ - html: - '' + - '', + html: '' + '', preConfirm: () => { - return [ - document.getElementById('swal-input1').value, - document.getElementById('swal-input2').value - ] + return [document.getElementById('swal-input1').value, document.getElementById('swal-input2').value] }, didOpen: () => { document.getElementById('swal-input1').value = 'foo' document.getElementById('swal-input2').value = 'bar' Swal.clickConfirm() - } - }).then(result => { + }, + }).then((result) => { expect(result.value).to.eql(['foo', 'bar']) done() }) @@ -418,13 +421,13 @@ describe('Validation', () => { Swal.fire({ input: 'tel', inputAttributes: { - pattern: '[0-9]{3}-[0-9]{3}-[0-9]{4}' + pattern: '[0-9]{3}-[0-9]{3}-[0-9]{4}', }, validationMessage: 'Invalid phone number', customClass: { - validationMessage: 'my-validation-message' + validationMessage: 'my-validation-message', }, - }).then(result => { + }).then((result) => { expect(result.value).to.equal('123-456-7890') done() }) @@ -477,8 +480,8 @@ describe('Validation', () => { SwalWithoutAnimation.fire({ input: 'text', inputValidator: (value) => ({ - toPromise: () => Promise.resolve(!value && 'no falsy values') - }) + toPromise: () => Promise.resolve(!value && 'no falsy values'), + }), }) setTimeout(() => { @@ -510,7 +513,7 @@ describe('Validation', () => { }) it('default URL validator: invalid url', (done) => { - defaultInputValidators.url('invalid url').then(data => { + defaultInputValidators.url('invalid url').then((data) => { expect(data).to.equal('Invalid URL') done() }) diff --git a/cypress/integration/methods/showLoading.spec.js b/cypress/integration/methods/showLoading.spec.js index 16addb264..cf1f2c22c 100644 --- a/cypress/integration/methods/showLoading.spec.js +++ b/cypress/integration/methods/showLoading.spec.js @@ -1,4 +1,5 @@ -import { $, Swal, ensureClosed, isVisible, isHidden } from '../../utils' +import { isVisible } from '../../../src/utils/dom' +import { $, Swal, ensureClosed, isHidden } from '../../utils' describe('showLoading() and hideLoading()', () => { it('showLoading() and hideLoading()', () => { @@ -10,7 +11,7 @@ describe('showLoading() and hideLoading()', () => { Swal.fire({ title: 'test loading state', - showConfirmButton: false + showConfirmButton: false, }) Swal.showLoading() diff --git a/cypress/integration/methods/timer.spec.js b/cypress/integration/methods/timer.spec.js index 782ac5cf7..70f4d3639 100644 --- a/cypress/integration/methods/timer.spec.js +++ b/cypress/integration/methods/timer.spec.js @@ -1,9 +1,10 @@ -import { $, Swal, SwalWithoutAnimation, isVisible } from '../../utils' +import { isVisible } from '../../../src/utils/dom' +import { $, Swal, SwalWithoutAnimation } from '../../utils' describe('getTimerLeft()', () => { it('should return time left', (done) => { Swal.fire({ - timer: 1000 + timer: 1000, }) setTimeout(() => { const timerLeft = Swal.getTimerLeft() @@ -15,7 +16,7 @@ describe('getTimerLeft()', () => { it('should return undefined if popup does not have timer', () => { Swal.fire({ - timer: 1000 + timer: 1000, }) Swal.fire('I do not have timer, I should reset timer') const timerLeft = Swal.getTimerLeft() @@ -26,7 +27,7 @@ describe('getTimerLeft()', () => { describe('increaseTimer()', () => { it('should increase timer', (done) => { SwalWithoutAnimation.fire({ - timer: 500 + timer: 500, }) expect(Swal.increaseTimer(400) > 0).to.be.true setTimeout(() => { @@ -40,7 +41,7 @@ describe('increaseTimer()', () => { it('should increase stopped timer', (done) => { SwalWithoutAnimation.fire({ - timer: 500 + timer: 500, }) const remainingTime = Swal.stopTimer() Swal.increaseTimer(10) @@ -53,7 +54,7 @@ describe('increaseTimer()', () => { it('isTimerRunning() method', (done) => { SwalWithoutAnimation.fire({ - timer: 200 + timer: 200, }) setTimeout(() => { expect(Swal.isTimerRunning()).to.be.true @@ -66,7 +67,7 @@ it('isTimerRunning() method', (done) => { describe('resumeTimer()', () => { it('should resume timer', (done) => { SwalWithoutAnimation.fire({ - timer: 100 + timer: 100, }) Swal.stopTimer() setTimeout(() => { @@ -81,7 +82,7 @@ describe('resumeTimer()', () => { it('should not fail when called twice', (done) => { SwalWithoutAnimation.fire({ - timer: 500 + timer: 500, }) Swal.resumeTimer() Swal.resumeTimer() @@ -96,7 +97,7 @@ describe('resumeTimer()', () => { describe('stopTimer()', () => { it('should stop timer', (done) => { SwalWithoutAnimation.fire({ - timer: 500 + timer: 500, }) setTimeout(() => { expect(Swal.stopTimer() > 0).to.be.true @@ -109,7 +110,7 @@ describe('stopTimer()', () => { it('should not fail when called twice', (done) => { SwalWithoutAnimation.fire({ - timer: 500 + timer: 500, }) const remainingTime = Swal.stopTimer() setTimeout(() => { @@ -121,7 +122,7 @@ describe('stopTimer()', () => { it('toggleTimer() method', (done) => { SwalWithoutAnimation.fire({ - timer: 500 + timer: 500, }) Swal.toggleTimer() setTimeout(() => { @@ -137,7 +138,7 @@ it('toggleTimer() method', (done) => { it('getTimerProgressBar() method', () => { SwalWithoutAnimation.fire({ timer: 500, - timerProgressBar: true + timerProgressBar: true, }) expect(Swal.getTimerProgressBar()).to.equal($('.swal2-timer-progress-bar')) }) @@ -146,7 +147,7 @@ describe('timerProgressBar', () => { it('should show timer progress bar', () => { SwalWithoutAnimation.fire({ timer: 10, - timerProgressBar: true + timerProgressBar: true, }) const progressBar = document.querySelector('.swal2-timer-progress-bar') @@ -169,7 +170,7 @@ describe('timerProgressBar', () => { SwalWithoutAnimation.fire({ timer: 100, timerProgressBar: true, - didOpen: Swal.stopTimer + didOpen: Swal.stopTimer, }) setTimeout(() => { expect(Swal.getTimerProgressBar().style.transition).to.equal('') diff --git a/cypress/integration/methods/update.spec.js b/cypress/integration/methods/update.spec.js index 2f873d6ec..c2106b793 100644 --- a/cypress/integration/methods/update.spec.js +++ b/cypress/integration/methods/update.spec.js @@ -1,4 +1,5 @@ -import { $, Swal, SwalWithoutAnimation, isVisible } from '../../utils' +import { $, Swal, SwalWithoutAnimation } from '../../utils' +import { isVisible } from '../../../src/utils/dom' import { defaultParams, updatableParams } from '../../../src/utils/params' describe('update()', () => { @@ -17,7 +18,7 @@ describe('update()', () => { input: 'text', showConfirmButton: false, imageUrl: '/assets/swal2-logo.png', - preConfirm: () => console.log('1') // eslint-disable-line no-console + preConfirm: () => console.log('1'), // eslint-disable-line no-console }) Swal.update({ @@ -33,7 +34,7 @@ describe('update()', () => { cancelButtonText: 'New cancel button text', imageUrl: '/assets/swal2-logo.png', showCloseButton: true, - preConfirm: () => console.log('2') // eslint-disable-line no-console + preConfirm: () => console.log('2'), // eslint-disable-line no-console }) expect(window.getComputedStyle(Swal.getPopup()).backgroundColor).to.equal('rgb(0, 128, 0)') @@ -69,7 +70,7 @@ describe('update()', () => { SwalWithoutAnimation.fire({ icon: 'success', imageUrl: '/assets/swal2-logo.png', - input: 'text' + input: 'text', }) Swal.update({ @@ -86,8 +87,8 @@ describe('update()', () => { confirmButton: 'confirm-button-class', denyButton: 'deny-button-class', cancelButton: 'cancel-button-class', - footer: 'footer-class' - } + footer: 'footer-class', + }, }) // new custom classnames should be added, and the previous custom classnames should be removed @@ -105,8 +106,8 @@ describe('update()', () => { confirmButton: 'confirm-button-class-NEW', denyButton: 'deny-button-class-NEW', cancelButton: 'cancel-button-class-NEW', - footer: 'footer-class-NEW' - } + footer: 'footer-class-NEW', + }, }) expect(Swal.getContainer().classList.contains('container-class')).to.be.false @@ -143,7 +144,7 @@ describe('update()', () => { expect(Swal.isUpdatableParameter('willOpen')).to.be.false }) - it('should update instance\'s params', () => { + it("should update instance's params", () => { const swal = Swal.fire({ icon: 'error' }) expect(swal.params.icon).to.equal('error') swal.update({ icon: 'warning' }) @@ -156,8 +157,8 @@ describe('update()', () => { inputOptions: { uno: 'uno', dos: 'dos', - tres: 'tres' - } + tres: 'tres', + }, }) Swal.getInput().value = 'dos' Swal.update({ html: 'hi' }) @@ -173,7 +174,7 @@ describe('update()', () => { expect(Swal.getPopup().classList.contains('swal2-show')).to.be.true expect(Swal.getIcon().classList.contains('swal2-icon-show')).to.be.true done() - } + }, }) }) @@ -181,7 +182,11 @@ describe('update()', () => { const spy = cy.spy(console, 'warn') Swal.fire().then(() => { Swal.update() - expect(spy.calledWith(`SweetAlert2: You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.`)).to.be.true + expect( + spy.calledWith( + `SweetAlert2: You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.` + ) + ).to.be.true done() }) Swal.clickConfirm() diff --git a/cypress/integration/mixins.spec.js b/cypress/integration/mixins.spec.js index e8fbf50ca..7675e2790 100644 --- a/cypress/integration/mixins.spec.js +++ b/cypress/integration/mixins.spec.js @@ -8,7 +8,7 @@ describe('mixins', () => { didOpen: () => { expect(MySwal.getTitle().textContent).to.equal('1_title') MySwal.clickConfirm() - } + }, }) expect(swal instanceof MySwal).to.be.true expect(swal instanceof Swal).to.be.true @@ -32,7 +32,7 @@ describe('mixins', () => { expect(MySwal.getHtmlContainer().textContent).to.equal('2_html') MySwal.clickConfirm() done() - } + }, }) MySwal.fire('2_title', '2_html') }) @@ -43,8 +43,7 @@ describe('mixins', () => { }) it('params from 2nd mixin should override params from 1st mixin', (done) => { - Swal - .mixin({ showClass: { popup: 'i-should-be-overriden' } }) + Swal.mixin({ showClass: { popup: 'i-should-be-overriden' } }) .mixin({ showClass: { backdrop: 'backdrop-custom-show-class' } }) .fire({ didOpen: () => { @@ -53,22 +52,20 @@ describe('mixins', () => { expect(Swal.getPopup().classList.contains('i-should-be-overriden')).to.be.false done() }, SHOW_CLASS_TIMEOUT) - } + }, }) }) it('params from fire() should override params from mixin()', (done) => { - Swal - .mixin({ showClass: { popup: 'i-should-be-overriden' } }) - .fire({ - showClass: { backdrop: 'backdrop-custom-show-class' }, - didOpen: () => { - setTimeout(() => { - expect(Swal.getContainer().classList.contains('backdrop-custom-show-class')).to.be.true - expect(Swal.getPopup().classList.contains('i-should-be-overriden')).to.be.false - done() - }, SHOW_CLASS_TIMEOUT) - } - }) + Swal.mixin({ showClass: { popup: 'i-should-be-overriden' } }).fire({ + showClass: { backdrop: 'backdrop-custom-show-class' }, + didOpen: () => { + setTimeout(() => { + expect(Swal.getContainer().classList.contains('backdrop-custom-show-class')).to.be.true + expect(Swal.getPopup().classList.contains('i-should-be-overriden')).to.be.false + done() + }, SHOW_CLASS_TIMEOUT) + }, + }) }) }) diff --git a/cypress/integration/params/allowOutsideClick.spec.js b/cypress/integration/params/allowOutsideClick.spec.js index e9b7aa6cd..a04ab5d79 100644 --- a/cypress/integration/params/allowOutsideClick.spec.js +++ b/cypress/integration/params/allowOutsideClick.spec.js @@ -4,7 +4,7 @@ describe('allowOutsideClick', () => { it('allowOutsideClick: false', (done) => { SwalWithoutAnimation.fire({ title: 'allowOutsideClick: false', - allowOutsideClick: false + allowOutsideClick: false, }) Swal.getContainer().click() setTimeout(() => { @@ -16,7 +16,7 @@ describe('allowOutsideClick', () => { it('allowOutsideClick: () => !swal.isLoading()', (done) => { SwalWithoutAnimation.fire({ title: 'allowOutsideClick: () => !swal.isLoading()', - allowOutsideClick: () => !Swal.isLoading() + allowOutsideClick: () => !Swal.isLoading(), }).then((result) => { expect(result).to.eql({ dismiss: Swal.DismissReason.backdrop, @@ -40,15 +40,17 @@ describe('allowOutsideClick', () => { SwalWithoutAnimation.fire({ title: 'allowOutsideClick is not compatible with modeless popups', allowOutsideClick: true, - backdrop: false + backdrop: false, }) - expect(spy.calledWith('SweetAlert2: "allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`')).to.be.true + expect( + spy.calledWith('SweetAlert2: "allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`') + ).to.be.true }) it('should not throw console warning for { backdrop: false }', () => { const spy = cy.spy(console, 'warn') SwalWithoutAnimation.fire({ - backdrop: false + backdrop: false, }) expect(spy.notCalled).to.be.true }) diff --git a/cypress/integration/params/customClass.spec.js b/cypress/integration/params/customClass.spec.js index d1b7bfc8e..136b08824 100644 --- a/cypress/integration/params/customClass.spec.js +++ b/cypress/integration/params/customClass.spec.js @@ -25,8 +25,8 @@ describe('customClass', () => { denyButton: 'deny-button-class', cancelButton: 'cancel-button-class', loader: 'loader-class', - footer: 'footer-class' - } + footer: 'footer-class', + }, }) expect(Swal.getContainer().classList.contains('container-class')).to.be.true expect(Swal.getPopup().classList.contains('popup-class')).to.be.true @@ -49,7 +49,7 @@ describe('customClass', () => { input: 'checkbox', customClass: { input: 'input-class', - } + }, }) expect($('.swal2-checkbox').classList.contains('input-class')).to.be.true expect(Swal.getInput().classList.contains('input-class')).to.be.false @@ -60,7 +60,7 @@ describe('customClass', () => { title: 'I should have a custom classname', customClass: { title: 'title-class', - } + }, }) expect(Swal.getTitle().classList.contains('title-class')).to.be.true }) @@ -71,9 +71,13 @@ describe('customClass', () => { customClass: { title: {}, popup: 14, - } + }, }) - expect(spy.calledWith('SweetAlert2: Invalid type of customClass.title! Expected string or iterable object, got "object"')).to.be.true - expect(spy.calledWith('SweetAlert2: Invalid type of customClass.popup! Expected string or iterable object, got "number"')).to.be.true + expect( + spy.calledWith('SweetAlert2: Invalid type of customClass.title! Expected string or iterable object, got "object"') + ).to.be.true + expect( + spy.calledWith('SweetAlert2: Invalid type of customClass.popup! Expected string or iterable object, got "number"') + ).to.be.true }) }) diff --git a/cypress/integration/params/grow.spec.js b/cypress/integration/params/grow.spec.js index fa9b90741..54f4a742b 100644 --- a/cypress/integration/params/grow.spec.js +++ b/cypress/integration/params/grow.spec.js @@ -3,17 +3,21 @@ import { Swal } from '../../utils' describe('grow', () => { it('grow row', () => { Swal.fire({ - grow: 'row' + grow: 'row', }) const containerStyles = window.getComputedStyle(Swal.getContainer()) expect(Swal.getPopup().clientWidth).to.equal( - parseInt(Swal.getContainer().clientWidth - parseFloat(containerStyles.paddingLeft) - parseFloat(containerStyles.paddingRight)) + parseInt( + Swal.getContainer().clientWidth - + parseFloat(containerStyles.paddingLeft) - + parseFloat(containerStyles.paddingRight) + ) ) }) it('grow column', () => { Swal.fire({ - grow: 'column' + grow: 'column', }) const containerStyles = window.getComputedStyle(Swal.getContainer()) expect(Swal.getPopup().clientHeight).to.equal( @@ -23,12 +27,16 @@ describe('grow', () => { it('grow fullscreen', () => { Swal.fire({ - grow: 'fullscreen' + grow: 'fullscreen', }) const containerStyles = window.getComputedStyle(Swal.getContainer()) expect(Swal.getPopup().clientWidth).to.equal( - parseInt(Swal.getContainer().clientWidth - parseFloat(containerStyles.paddingLeft) - parseFloat(containerStyles.paddingRight)) + parseInt( + Swal.getContainer().clientWidth - + parseFloat(containerStyles.paddingLeft) - + parseFloat(containerStyles.paddingRight) + ) ) expect(Swal.getPopup().clientHeight).to.equal( diff --git a/cypress/integration/params/html.spec.js b/cypress/integration/params/html.spec.js index 382ceafff..a581cc1f3 100644 --- a/cypress/integration/params/html.spec.js +++ b/cypress/integration/params/html.spec.js @@ -9,7 +9,7 @@ describe('html', () => { form.appendChild(div) Swal.fire({ - html: form + html: form, }) expect(Swal.getHtmlContainer().innerHTML).to.equal('
') }) @@ -19,7 +19,7 @@ describe('html', () => { error.message = 'something is broken' Swal.fire({ - html: error + html: error, }) expect(Swal.getHtmlContainer().innerHTML).to.equal('Error: something is broken') }) diff --git a/cypress/integration/params/icon.spec.js b/cypress/integration/params/icon.spec.js index a2394f0a6..c8623ac12 100644 --- a/cypress/integration/params/icon.spec.js +++ b/cypress/integration/params/icon.spec.js @@ -1,4 +1,5 @@ -import { Swal, SwalWithoutAnimation, isVisible, isHidden } from '../../utils' +import { isVisible } from '../../../src/utils/dom' +import { Swal, SwalWithoutAnimation, isHidden } from '../../utils' import { iconTypes, swalClasses } from '../../../src/utils/classes' describe('icon', () => { @@ -12,9 +13,13 @@ describe('icon', () => { it('should throw console error about invalid icon', () => { const spy = cy.spy(console, 'error') Swal.fire({ - icon: 'invalid-icon' + icon: 'invalid-icon', }) - expect(spy.calledWith('SweetAlert2: Unknown icon! Expected "success", "error", "warning", "info" or "question", got "invalid-icon"')).to.be.true + expect( + spy.calledWith( + 'SweetAlert2: Unknown icon! Expected "success", "error", "warning", "info" or "question", got "invalid-icon"' + ) + ).to.be.true // should behave the same way as empty object would be passed expect(isVisible(Swal.getConfirmButton())).to.be.true @@ -27,7 +32,7 @@ describe('icon', () => { it('Success icon with custom HTML (iconHtml)', () => { Swal.fire({ icon: 'success', - iconHtml: '' + iconHtml: '', }) expect(Swal.getIcon().innerHTML).to.equal('
') diff --git a/cypress/integration/params/image.spec.js b/cypress/integration/params/image.spec.js index f458a8b10..fa771dda0 100644 --- a/cypress/integration/params/image.spec.js +++ b/cypress/integration/params/image.spec.js @@ -5,7 +5,7 @@ describe('image', () => { Swal.fire({ imageUrl: 'https://sweetalert2.github.io/images/swal2-logo.png', imageWidth: 498, - imageHeight: 84 + imageHeight: 84, }) expect(Swal.getImage().src).to.equal('https://sweetalert2.github.io/images/swal2-logo.png') expect(Swal.getImage().style.width).to.equal('498px') @@ -16,7 +16,7 @@ describe('image', () => { Swal.fire({ imageUrl: 'https://sweetalert2.github.io/images/swal2-logo.png', imageWidth: '50%', - imageHeight: '3em' + imageHeight: '3em', }) expect(Swal.getImage().style.width).to.equal('50%') expect(Swal.getImage().style.height).to.equal('3em') diff --git a/cypress/integration/params/inputValue.spec.js b/cypress/integration/params/inputValue.spec.js index 7fd79d2f2..a10ad54f0 100644 --- a/cypress/integration/params/inputValue.spec.js +++ b/cypress/integration/params/inputValue.spec.js @@ -10,14 +10,14 @@ describe('inputValue', () => { Swal.fire({ input: 'text', inputValue: { - toPromise: () => Promise.resolve('test') + toPromise: () => Promise.resolve('test'), }, didOpen: () => { setTimeout(() => { expect(Swal.getInput().value).to.equal('test') done() }, TIMEOUT) - } + }, }) }) @@ -29,7 +29,7 @@ describe('inputValue', () => { resolve('1.1 input value') }) - function showPopupWithInput () { + function showPopupWithInput() { const input = inputTypes.pop() SwalWithoutAnimation.fire({ input, @@ -43,7 +43,7 @@ describe('inputValue', () => { done() } }, TIMEOUT) - } + }, }) } showPopupWithInput() @@ -62,14 +62,18 @@ describe('inputValue', () => { expect(spy.calledWith('SweetAlert2: Error in inputValue promise: Error: input promise rejected')).to.be.true done() }, TIMEOUT) - } + }, }) }) it('should throw console warning about unexpected type of inputValue', () => { const spy = cy.spy(console, 'warn') Swal.fire({ input: 'text', inputValue: undefined }) - expect(spy.calledWith('SweetAlert2: Unexpected type of inputValue! Expected "string", "number" or "Promise", got "undefined"')).to.be.true + expect( + spy.calledWith( + 'SweetAlert2: Unexpected type of inputValue! Expected "string", "number" or "Promise", got "undefined"' + ) + ).to.be.true }) it('inputValue can be null', () => { diff --git a/cypress/integration/params/position.spec.js b/cypress/integration/params/position.spec.js index c5edca6d5..d3f94b734 100644 --- a/cypress/integration/params/position.spec.js +++ b/cypress/integration/params/position.spec.js @@ -1,14 +1,16 @@ import { Swal, SwalWithoutAnimation } from '../../utils' class PositionChecker { - constructor (container, offset) { + constructor(container, offset) { this._offset = offset - this._containerTop = (container === window ? 0 : container.offsetTop) - this._containerCenter = (container === window) ? window.innerHeight / 2 : container.offsetTop + container.clientHeight / 2 - this._containerBottom = (container === window) ? window.innerHeight : container.offsetTop + container.clientHeight - this._containerLeft = (container === window ? 0 : container.offsetLeft) - this._containerMiddle = (container === window) ? window.innerWidth / 2 : container.offsetLeft + container.clientWidth / 2 - this._containerRight = (container === window) ? window.innerWidth : container.offsetLeft + container.clientWidth + this._containerTop = container === window ? 0 : container.offsetTop + this._containerCenter = + container === window ? window.innerHeight / 2 : container.offsetTop + container.clientHeight / 2 + this._containerBottom = container === window ? window.innerHeight : container.offsetTop + container.clientHeight + this._containerLeft = container === window ? 0 : container.offsetLeft + this._containerMiddle = + container === window ? window.innerWidth / 2 : container.offsetLeft + container.clientWidth / 2 + this._containerRight = container === window ? window.innerWidth : container.offsetLeft + container.clientWidth this._checkFunctions = { top: this.isTop.bind(this), @@ -16,37 +18,37 @@ class PositionChecker { bottom: this.isBottom.bind(this), left: this.isLeft.bind(this), middle: this.isMiddle.bind(this), - right: this.isRight.bind(this) + right: this.isRight.bind(this), } } - isTop (clientRect) { - return (Math.abs(clientRect.top - (this._containerTop + this._offset)) < 1) + isTop(clientRect) { + return Math.abs(clientRect.top - (this._containerTop + this._offset)) < 1 } - isCenter (clientRect) { - const rectCenter = clientRect.top + (clientRect.height / 2) - return (Math.abs(rectCenter - this._containerCenter) < 1) + isCenter(clientRect) { + const rectCenter = clientRect.top + clientRect.height / 2 + return Math.abs(rectCenter - this._containerCenter) < 1 } - isBottom (clientRect) { - return (Math.abs(clientRect.bottom - (this._containerBottom - this._offset)) < 1) + isBottom(clientRect) { + return Math.abs(clientRect.bottom - (this._containerBottom - this._offset)) < 1 } - isLeft (clientRect) { - return (Math.abs(clientRect.left - (this._containerLeft + this._offset)) < 1) + isLeft(clientRect) { + return Math.abs(clientRect.left - (this._containerLeft + this._offset)) < 1 } - isMiddle (clientRect) { - const clientMiddle = clientRect.left + (clientRect.width / 2) - return (Math.abs(clientMiddle - this._containerMiddle) < 1) + isMiddle(clientRect) { + const clientMiddle = clientRect.left + clientRect.width / 2 + return Math.abs(clientMiddle - this._containerMiddle) < 1 } - isRight (clientRect) { - return (Math.abs(clientRect.right - (this._containerRight - this._offset)) < 1) + isRight(clientRect) { + return Math.abs(clientRect.right - (this._containerRight - this._offset)) < 1 } - check (pos, clientRect) { + check(pos, clientRect) { const verPos = pos.split('-')[0] const horPos = pos.split('-')[1] || 'middle' return this._checkFunctions[verPos](clientRect) && this._checkFunctions[horPos](clientRect) @@ -54,9 +56,15 @@ class PositionChecker { } const allowedPostions = [ - 'top-left', 'top', 'top-right', - 'center-left', 'center', 'center-right', - 'bottom-left', 'bottom', 'bottom-right' + 'top-left', + 'top', + 'top-right', + 'center-left', + 'center', + 'center-right', + 'bottom-left', + 'bottom', + 'bottom-right', ] describe('position', () => { @@ -65,10 +73,13 @@ describe('position', () => { const checkPosition = new PositionChecker(window, 10) - allowedPostions.forEach(position => { + allowedPostions.forEach((position) => { SwalWithoutAnimation.fire({ position: position }) const swalRect = document.querySelector('.swal2-popup').getBoundingClientRect() - expect(checkPosition.check(position, swalRect), `modal position: ${position} \n Swal: (${swalRect.top}, ${swalRect.right}, ${swalRect.bottom}, ${swalRect.left})x(${swalRect.height}, ${swalRect.width})\n Window: (${window.innerHeight} ${window.innerWidth})`).to.be.true + expect( + checkPosition.check(position, swalRect), + `modal position: ${position} \n Swal: (${swalRect.top}, ${swalRect.right}, ${swalRect.bottom}, ${swalRect.left})x(${swalRect.height}, ${swalRect.width})\n Window: (${window.innerHeight} ${window.innerWidth})` + ).to.be.true Swal.close() }) }) @@ -78,10 +89,13 @@ describe('position', () => { const checkPosition = new PositionChecker(window, 0) - allowedPostions.forEach(position => { + allowedPostions.forEach((position) => { SwalWithoutAnimation.fire({ toast: 'true', position: position }) const swalRect = document.querySelector('.swal2-container').getBoundingClientRect() - expect(checkPosition.check(position, swalRect), `toast position:: ${position} \n Swal: (${swalRect.top}, ${swalRect.right}, ${swalRect.bottom}, ${swalRect.left})x(${swalRect.height}, ${swalRect.width})\n Window: (${window.innerHeight} ${window.innerWidth})`).to.be.true + expect( + checkPosition.check(position, swalRect), + `toast position:: ${position} \n Swal: (${swalRect.top}, ${swalRect.right}, ${swalRect.bottom}, ${swalRect.left})x(${swalRect.height}, ${swalRect.width})\n Window: (${window.innerHeight} ${window.innerWidth})` + ).to.be.true Swal.close() }) }) @@ -104,10 +118,17 @@ describe('position', () => { const checkPosition = new PositionChecker(dummyTargetElement, 10) - allowedPostions.forEach(position => { - SwalWithoutAnimation.fire({ target: '#dummy-target', customClass: { container: 'position-absolute' }, position: position }) + allowedPostions.forEach((position) => { + SwalWithoutAnimation.fire({ + target: '#dummy-target', + customClass: { container: 'position-absolute' }, + position: position, + }) const swalRect = document.querySelector('.swal2-popup').getBoundingClientRect() - expect(checkPosition.check(position, swalRect), `modal position with target: ${position} \n Swal: (${swalRect.top}, ${swalRect.right}, ${swalRect.bottom}, ${swalRect.left})x(${swalRect.height}, ${swalRect.width})`).to.be.true + expect( + checkPosition.check(position, swalRect), + `modal position with target: ${position} \n Swal: (${swalRect.top}, ${swalRect.right}, ${swalRect.bottom}, ${swalRect.left})x(${swalRect.height}, ${swalRect.width})` + ).to.be.true Swal.close() }) @@ -130,10 +151,18 @@ describe('position', () => { const checkPosition = new PositionChecker(dummyTargetElement, 0) - allowedPostions.forEach(position => { - SwalWithoutAnimation.fire({ target: '#dummy-target', customClass: { container: 'position-absolute' }, toast: 'true', position: position }) + allowedPostions.forEach((position) => { + SwalWithoutAnimation.fire({ + target: '#dummy-target', + customClass: { container: 'position-absolute' }, + toast: 'true', + position: position, + }) const swalRect = document.querySelector('.swal2-container').getBoundingClientRect() - expect(checkPosition.check(position, swalRect), `toast position with target: ${position}\n Swal: (${swalRect.top}, ${swalRect.right}, ${swalRect.bottom}, ${swalRect.left})x(${swalRect.height}, ${swalRect.width})`).to.be.true + expect( + checkPosition.check(position, swalRect), + `toast position with target: ${position}\n Swal: (${swalRect.top}, ${swalRect.right}, ${swalRect.bottom}, ${swalRect.left})x(${swalRect.height}, ${swalRect.width})` + ).to.be.true Swal.close() }) diff --git a/cypress/integration/params/preConfirm.spec.js b/cypress/integration/params/preConfirm.spec.js index 3c34de920..184077104 100644 --- a/cypress/integration/params/preConfirm.spec.js +++ b/cypress/integration/params/preConfirm.spec.js @@ -12,7 +12,7 @@ describe('preConfirm', () => { it('preConfirm custom value', (done) => { SwalWithoutAnimation.fire({ preConfirm: () => 'Some data from preConfirm', - }).then(result => { + }).then((result) => { expect(result.value).to.equal('Some data from preConfirm') done() }) @@ -22,7 +22,7 @@ describe('preConfirm', () => { it('preConfirm returns 0', (done) => { SwalWithoutAnimation.fire({ preConfirm: () => 0, - }).then(result => { + }).then((result) => { expect(result.value).to.equal(0) done() }) @@ -33,9 +33,9 @@ describe('preConfirm', () => { SwalWithoutAnimation.fire({ didOpen: () => Swal.clickConfirm(), preConfirm: () => ({ - toPromise: () => Promise.resolve(0) - }) - }).then(result => { + toPromise: () => Promise.resolve(0), + }), + }).then((result) => { expect(result.value).to.equal(0) done() }) @@ -48,13 +48,15 @@ describe('preConfirm', () => { preConfirm: () => { return Promise.reject(new Error(errorMsg)) }, - }).then(() => { - thenTriggered = true - }).catch(result => { - expect(thenTriggered).to.equal(false) - expect(result.message).to.equal(errorMsg) - done() }) + .then(() => { + thenTriggered = true + }) + .catch((result) => { + expect(thenTriggered).to.equal(false) + expect(result.message).to.equal(errorMsg) + done() + }) Swal.clickConfirm() expect(Swal.isVisible()).to.be.true }) @@ -70,18 +72,20 @@ describe('preConfirm', () => { }, didOpen: () => { Swal.clickConfirm() - } + }, }).then(() => { thenTriggered = true }) - } - }).then(() => { - thenTriggered = true - }).catch(result => { - expect(thenTriggered).to.equal(false) - expect(result.message).to.equal(errorMsg) - done() + }, }) + .then(() => { + thenTriggered = true + }) + .catch((result) => { + expect(thenTriggered).to.equal(false) + expect(result.message).to.equal(errorMsg) + done() + }) Swal.clickConfirm() expect(Swal.isVisible()).to.be.true }) diff --git a/cypress/integration/params/preDeny.spec.js b/cypress/integration/params/preDeny.spec.js index 36d79587c..0291ba5e2 100644 --- a/cypress/integration/params/preDeny.spec.js +++ b/cypress/integration/params/preDeny.spec.js @@ -7,7 +7,7 @@ describe('preDeny', () => { preDeny: (value) => { expect(value).to.be.false return false - } + }, }) Swal.clickDeny() expect(Swal.isVisible()).to.be.true @@ -20,7 +20,7 @@ describe('preDeny', () => { inputValue: 'Initial input value', returnInputValueOnDeny: true, preDeny: (value) => `${value} + Some data from preDeny`, - }).then(result => { + }).then((result) => { expect(result.value).to.equal('Initial input value + Some data from preDeny') done() }) @@ -31,7 +31,7 @@ describe('preDeny', () => { SwalWithoutAnimation.fire({ showDenyButton: true, preDeny: () => 0, - }).then(result => { + }).then((result) => { expect(result.value).to.equal(0) done() }) @@ -43,9 +43,9 @@ describe('preDeny', () => { showDenyButton: true, didOpen: () => Swal.clickDeny(), preDeny: () => ({ - toPromise: () => Promise.resolve(0) - }) - }).then(result => { + toPromise: () => Promise.resolve(0), + }), + }).then((result) => { expect(result.value).to.equal(0) done() }) @@ -58,13 +58,15 @@ describe('preDeny', () => { preDeny: () => { return Promise.reject(new Error(errorMsg)) }, - }).then(() => { - thenTriggered = true - }).catch(result => { - expect(thenTriggered).to.equal(false) - expect(result.message).to.equal(errorMsg) - done() }) + .then(() => { + thenTriggered = true + }) + .catch((result) => { + expect(thenTriggered).to.equal(false) + expect(result.message).to.equal(errorMsg) + done() + }) Swal.clickDeny() expect(Swal.isVisible()).to.be.true }) @@ -80,18 +82,20 @@ describe('preDeny', () => { }, didOpen: () => { Swal.clickDeny() - } + }, }).then(() => { thenTriggered = true }) - } - }).then(() => { - thenTriggered = true - }).catch(result => { - expect(thenTriggered).to.equal(false) - expect(result.message).to.equal(errorMsg) - done() + }, }) + .then(() => { + thenTriggered = true + }) + .catch((result) => { + expect(thenTriggered).to.equal(false) + expect(result.message).to.equal(errorMsg) + done() + }) Swal.clickDeny() expect(Swal.isVisible()).to.be.true }) diff --git a/cypress/integration/params/progressSteps.spec.js b/cypress/integration/params/progressSteps.spec.js index 2ae31f16a..b5323f739 100644 --- a/cypress/integration/params/progressSteps.spec.js +++ b/cypress/integration/params/progressSteps.spec.js @@ -6,9 +6,11 @@ describe('progressSteps', () => { progressSteps: ['1', '2', '3'], currentProgressStep: 0, didOpen: () => { - expect(Swal.getProgressSteps().querySelector('.swal2-progress-step').classList.contains('swal2-active-progress-step')).to.be.true + expect( + Swal.getProgressSteps().querySelector('.swal2-progress-step').classList.contains('swal2-active-progress-step') + ).to.be.true done() - } + }, }) }) }) diff --git a/cypress/integration/params/showClass.spec.js b/cypress/integration/params/showClass.spec.js index c81a535dd..c9863cdc4 100644 --- a/cypress/integration/params/showClass.spec.js +++ b/cypress/integration/params/showClass.spec.js @@ -5,15 +5,15 @@ describe('showClass', () => { Swal.fire({ title: 'Custom animation with Animate.css', showClass: { - popup: 'animated fadeInDown faster' + popup: 'animated fadeInDown faster', }, hideClass: { - popup: 'animated fadeOutUp faster' + popup: 'animated fadeOutUp faster', }, didClose: () => { expect(Swal.isVisible()).to.be.false done() - } + }, }) Swal.close() }) diff --git a/cypress/integration/params/stopKeydownPropagation.spec.js b/cypress/integration/params/stopKeydownPropagation.spec.js index 878eb6f60..6d6431ad0 100644 --- a/cypress/integration/params/stopKeydownPropagation.spec.js +++ b/cypress/integration/params/stopKeydownPropagation.spec.js @@ -10,7 +10,7 @@ describe('progressSteps', () => { SwalWithoutAnimation.fire({ title: 'Esc me and I will propagate keydown', didOpen: () => triggerKeydownEvent(SwalWithoutAnimation.getPopup(), 'Escape'), - stopKeydownPropagation: false + stopKeydownPropagation: false, }) }) }) diff --git a/cypress/integration/params/template.spec.js b/cypress/integration/params/template.spec.js index 297e95d6a..c63819b0c 100644 --- a/cypress/integration/params/template.spec.js +++ b/cypress/integration/params/template.spec.js @@ -1,4 +1,5 @@ -import { $, Swal, SwalWithoutAnimation, isVisible, isHidden } from '../../utils' +import { isVisible } from '../../../src/utils/dom' +import { $, Swal, SwalWithoutAnimation, isHidden } from '../../utils' describe('template', () => { it('template as HTMLTemplateElement', () => { @@ -89,8 +90,26 @@ describe('template', () => { expect(Swal.getInput().type).to.equal('text') expect(spy.callCount).to.equal(4) expect(spy.getCall(0).calledWith(`SweetAlert2: Unrecognized element `)).to.be.true - expect(spy.getCall(1).calledWith(`SweetAlert2: Unrecognized attribute "foo" on . Allowed attributes are: src, width, height, alt`)).to.be.true - expect(spy.getCall(2).calledWith(`SweetAlert2: Unrecognized attribute "bar" on . Allowed attributes are: type, label, placeholder, value`)).to.be.true - expect(spy.getCall(3).calledWith(`SweetAlert2: Unrecognized attribute "value" on . To set the value, use HTML within the element.`)).to.be.true + expect( + spy + .getCall(1) + .calledWith( + `SweetAlert2: Unrecognized attribute "foo" on . Allowed attributes are: src, width, height, alt` + ) + ).to.be.true + expect( + spy + .getCall(2) + .calledWith( + `SweetAlert2: Unrecognized attribute "bar" on . Allowed attributes are: type, label, placeholder, value` + ) + ).to.be.true + expect( + spy + .getCall(3) + .calledWith( + `SweetAlert2: Unrecognized attribute "value" on . To set the value, use HTML within the element.` + ) + ).to.be.true }) }) diff --git a/cypress/integration/params/validationMessage.spec.js b/cypress/integration/params/validationMessage.spec.js index 6f1e59acb..5524eb291 100644 --- a/cypress/integration/params/validationMessage.spec.js +++ b/cypress/integration/params/validationMessage.spec.js @@ -1,10 +1,11 @@ -import { Swal, SwalWithoutAnimation, isVisible, TIMEOUT } from '../../utils' +import { isVisible } from '../../../src/utils/dom' +import { Swal, SwalWithoutAnimation, TIMEOUT } from '../../utils' describe('validationMessage', () => { it('input: email + validationMessage', (done) => { SwalWithoutAnimation.fire({ input: 'email', - validationMessage: 'custom email validation message' + validationMessage: 'custom email validation message', }) Swal.clickConfirm() setTimeout(() => { @@ -17,7 +18,7 @@ describe('validationMessage', () => { it('input: url + validationMessage', (done) => { SwalWithoutAnimation.fire({ input: 'url', - validationMessage: 'custom url validation message' + validationMessage: 'custom url validation message', }) Swal.clickConfirm() setTimeout(() => { diff --git a/cypress/integration/scrollbar.spec.js b/cypress/integration/scrollbar.spec.js index 286f8ea8c..0abe86ca2 100644 --- a/cypress/integration/scrollbar.spec.js +++ b/cypress/integration/scrollbar.spec.js @@ -1,6 +1,6 @@ import { Swal, SwalWithoutAnimation, ensureClosed } from '../utils' import { measureScrollbar } from '../../src/utils/dom/measureScrollbar' -const { SHOW_CLASS_TIMEOUT } = require('../../src/utils/openPopup') +import { SHOW_CLASS_TIMEOUT } from '../../src/utils/openPopup' describe('Vertical scrollbar', () => { it('should be visible on container and it should be scrolled to top', (done) => { @@ -15,7 +15,7 @@ describe('Vertical scrollbar', () => { Swal.close() done() }, SHOW_CLASS_TIMEOUT) - } + }, }) }) @@ -34,7 +34,7 @@ describe('Vertical scrollbar', () => { expect(bodyStyles.paddingRight).to.equal('30px') document.body.removeChild(talltDiv) done() - } + }, }) const bodyStyles = window.getComputedStyle(document.body) @@ -54,7 +54,7 @@ describe('Vertical scrollbar', () => { scrollbarPadding: false, didClose: () => { document.body.removeChild(talltDiv) - } + }, }) const bodyStyles = window.getComputedStyle(document.body) @@ -69,7 +69,7 @@ describe('Vertical scrollbar', () => { document.body.style.paddingRight = '30px' SwalWithoutAnimation.fire({ - title: 'The body has visible scrollbar, I will hide it and adjust padding-right on body' + title: 'The body has visible scrollbar, I will hide it and adjust padding-right on body', }).then(() => { Swal.fire({ text: 'Body padding-right should be restored', @@ -78,7 +78,7 @@ describe('Vertical scrollbar', () => { expect(bodyStyles.paddingRight).to.equal('30px') document.body.removeChild(talltDiv) done() - } + }, }) }) diff --git a/cypress/integration/tests.spec.js b/cypress/integration/tests.spec.js index 1bcf53e6e..873adf79c 100644 --- a/cypress/integration/tests.spec.js +++ b/cypress/integration/tests.spec.js @@ -1,7 +1,9 @@ import jQuery from 'jquery' import Swal from '../../src/sweetalert2' import { SHOW_CLASS_TIMEOUT } from '../../src/utils/openPopup' -import { $, isHidden, isVisible, SwalWithoutAnimation, triggerKeydownEvent, dispatchCustomEvent } from '../utils' +import { $, isHidden, SwalWithoutAnimation, triggerKeydownEvent, dispatchCustomEvent } from '../utils' +import { isVisible } from '../../src/utils/dom' +import { defaultParams } from '../../src/utils/params' describe('Miscellaneous tests', function () { it('version is correct semver', () => { @@ -27,7 +29,8 @@ describe('Miscellaneous tests', function () { it('should throw console error about unexpected params', () => { const spy = cy.spy(console, 'error') Swal.fire('Hello world!', { icon: 'success' }) - expect(spy.calledWith('SweetAlert2: Unexpected type of html! Expected "string" or "Element", got object')).to.be.true + expect(spy.calledWith('SweetAlert2: Unexpected type of html! Expected "string" or "Element", got object')).to.be + .true }) it('should not throw console error about undefined params and treat them as empty strings', () => { @@ -76,13 +79,13 @@ describe('Miscellaneous tests', function () { Swal.fire({ title: 'I am modeless and should not set .swal2-height-auto', - backdrop: false + backdrop: false, }) expect(document.documentElement.classList.contains('swal2-height-auto')).to.be.true Swal.fire({ title: 'I am toast and should not set .swal2-height-auto', - toast: true + toast: true, }) expect(document.documentElement.classList.contains('swal2-height-auto')).to.be.true }) @@ -102,7 +105,7 @@ describe('Miscellaneous tests', function () { denyButtonAriaLabel: 'Deny button aria-label', cancelButtonText: 'Cancel button', cancelButtonAriaLabel: 'Cancel button aria-label', - footer: 'Footer' + footer: 'Footer', }) expect(Swal.getImage().src.includes('/assets/swal2-logo.png')).to.be.true expect(Swal.getActions().textContent).to.equal('Confirm buttonDeny buttonCancel button') @@ -122,8 +125,8 @@ describe('Miscellaneous tests', function () { input: 'radio', inputOptions: { one: 'one', - two: 'two' - } + two: 'two', + }, }) $('.swal2-radio input[value="two"]').setAttribute('checked', true) expect(Swal.getInput().value).to.equal('two') @@ -132,7 +135,7 @@ describe('Miscellaneous tests', function () { it('content/title is set (html)', () => { Swal.fire({ title: 'Strong, Emphasis', - html: '

Paragraph

' + html: '

Paragraph

', }) expect(Swal.getTitle().querySelectorAll('strong, em').length).to.equal(2) @@ -143,11 +146,13 @@ describe('Miscellaneous tests', function () { it('content/title is set (text)', () => { Swal.fire({ titleText: 'Strong, Emphasis', - text: '

Paragraph

' + text: '

Paragraph

', }) expect(Swal.getTitle().innerHTML, '<strong>Strong</strong>).to.equal(<em>Emphasis</em>') - expect(Swal.getHtmlContainer().innerHTML).to.equal('<p>Paragraph</p><img /><button></button>') + expect(Swal.getHtmlContainer().innerHTML).to.equal( + '<p>Paragraph</p><img /><button></button>' + ) expect(Swal.getTitle().querySelectorAll('strong, em').length).to.equal(0) expect(Swal.getHtmlContainer().querySelectorAll('p, img, button').length).to.equal(0) }) @@ -156,7 +161,7 @@ describe('Miscellaneous tests', function () { const p = document.createElement('p') p.textContent = 'js element' Swal.fire({ - html: p + html: p, }) expect(Swal.getHtmlContainer().innerHTML).to.equal('

js element

') }) @@ -180,7 +185,7 @@ describe('Miscellaneous tests', function () { text: 'Modal with reversed buttons', showCancelButton: true, showDenyButton: true, - reverseButtons: true + reverseButtons: true, }) expect(Swal.getConfirmButton().previousSibling).to.equal(Swal.getDenyButton()) expect(Swal.getDenyButton().previousSibling).to.equal(Swal.getCancelButton()) @@ -193,11 +198,12 @@ describe('Miscellaneous tests', function () { it('modal vertical offset', (done) => { // create a modal with dynamic-height content SwalWithoutAnimation.fire({ - imageUrl: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGNikAQAACIAHF/uBd8AAAAASUVORK5CYII=', + imageUrl: + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGNikAQAACIAHF/uBd8AAAAASUVORK5CYII=', title: 'Title', html: '

Text content

', icon: 'warning', - input: 'text' + input: 'text', }) // listen for image load @@ -217,7 +223,7 @@ describe('Miscellaneous tests', function () { didOpen: (modal) => { expect(Swal.getPopup()).to.equal(modal) done() - } + }, }) }) @@ -228,7 +234,7 @@ describe('Miscellaneous tests', function () { willOpen: (modal) => { expect(Swal.isVisible()).to.be.false expect(Swal.getPopup()).to.equal(modal) - } + }, }) // check that willOpen calls properly @@ -241,7 +247,7 @@ describe('Miscellaneous tests', function () { didOpen: () => { expect(Swal.getTitle().innerHTML).to.equal(dynamicTitle) done() - } + }, }) }) @@ -252,7 +258,7 @@ describe('Miscellaneous tests', function () { // the didRender hook should be called once here Swal.fire({ title: 'didRender test', - didRender + didRender, }) expect(didRender.calledOnce).to.be.true @@ -280,7 +286,7 @@ describe('Miscellaneous tests', function () { expect(willCloseFinished).to.be.true expect(Swal.getContainer()).to.be.null done() - } + }, }) Swal.getCloseButton().click() @@ -292,13 +298,13 @@ describe('Miscellaneous tests', function () { title: '1', didDestroy: () => { firstPopupDestroyed = true - } + }, }) Swal.fire({ title: '2', didDestroy: () => { done() - } + }, }) expect(firstPopupDestroyed).to.be.true Swal.getConfirmButton().click() @@ -312,7 +318,7 @@ describe('Miscellaneous tests', function () { expect(modal).to.equal(_modal) expect(Swal.getContainer()).to.equal($('.swal2-container')) done() - } + }, }) const modal = Swal.getPopup() @@ -327,10 +333,10 @@ describe('Miscellaneous tests', function () { text: 'WillClose', input: 'text', customClass: { - input: 'on-close-swal' - } + input: 'on-close-swal', + }, }) - } + }, }).then(() => { expect(Swal.isVisible()).to.be.true expect(Swal.getInput().classList.contains('on-close-swal')).to.be.true @@ -347,7 +353,7 @@ describe('Miscellaneous tests', function () { SwalWithoutAnimation.fire({ title: 'Esc me', - didOpen: () => triggerKeydownEvent(Swal.getPopup(), 'Escape') + didOpen: () => triggerKeydownEvent(Swal.getPopup(), 'Escape'), }).then((result) => { expect(result).to.eql({ dismiss: Swal.DismissReason.esc, @@ -379,14 +385,14 @@ describe('Miscellaneous tests', function () { done() }) - } + }, }) }) it('close button', (done) => { Swal.fire({ title: 'Close button test', - showCloseButton: true + showCloseButton: true, }).then((result) => { expect(result).to.eql({ dismiss: Swal.DismissReason.close, @@ -407,7 +413,7 @@ describe('Miscellaneous tests', function () { Swal.fire({ title: 'Customized Close button test', showCloseButton: true, - closeButtonHtml: 'c' + closeButtonHtml: 'c', }) const closeButton = Swal.getCloseButton() @@ -416,7 +422,7 @@ describe('Miscellaneous tests', function () { it('cancel button', (done) => { Swal.fire({ - showCancelButton: true + showCancelButton: true, }).then((result) => { expect(result).to.eql({ dismiss: Swal.DismissReason.cancel, @@ -432,7 +438,7 @@ describe('Miscellaneous tests', function () { it('deny button', (done) => { Swal.fire({ - showDenyButton: true + showDenyButton: true, }).then((result) => { expect(result).to.eql({ value: false, @@ -449,7 +455,7 @@ describe('Miscellaneous tests', function () { it('timer', (done) => { SwalWithoutAnimation.fire({ title: 'Timer test', - timer: 10 + timer: 10, }).then((result) => { expect(result).to.eql({ dismiss: Swal.DismissReason.timer, @@ -489,7 +495,7 @@ describe('Miscellaneous tests', function () { background: 'red', confirmButtonColor: 'green', denyButtonColor: 'red', - cancelButtonColor: 'blue' + cancelButtonColor: 'blue', }) expect(Swal.getPopup().style.padding).to.equal('2em') @@ -500,9 +506,8 @@ describe('Miscellaneous tests', function () { }) it('null values', () => { - const defaultParams = require('../../src/utils/params').default const params = {} - Object.keys(defaultParams).forEach(key => { + Object.keys(defaultParams).forEach((key) => { params[key] = null }) Swal.fire(params) @@ -512,21 +517,21 @@ describe('Miscellaneous tests', function () { it('backdrop accepts css background param', () => { Swal.fire({ title: 'I have no backdrop', - backdrop: false + backdrop: false, }) expect(Swal.getContainer().style.background).to.equal('') const backdrop = 'rgb(123, 123, 123)' Swal.fire({ title: 'I have a custom backdrop', - backdrop + backdrop, }) expect(Swal.getContainer().style.background.includes(backdrop)).to.be.true }) it('Popup shows with swal2 classes used in html', (done) => { Swal.fire({ - html: '' + html: '', }) setTimeout(() => { expect(Swal.getPopup().classList.contains('swal2-show')).to.be.true @@ -537,10 +542,7 @@ describe('Miscellaneous tests', function () { describe('JQuery', () => { it('jQuery elements as shorthand params', () => { - Swal.fire( - jQuery('

jQuery title

'), - jQuery('

jQuery content

') - ) + Swal.fire(jQuery('

jQuery title

'), jQuery('

jQuery content

')) expect(Swal.getTitle().innerHTML).to.equal('

jQuery title

') expect(Swal.getHtmlContainer().innerHTML).to.equal('

jQuery content

') }) @@ -549,7 +551,7 @@ describe('JQuery', () => { Swal.fire({ title: jQuery('

jQuery title

'), html: jQuery('

jQuery content

'), - footer: jQuery('
jQuery footer
') + footer: jQuery('
jQuery footer
'), }) expect(Swal.getTitle().innerHTML).to.equal('

jQuery title

') expect(Swal.getHtmlContainer().innerHTML).to.equal('

jQuery content

') @@ -559,11 +561,7 @@ describe('JQuery', () => { describe('Outside click', () => { const simulateMouseEvent = (x, y, eventType) => { - dispatchCustomEvent( - document.elementFromPoint(x, y), - eventType, - { clientX: x, clientY: y } - ) + dispatchCustomEvent(document.elementFromPoint(x, y), eventType, { clientX: x, clientY: y }) } it('backdrop click', (done) => { @@ -583,7 +581,7 @@ describe('Outside click', () => { const didClose = cy.spy() Swal.fire({ title: 'didClose should be triggered once', - didClose + didClose, }) Swal.getContainer().click() Swal.getContainer().click() diff --git a/cypress/integration/toast.spec.js b/cypress/integration/toast.spec.js index 781dfd173..de107191c 100644 --- a/cypress/integration/toast.spec.js +++ b/cypress/integration/toast.spec.js @@ -18,7 +18,7 @@ describe('Toast', () => { const spy = cy.spy(console, 'warn') Toast.fire({ - allowOutsideClick: true + allowOutsideClick: true, }) expect(spy.calledWith('SweetAlert2: The parameter "allowOutsideClick" is incompatible with toasts')).to.be.true @@ -27,7 +27,7 @@ describe('Toast', () => { it('toast click closes when no buttons or input are specified', (done) => { Toast.fire({ - showConfirmButton: false + showConfirmButton: false, }).then((result) => { expect(result).to.eql({ dismiss: Toast.DismissReason.close, @@ -43,7 +43,7 @@ describe('Toast', () => { it('toast click does not close if cancel button is present', (done) => { ToastWithoutAnimation.fire({ showConfirmButton: false, - showCancelButton: true + showCancelButton: true, }) Toast.getPopup().click() setTimeout(() => { @@ -56,7 +56,7 @@ describe('Toast', () => { ToastWithoutAnimation.fire({ showConfirmButton: false, showCancelButton: false, - input: 'text' + input: 'text', }) Toast.getPopup().click() setTimeout(() => { @@ -74,7 +74,7 @@ describe('Toast', () => { expect(document.body.classList.contains('swal2-shown')).to.be.false expect(document.body.classList.contains('swal2-toast-shown')).to.be.false done() - } + }, }) }) diff --git a/cypress/utils.js b/cypress/utils.js index d1a6d669b..882ea7366 100644 --- a/cypress/utils.js +++ b/cypress/utils.js @@ -1,11 +1,10 @@ import Swal from '../src/sweetalert2' +import { isVisible } from '../src/utils/dom' export { default as Swal } from '../src/sweetalert2' export const $ = document.querySelector.bind(document) -export const { isVisible } = require('../src/utils/dom/domUtils.js') - export const isHidden = (elem) => !isVisible(elem) export const TIMEOUT = 10 @@ -15,17 +14,21 @@ export const SwalWithoutAnimation = Swal.mixin({ showClass: { container: '', popup: '', - icon: '' + icon: '', }, hideClass: { container: '', popup: '', - icon: '' - } + icon: '', + }, }) export const dispatchCustomEvent = (elem, eventName, eventDetail = {}) => { - const event = new CustomEvent(eventName, { bubbles: true, cancelable: true, detail: eventDetail }) + const event = new CustomEvent(eventName, { + bubbles: true, + cancelable: true, + detail: eventDetail, + }) elem.dispatchEvent(event) } diff --git a/gulpfile.js b/gulpfile.js index 4b9abf9d9..428e81cbe 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,3 +1,4 @@ +/* eslint @typescript-eslint/no-var-requires: 0 */ const gulp = require('gulp') const rollup = require('gulp-rollup') const gulpif = require('gulp-if') @@ -36,16 +37,18 @@ gulp.task('clean', () => { fs.mkdirSync('dist') } - return fs.promises.readdir('dist') - .then(fileList => { + return fs.promises + .readdir('dist') + .then((fileList) => { if (fileList.length > 0) { const unlinkPromises = [] - fileList.forEach(fileName => { + fileList.forEach((fileName) => { unlinkPromises.push(fs.promises.unlink(`dist/${fileName}`)) }) return Promise.all(unlinkPromises) } - }).catch(error => { + }) + .catch((error) => { if (error.code !== 'ENOENT') { return Promise.reject(error) } @@ -53,31 +56,34 @@ gulp.task('clean', () => { }) gulp.task('build:scripts', () => { - return gulp.src(['package.json', ...srcScriptFiles]) - .pipe(rollup({ - plugins: [ - json(), - babel({ - exclude: 'node_modules/**' - }) - ], - input: 'src/sweetalert2.js', - output: { - format: 'umd', - name: 'Sweetalert2', - banner: banner, - footer: `\ + return gulp + .src(['package.json', ...srcScriptFiles]) + .pipe( + rollup({ + plugins: [ + json(), + babel({ + exclude: 'node_modules/**', + }), + ], + input: 'src/sweetalert2.js', + output: { + format: 'umd', + name: 'Sweetalert2', + banner: banner, + footer: `\ if (typeof this !== 'undefined' && this.Sweetalert2){\ this.swal = this.sweetAlert = this.Swal = this.SweetAlert = this.Sweetalert2\ -}` - }, - // https://github.com/rollup/rollup/issues/2271 - onwarn (warning, rollupWarn) { - if (warning.code !== 'CIRCULAR_DEPENDENCY' && warning.code !== 'THIS_IS_UNDEFINED') { - rollupWarn(warning) - } - }, - })) +}`, + }, + // https://github.com/rollup/rollup/issues/2271 + onwarn(warning, rollupWarn) { + if (warning.code !== 'CIRCULAR_DEPENDENCY' && warning.code !== 'THIS_IS_UNDEFINED') { + rollupWarn(warning) + } + }, + }) + ) .on('error', (error) => { if (continueOnError) { log(error) @@ -95,7 +101,8 @@ gulp.task('build:styles', () => { const result = sass.renderSync({ file: 'src/sweetalert2.scss' }) fs.writeFileSync('dist/sweetalert2.css', result.css) - return gulp.src('dist/sweetalert2.css') + return gulp + .src('dist/sweetalert2.css') .pipe(autoprefixer()) .pipe(gulp.dest('dist')) .pipe(gulpif(!skipMinification, cleanCss())) @@ -108,55 +115,47 @@ gulp.task('build:styles', () => { */ gulp.task('build:standalone', () => { const prettyJs = gulp.src('dist/sweetalert2.js') - const prettyCssAsJs = gulp.src('dist/sweetalert2.min.css') - .pipe(css2js()) - const prettyStandalone = merge(prettyJs, prettyCssAsJs) - .pipe(concat('sweetalert2.all.js')) - .pipe(gulp.dest('dist')) + const prettyCssAsJs = gulp.src('dist/sweetalert2.min.css').pipe(css2js()) + const prettyStandalone = merge(prettyJs, prettyCssAsJs).pipe(concat('sweetalert2.all.js')).pipe(gulp.dest('dist')) if (skipMinification) { return prettyStandalone } else { const uglyJs = gulp.src('dist/sweetalert2.min.js') - const uglyCssAsJs = gulp.src('dist/sweetalert2.min.css') - .pipe(css2js()) - const uglyStandalone = merge(uglyJs, uglyCssAsJs) - .pipe(concat('sweetalert2.all.min.js')) - .pipe(gulp.dest('dist')) + const uglyCssAsJs = gulp.src('dist/sweetalert2.min.css').pipe(css2js()) + const uglyStandalone = merge(uglyJs, uglyCssAsJs).pipe(concat('sweetalert2.all.min.js')).pipe(gulp.dest('dist')) return merge([prettyStandalone, uglyStandalone]) } }) -gulp.task('build', gulp.series( - 'clean', - gulp.parallel('build:scripts', 'build:styles'), - ...(skipStandalone ? [] : ['build:standalone']) -)) +gulp.task( + 'build', + gulp.series('clean', gulp.parallel('build:scripts', 'build:styles'), ...(skipStandalone ? [] : ['build:standalone'])) +) gulp.task('default', gulp.parallel('build')) // --- -gulp.task('develop', gulp.series( - 'build', - async function watch () { - // Does not rebuild standalone files, for speed in active development - gulp.watch(srcScriptFiles, gulp.parallel('build:scripts')) - gulp.watch(srcStyleFiles, gulp.parallel('build:styles')) - }, - async function sandbox () { - browserSync.init({ - port: 8080, - uiPort: 8081, - notify: false, - reloadOnRestart: true, - https: false, - server: ['./'], - startPath: 'test/sandbox.html' - }) - gulp.watch([ - 'test/sandbox.html', - 'dist/sweetalert2.js', - 'dist/sweetalert2.css' - ]).on('change', browserSync.reload) - }, -)) +gulp.task( + 'develop', + gulp.series( + 'build', + async function watch() { + // Does not rebuild standalone files, for speed in active development + gulp.watch(srcScriptFiles, gulp.parallel('build:scripts')) + gulp.watch(srcStyleFiles, gulp.parallel('build:styles')) + }, + async function sandbox() { + browserSync.init({ + port: 8080, + uiPort: 8081, + notify: false, + reloadOnRestart: true, + https: false, + server: ['./'], + startPath: 'test/sandbox.html', + }) + gulp.watch(['test/sandbox.html', 'dist/sweetalert2.js', 'dist/sweetalert2.css']).on('change', browserSync.reload) + } + ) +) diff --git a/package.json b/package.json index ea09a3738..7412385c7 100644 --- a/package.json +++ b/package.json @@ -14,12 +14,14 @@ "@rollup/plugin-json": "^4.0.2", "@sweetalert2/eslint-config": "^1.0.11", "@sweetalert2/execute": "^1.0.0", + "@sweetalert2/prettier-config": "^1.0.0", "@sweetalert2/stylelint-config": "^2.0.6", "browser-sync": "^2.27.7", "cspell": "^5.15.1", "cypress": "^9.2.0", "eslint": "^8.7.0", "eslint-plugin-cypress": "^2.12.1", + "eslint-plugin-import": "^2.25.4", "eslint-plugin-no-unsanitized": "^4.0.1", "gulp": "^4.0.0", "gulp-autoprefixer": "^8.0.0", @@ -33,6 +35,7 @@ "jquery": "^3.6.0", "merge2": "^1.2.3", "postcss-scss": "^4.0.2", + "prettier": "^2.5.1", "replace-in-file": "^6.3.2", "rollup": "^2.64.0", "rollup-plugin-babel": "^4.3.2", @@ -76,7 +79,7 @@ ], "scripts": { "start": "gulp develop --continue-on-error --skip-minification --skip-standalone", - "lint": "stylelint src/**/*.scss && eslint src test cypress tools *.js *.ts && cspell lint 'src/**/*.js' --no-progress --no-summary", + "lint": "stylelint src/**/*.scss && eslint src test cypress tools *.js *.ts && prettier --check src/**/*.js cypress/**/*.js test/**/*.{js,ts} tools/**/*.js *.js && cspell lint 'src/**/*.js' --no-progress --no-summary", "build": "gulp build", "test": "cypress run --headless", "check-types": "tsc --noEmit -p jsconfig.json", diff --git a/release.config.js b/release.config.js index ff9d9d17e..ef8ae7e86 100644 --- a/release.config.js +++ b/release.config.js @@ -1,15 +1,11 @@ module.exports = { debug: true, branch: 'master', - verifyConditions: [ - '@semantic-release/changelog', - '@semantic-release/npm', - '@semantic-release/github', - ], + verifyConditions: ['@semantic-release/changelog', '@semantic-release/npm', '@semantic-release/github'], prepare: [ { path: '@semantic-release/exec', - cmd: 'VERSION=${nextRelease.version} node tools/build-dist' // eslint-disable-line no-template-curly-in-string + cmd: 'VERSION=${nextRelease.version} node tools/build-dist', // eslint-disable-line no-template-curly-in-string }, '@semantic-release/changelog', '@semantic-release/npm', @@ -17,22 +13,25 @@ module.exports = { ], publish: [ '@semantic-release/npm', - ['@semantic-release/github', { - 'assets': [ - { 'path': 'dist/sweetalert2.all.js' }, - { 'path': 'dist/sweetalert2.all.min.js' }, - { 'path': 'dist/sweetalert2.css' }, - { 'path': 'dist/sweetalert2.js' }, - { 'path': 'dist/sweetalert2.min.css' }, - { 'path': 'dist/sweetalert2.min.js' }, - ] - }], + [ + '@semantic-release/github', + { + assets: [ + { path: 'dist/sweetalert2.all.js' }, + { path: 'dist/sweetalert2.all.min.js' }, + { path: 'dist/sweetalert2.css' }, + { path: 'dist/sweetalert2.js' }, + { path: 'dist/sweetalert2.min.css' }, + { path: 'dist/sweetalert2.min.js' }, + ], + }, + ], ], success: [ '@semantic-release/github', { path: '@semantic-release/exec', - cmd: 'node tools/purge-jsdelivr' + cmd: 'node tools/purge-jsdelivr', }, - ] + ], } diff --git a/src/SweetAlert.js b/src/SweetAlert.js index af29a8a9a..023986b83 100644 --- a/src/SweetAlert.js +++ b/src/SweetAlert.js @@ -20,7 +20,7 @@ import globalState from './globalState.js' let currentInstance class SweetAlert { - constructor (...args) { + constructor(...args) { // Prevent run in Node env if (typeof window === 'undefined') { return @@ -36,8 +36,8 @@ class SweetAlert { value: outerParams, writable: false, enumerable: true, - configurable: true - } + configurable: true, + }, }) // @ts-ignore @@ -45,7 +45,7 @@ class SweetAlert { privateProps.promise.set(this, promise) } - _main (userParams, mixinParams = {}) { + _main(userParams, mixinParams = {}) { showWarningsForParams(Object.assign({}, mixinParams, userParams)) if (globalState.currentInstance) { @@ -79,12 +79,12 @@ class SweetAlert { } // `catch` cannot be the name of a module export, so we define our thenable methods here instead - then (onFulfilled) { + then(onFulfilled) { const promise = privateProps.promise.get(this) return promise.then(onFulfilled) } - finally (onFinally) { + finally(onFinally) { const promise = privateProps.promise.get(this) return promise.finally(onFinally) } @@ -144,7 +144,7 @@ const populateDomCache = (instance) => { loader: dom.getLoader(), closeButton: dom.getCloseButton(), validationMessage: dom.getValidationMessage(), - progressSteps: dom.getProgressSteps() + progressSteps: dom.getProgressSteps(), } privateProps.domCache.set(instance, domCache) @@ -162,7 +162,8 @@ const setupTimer = (globalState, innerParams, dismissWith) => { if (innerParams.timerProgressBar) { dom.show(timerProgressBar) setTimeout(() => { - if (globalState.timeout && globalState.timeout.running) { // timer can be already stopped or unset at this point + if (globalState.timeout && globalState.timeout.running) { + // timer can be already stopped or unset at this point dom.animateTimerProgressBar(innerParams.timer) } }) @@ -216,7 +217,7 @@ Object.assign(SweetAlert.prototype, instanceMethods) Object.assign(SweetAlert, staticMethods) // Proxy to instance methods to constructor, for now, for backwards compatibility -Object.keys(instanceMethods).forEach(key => { +Object.keys(instanceMethods).forEach((key) => { SweetAlert[key] = function (...args) { if (currentInstance) { return currentInstance[key](...args) diff --git a/src/buttons-handlers.js b/src/buttons-handlers.js index 0b1dd47d1..0d2d185de 100644 --- a/src/buttons-handlers.js +++ b/src/buttons-handlers.js @@ -34,7 +34,9 @@ export const handleCancelButtonClick = (instance, dismissWith) => { const handleConfirmOrDenyWithInput = (instance, type /* 'confirm' | 'deny' */) => { const innerParams = privateProps.innerParams.get(instance) if (!innerParams.input) { - return error(`The "input" parameter is needed to be set when using returnInputValueOn${capitalizeFirstLetter(type)}`) + return error( + `The "input" parameter is needed to be set when using returnInputValueOn${capitalizeFirstLetter(type)}` + ) } const inputValue = getInputValue(instance, innerParams) if (innerParams.inputValidator) { @@ -52,22 +54,20 @@ const handleConfirmOrDenyWithInput = (instance, type /* 'confirm' | 'deny' */) = const handleInputValidator = (instance, inputValue, type /* 'confirm' | 'deny' */) => { const innerParams = privateProps.innerParams.get(instance) instance.disableInput() - const validationPromise = Promise.resolve().then(() => asPromise( - innerParams.inputValidator(inputValue, innerParams.validationMessage)) + const validationPromise = Promise.resolve().then(() => + asPromise(innerParams.inputValidator(inputValue, innerParams.validationMessage)) ) - validationPromise.then( - (validationMessage) => { - instance.enableButtons() - instance.enableInput() - if (validationMessage) { - instance.showValidationMessage(validationMessage) - } else if (type === 'deny') { - deny(instance, inputValue) - } else { - confirm(instance, inputValue) - } + validationPromise.then((validationMessage) => { + instance.enableButtons() + instance.enableInput() + if (validationMessage) { + instance.showValidationMessage(validationMessage) + } else if (type === 'deny') { + deny(instance, inputValue) + } else { + confirm(instance, inputValue) } - ) + }) } const deny = (instance, value) => { @@ -79,18 +79,18 @@ const deny = (instance, value) => { if (innerParams.preDeny) { privateProps.awaitingPromise.set(instance || this, true) // Flagging the instance as awaiting a promise so it's own promise's reject/resolve methods doesn't get destroyed until the result from this preDeny's promise is received - const preDenyPromise = Promise.resolve().then(() => asPromise( - innerParams.preDeny(value, innerParams.validationMessage)) + const preDenyPromise = Promise.resolve().then(() => + asPromise(innerParams.preDeny(value, innerParams.validationMessage)) ) - preDenyPromise.then( - (preDenyValue) => { + preDenyPromise + .then((preDenyValue) => { if (preDenyValue === false) { instance.hideLoading() } else { instance.closePopup({ isDenied: true, value: typeof preDenyValue === 'undefined' ? value : preDenyValue }) } - } - ).catch((error) => rejectWith(instance || this, error)) + }) + .catch((error) => rejectWith(instance || this, error)) } else { instance.closePopup({ isDenied: true, value }) } @@ -114,18 +114,18 @@ const confirm = (instance, value) => { if (innerParams.preConfirm) { instance.resetValidationMessage() privateProps.awaitingPromise.set(instance || this, true) // Flagging the instance as awaiting a promise so it's own promise's reject/resolve methods doesn't get destroyed until the result from this preConfirm's promise is received - const preConfirmPromise = Promise.resolve().then(() => asPromise( - innerParams.preConfirm(value, innerParams.validationMessage)) + const preConfirmPromise = Promise.resolve().then(() => + asPromise(innerParams.preConfirm(value, innerParams.validationMessage)) ) - preConfirmPromise.then( - (preConfirmValue) => { + preConfirmPromise + .then((preConfirmValue) => { if (isVisible(getValidationMessage()) || preConfirmValue === false) { instance.hideLoading() } else { succeedWith(instance, typeof preConfirmValue === 'undefined' ? value : preConfirmValue) } - } - ).catch((error) => rejectWith(instance || this, error)) + }) + .catch((error) => rejectWith(instance || this, error)) } else { succeedWith(instance, value) } diff --git a/src/globalState.js b/src/globalState.js index a9572b2f4..85e93b7b1 100644 --- a/src/globalState.js +++ b/src/globalState.js @@ -15,7 +15,7 @@ const focusPreviousActiveElement = () => { // Restore previous active (focused) element export const restoreActiveElement = (returnFocus) => { - return new Promise(resolve => { + return new Promise((resolve) => { if (!returnFocus) { return resolve() } diff --git a/src/instanceMethods/_destroy.js b/src/instanceMethods/_destroy.js index c0429d0ac..548031d40 100644 --- a/src/instanceMethods/_destroy.js +++ b/src/instanceMethods/_destroy.js @@ -2,7 +2,7 @@ import globalState from '../globalState.js' import privateProps from '../privateProps.js' import privateMethods from '../privateMethods.js' -export function _destroy () { +export function _destroy() { const domCache = privateProps.domCache.get(this) const innerParams = privateProps.innerParams.get(this) diff --git a/src/instanceMethods/close.js b/src/instanceMethods/close.js index abccbeb5b..bae6671bb 100644 --- a/src/instanceMethods/close.js +++ b/src/instanceMethods/close.js @@ -11,12 +11,14 @@ import privateMethods from '../privateMethods.js' * Instance method to close sweetAlert */ -function removePopupAndResetState (instance, container, returnFocus, didClose) { +function removePopupAndResetState(instance, container, returnFocus, didClose) { if (dom.isToast()) { triggerDidCloseAndDispose(instance, didClose) } else { restoreActiveElement(returnFocus).then(() => triggerDidCloseAndDispose(instance, didClose)) - globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { capture: globalState.keydownListenerCapture }) + globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { + capture: globalState.keydownListenerCapture, + }) globalState.keydownHandlerAdded = false } @@ -40,19 +42,14 @@ function removePopupAndResetState (instance, container, returnFocus, didClose) { removeBodyClasses() } -function removeBodyClasses () { +function removeBodyClasses() { dom.removeClass( [document.documentElement, document.body], - [ - swalClasses.shown, - swalClasses['height-auto'], - swalClasses['no-backdrop'], - swalClasses['toast-shown'], - ] + [swalClasses.shown, swalClasses['height-auto'], swalClasses['no-backdrop'], swalClasses['toast-shown']] ) } -export function close (resolveValue) { +export function close(resolveValue) { resolveValue = prepareResolveValue(resolveValue) const swalPromiseResolve = privateMethods.swalPromiseResolve.get(this) @@ -71,7 +68,7 @@ export function close (resolveValue) { } } -export function isAwaitingPromise () { +export function isAwaitingPromise() { return !!privateProps.awaitingPromise.get(this) } @@ -99,7 +96,7 @@ const triggerClosePopup = (instance) => { return true } -export function rejectPromise (error) { +export function rejectPromise(error) { const rejectPromise = privateMethods.swalPromiseReject.get(this) handleAwaitingPromise(this) if (rejectPromise) { @@ -128,11 +125,14 @@ const prepareResolveValue = (resolveValue) => { } } - return Object.assign({ - isConfirmed: false, - isDenied: false, - isDismissed: false, - }, resolveValue) + return Object.assign( + { + isConfirmed: false, + isDenied: false, + isDismissed: false, + }, + resolveValue + ) } const handlePopupAnimation = (instance, popup, innerParams) => { @@ -153,7 +153,13 @@ const handlePopupAnimation = (instance, popup, innerParams) => { } const animatePopup = (instance, popup, container, returnFocus, didClose) => { - globalState.swalCloseEventFinishedCallback = removePopupAndResetState.bind(null, instance, container, returnFocus, didClose) + globalState.swalCloseEventFinishedCallback = removePopupAndResetState.bind( + null, + instance, + container, + returnFocus, + didClose + ) popup.addEventListener(dom.animationEndEvent, function (e) { if (e.target === popup) { globalState.swalCloseEventFinishedCallback() @@ -171,8 +177,4 @@ const triggerDidCloseAndDispose = (instance, didClose) => { }) } -export { - close as closePopup, - close as closeModal, - close as closeToast -} +export { close as closePopup, close as closeModal, close as closeToast } diff --git a/src/instanceMethods/enable-disable-elements.js b/src/instanceMethods/enable-disable-elements.js index da4a99cd2..93e5e37a0 100644 --- a/src/instanceMethods/enable-disable-elements.js +++ b/src/instanceMethods/enable-disable-elements.js @@ -1,13 +1,13 @@ import privateProps from '../privateProps.js' -function setButtonsDisabled (instance, buttons, disabled) { +function setButtonsDisabled(instance, buttons, disabled) { const domCache = privateProps.domCache.get(instance) - buttons.forEach(button => { + buttons.forEach((button) => { domCache[button].disabled = disabled }) } -function setInputDisabled (input, disabled) { +function setInputDisabled(input, disabled) { if (!input) { return false } @@ -22,18 +22,18 @@ function setInputDisabled (input, disabled) { } } -export function enableButtons () { +export function enableButtons() { setButtonsDisabled(this, ['confirmButton', 'denyButton', 'cancelButton'], false) } -export function disableButtons () { +export function disableButtons() { setButtonsDisabled(this, ['confirmButton', 'denyButton', 'cancelButton'], true) } -export function enableInput () { +export function enableInput() { return setInputDisabled(this.getInput(), false) } -export function disableInput () { +export function disableInput() { return setInputDisabled(this.getInput(), true) } diff --git a/src/instanceMethods/getInput.js b/src/instanceMethods/getInput.js index 633321765..691d75ee2 100644 --- a/src/instanceMethods/getInput.js +++ b/src/instanceMethods/getInput.js @@ -5,7 +5,7 @@ import privateProps from '../privateProps.js' * Gets the input DOM node, this method works with input parameter. * @returns {HTMLElement | null} */ -export function getInput (instance) { +export function getInput(instance) { const innerParams = privateProps.innerParams.get(instance || this) const domCache = privateProps.domCache.get(instance || this) if (!domCache) { diff --git a/src/instanceMethods/hideLoading.js b/src/instanceMethods/hideLoading.js index a20712940..b33cc40c9 100644 --- a/src/instanceMethods/hideLoading.js +++ b/src/instanceMethods/hideLoading.js @@ -5,7 +5,7 @@ import privateProps from '../privateProps.js' /** * Hides loader and shows back the button which was hidden by .showLoading() */ -function hideLoading () { +function hideLoading() { // do nothing if popup is closed const innerParams = privateProps.innerParams.get(this) if (!innerParams) { @@ -37,7 +37,4 @@ const showRelatedButton = (domCache) => { } } -export { - hideLoading, - hideLoading as disableLoading -} +export { hideLoading, hideLoading as disableLoading } diff --git a/src/instanceMethods/progress-steps.js b/src/instanceMethods/progress-steps.js index 71f7c8510..cd4690027 100644 --- a/src/instanceMethods/progress-steps.js +++ b/src/instanceMethods/progress-steps.js @@ -1,6 +1,6 @@ import privateProps from '../privateProps.js' -export function getProgressSteps () { +export function getProgressSteps() { const domCache = privateProps.domCache.get(this) return domCache.progressSteps } diff --git a/src/instanceMethods/update.js b/src/instanceMethods/update.js index 51bfbaf3c..f4d9e0862 100644 --- a/src/instanceMethods/update.js +++ b/src/instanceMethods/update.js @@ -6,24 +6,17 @@ import { isUpdatableParameter } from '../../src/utils/params.js' /** * Updates popup parameters. */ -export function update (params) { +export function update(params) { const popup = dom.getPopup() const innerParams = privateProps.innerParams.get(this) if (!popup || dom.hasClass(popup, innerParams.hideClass.popup)) { - return warn(`You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.`) + return warn( + `You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.` + ) } - const validUpdatableParams = {} - - // assign valid params from `params` to `defaults` - Object.keys(params).forEach(param => { - if (isUpdatableParameter(param)) { - validUpdatableParams[param] = params[param] - } else { - warn(`Invalid parameter to update: "${param}". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js\n\nIf you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md`) - } - }) + const validUpdatableParams = filterValidParams(params) const updatedParams = Object.assign({}, innerParams, validUpdatableParams) @@ -34,7 +27,21 @@ export function update (params) { params: { value: Object.assign({}, this.params, params), writable: false, - enumerable: true + enumerable: true, + }, + }) +} + +const filterValidParams = (params) => { + const validUpdatableParams = {} + Object.keys(params).forEach((param) => { + if (isUpdatableParameter(param)) { + validUpdatableParams[param] = params[param] + } else { + warn( + `Invalid parameter to update: "${param}". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js\n\nIf you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md` + ) } }) + return validUpdatableParams } diff --git a/src/instanceMethods/validation-message.js b/src/instanceMethods/validation-message.js index ecd7ccb90..a6dfb0edc 100644 --- a/src/instanceMethods/validation-message.js +++ b/src/instanceMethods/validation-message.js @@ -3,7 +3,7 @@ import { swalClasses } from '../utils/classes.js' import privateProps from '../privateProps.js' // Show block with validation message -export function showValidationMessage (error) { +export function showValidationMessage(error) { const domCache = privateProps.domCache.get(this) const params = privateProps.innerParams.get(this) dom.setInnerHtml(domCache.validationMessage, error) @@ -23,7 +23,7 @@ export function showValidationMessage (error) { } // Hide block with validation message -export function resetValidationMessage () { +export function resetValidationMessage() { const domCache = privateProps.domCache.get(this) if (domCache.validationMessage) { dom.hide(domCache.validationMessage) diff --git a/src/keydown-handler.js b/src/keydown-handler.js index c799caa64..1883b2efd 100644 --- a/src/keydown-handler.js +++ b/src/keydown-handler.js @@ -6,7 +6,9 @@ import privateProps from './privateProps.js' export const addKeydownHandler = (instance, globalState, innerParams, dismissWith) => { if (globalState.keydownTarget && globalState.keydownHandlerAdded) { - globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { capture: globalState.keydownListenerCapture }) + globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { + capture: globalState.keydownListenerCapture, + }) globalState.keydownHandlerAdded = false } @@ -14,7 +16,9 @@ export const addKeydownHandler = (instance, globalState, innerParams, dismissWit globalState.keydownHandler = (e) => keydownHandler(instance, e, dismissWith) globalState.keydownTarget = innerParams.keydownListenerCapture ? window : dom.getPopup() globalState.keydownListenerCapture = innerParams.keydownListenerCapture - globalState.keydownTarget.addEventListener('keydown', globalState.keydownHandler, { capture: globalState.keydownListenerCapture }) + globalState.keydownTarget.addEventListener('keydown', globalState.keydownHandler, { + capture: globalState.keydownListenerCapture, + }) globalState.keydownHandlerAdded = true } } @@ -41,13 +45,9 @@ export const setFocus = (innerParams, index, increment) => { dom.getPopup().focus() } -const arrowKeysNextButton = [ - 'ArrowRight', 'ArrowDown', -] +const arrowKeysNextButton = ['ArrowRight', 'ArrowDown'] -const arrowKeysPreviousButton = [ - 'ArrowLeft', 'ArrowUp', -] +const arrowKeysPreviousButton = ['ArrowLeft', 'ArrowUp'] const keydownHandler = (instance, e, dismissWith) => { const innerParams = privateProps.innerParams.get(instance) @@ -63,17 +63,20 @@ const keydownHandler = (instance, e, dismissWith) => { // ENTER if (e.key === 'Enter') { handleEnter(instance, e, innerParams) + } // TAB - } else if (e.key === 'Tab') { + else if (e.key === 'Tab') { handleTab(e, innerParams) + } // ARROWS - switch focus between buttons - } else if ([...arrowKeysNextButton, ...arrowKeysPreviousButton].includes(e.key)) { + else if ([...arrowKeysNextButton, ...arrowKeysPreviousButton].includes(e.key)) { handleArrows(e.key) + } // ESC - } else if (e.key === 'Escape') { + else if (e.key === 'Escape') { handleEsc(e, innerParams, dismissWith) } } @@ -106,13 +109,16 @@ const handleTab = (e, innerParams) => { } } + // Cycle to the next button if (!e.shiftKey) { - // Cycle to the next button setFocus(innerParams, btnIndex, 1) - } else { - // Cycle to the prev button + } + + // Cycle to the prev button + else { setFocus(innerParams, btnIndex, -1) } + e.stopPropagation() e.preventDefault() } diff --git a/src/popup-click-handler.js b/src/popup-click-handler.js index 6446d0aad..78baf5c65 100644 --- a/src/popup-click-handler.js +++ b/src/popup-click-handler.js @@ -34,10 +34,12 @@ const handleToastClick = (instance, domCache, dismissWith) => { * @returns {boolean} */ const isAnyButtonShown = (innerParams) => { - return innerParams.showConfirmButton || + return ( + innerParams.showConfirmButton || innerParams.showDenyButton || innerParams.showCancelButton || innerParams.showCloseButton + ) } let ignoreOutsideClick = false diff --git a/src/privateMethods.js b/src/privateMethods.js index 7731c50d2..0637a2b24 100644 --- a/src/privateMethods.js +++ b/src/privateMethods.js @@ -10,5 +10,5 @@ export default { swalPromiseResolve: new WeakMap(), - swalPromiseReject: new WeakMap() + swalPromiseReject: new WeakMap(), } diff --git a/src/privateProps.js b/src/privateProps.js index f6e892dea..6f671d19c 100644 --- a/src/privateProps.js +++ b/src/privateProps.js @@ -12,5 +12,5 @@ export default { awaitingPromise: new WeakMap(), promise: new WeakMap(), innerParams: new WeakMap(), - domCache: new WeakMap() + domCache: new WeakMap(), } diff --git a/src/staticMethods.js b/src/staticMethods.js index a238882c3..dee0f907e 100644 --- a/src/staticMethods.js +++ b/src/staticMethods.js @@ -5,8 +5,4 @@ export * from './staticMethods/mixin.js' export * from './staticMethods/showLoading.js' export * from './staticMethods/timer.js' export * from './staticMethods/bindClickHandler.js' -export { - isValidParameter, - isUpdatableParameter, - isDeprecatedParameter -} from './utils/params.js' +export { isValidParameter, isUpdatableParameter, isDeprecatedParameter } from './utils/params.js' diff --git a/src/staticMethods/argsToParams.js b/src/staticMethods/argsToParams.js index 1d74ea026..20ff37598 100644 --- a/src/staticMethods/argsToParams.js +++ b/src/staticMethods/argsToParams.js @@ -8,7 +8,7 @@ export const argsToParams = (args) => { if (typeof args[0] === 'object' && !isElement(args[0])) { Object.assign(params, args[0]) } else { - ['title', 'html', 'icon'].forEach((name, index) => { + ;['title', 'html', 'icon'].forEach((name, index) => { const arg = args[index] if (typeof arg === 'string' || isElement(arg)) { params[name] = arg diff --git a/src/staticMethods/bindClickHandler.js b/src/staticMethods/bindClickHandler.js index c03177b54..c721fc621 100644 --- a/src/staticMethods/bindClickHandler.js +++ b/src/staticMethods/bindClickHandler.js @@ -1,7 +1,7 @@ let bodyClickListenerAdded = false const clickHandlers = {} -export function bindClickHandler (attr = 'data-swal-template') { +export function bindClickHandler(attr = 'data-swal-template') { clickHandlers[attr] = this if (!bodyClickListenerAdded) { diff --git a/src/staticMethods/dom.js b/src/staticMethods/dom.js index 6afa09c92..321522c16 100644 --- a/src/staticMethods/dom.js +++ b/src/staticMethods/dom.js @@ -19,7 +19,7 @@ export { getTimerProgressBar, getFocusableElements, getValidationMessage, - isLoading + isLoading, } from '../utils/dom/index.js' /* diff --git a/src/staticMethods/fire.js b/src/staticMethods/fire.js index 5d6182fbe..2a03545cc 100644 --- a/src/staticMethods/fire.js +++ b/src/staticMethods/fire.js @@ -1,4 +1,4 @@ -export function fire (...args) { - const Swal = this +export function fire(...args) { + const Swal = this // eslint-disable-line @typescript-eslint/no-this-alias return new Swal(...args) } diff --git a/src/staticMethods/mixin.js b/src/staticMethods/mixin.js index 7fc4f7ecc..8f4266ee4 100644 --- a/src/staticMethods/mixin.js +++ b/src/staticMethods/mixin.js @@ -16,9 +16,9 @@ * * @param mixinParams */ -export function mixin (mixinParams) { +export function mixin(mixinParams) { class MixinSwal extends this { - _main (params, priorityMixinParams) { + _main(params, priorityMixinParams) { return super._main(params, Object.assign({}, mixinParams, priorityMixinParams)) } } diff --git a/src/staticMethods/showLoading.js b/src/staticMethods/showLoading.js index 581927fbd..9e7869aad 100644 --- a/src/staticMethods/showLoading.js +++ b/src/staticMethods/showLoading.js @@ -43,7 +43,4 @@ const replaceButton = (popup, buttonToReplace) => { dom.addClass([popup, actions], swalClasses.loading) } -export { - showLoading, - showLoading as enableLoading -} +export { showLoading, showLoading as enableLoading } diff --git a/src/utils/DismissReason.js b/src/utils/DismissReason.js index f1467b5ba..cd8a580de 100644 --- a/src/utils/DismissReason.js +++ b/src/utils/DismissReason.js @@ -3,5 +3,5 @@ export const DismissReason = Object.freeze({ backdrop: 'backdrop', close: 'close', esc: 'esc', - timer: 'timer' + timer: 'timer', }) diff --git a/src/utils/Timer.js b/src/utils/Timer.js index b7124f2ab..af341e4bd 100644 --- a/src/utils/Timer.js +++ b/src/utils/Timer.js @@ -1,5 +1,5 @@ export default class Timer { - constructor (callback, delay) { + constructor(callback, delay) { this.callback = callback this.remaining = delay this.running = false @@ -7,7 +7,7 @@ export default class Timer { this.start() } - start () { + start() { if (!this.running) { this.running = true this.started = new Date() @@ -16,7 +16,7 @@ export default class Timer { return this.remaining } - stop () { + stop() { if (this.running) { this.running = false clearTimeout(this.id) @@ -25,7 +25,7 @@ export default class Timer { return this.remaining } - increase (n) { + increase(n) { const running = this.running if (running) { this.stop() @@ -37,7 +37,7 @@ export default class Timer { return this.remaining } - getTimerLeft () { + getTimerLeft() { if (this.running) { this.stop() this.start() @@ -45,7 +45,7 @@ export default class Timer { return this.remaining } - isRunning () { + isRunning() { return this.running } } diff --git a/src/utils/aria.js b/src/utils/aria.js index 038829ba4..a20a501db 100644 --- a/src/utils/aria.js +++ b/src/utils/aria.js @@ -8,7 +8,7 @@ import { toArray } from './utils.js' export const setAriaHidden = () => { const bodyChildren = toArray(document.body.children) - bodyChildren.forEach(el => { + bodyChildren.forEach((el) => { if (el === getContainer() || el.contains(getContainer())) { return } @@ -22,7 +22,7 @@ export const setAriaHidden = () => { export const unsetAriaHidden = () => { const bodyChildren = toArray(document.body.children) - bodyChildren.forEach(el => { + bodyChildren.forEach((el) => { if (el.hasAttribute('data-previous-aria-hidden')) { el.setAttribute('aria-hidden', el.getAttribute('data-previous-aria-hidden')) el.removeAttribute('data-previous-aria-hidden') diff --git a/src/utils/classes.js b/src/utils/classes.js index ee62c2a45..9127f34cf 100644 --- a/src/utils/classes.js +++ b/src/utils/classes.js @@ -80,10 +80,4 @@ export const swalClasses = prefix([ 'icon-error', ]) -export const iconTypes = prefix([ - 'success', - 'warning', - 'info', - 'question', - 'error' -]) +export const iconTypes = prefix(['success', 'warning', 'info', 'question', 'error']) diff --git a/src/utils/defaultInputValidators.js b/src/utils/defaultInputValidators.js index a9b4b8b94..b205b2266 100644 --- a/src/utils/defaultInputValidators.js +++ b/src/utils/defaultInputValidators.js @@ -9,5 +9,5 @@ export default { return /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid URL') - } + }, } diff --git a/src/utils/dom/animationEndEvent.js b/src/utils/dom/animationEndEvent.js index a50e1161d..04e939752 100644 --- a/src/utils/dom/animationEndEvent.js +++ b/src/utils/dom/animationEndEvent.js @@ -10,7 +10,7 @@ export const animationEndEvent = (() => { const testEl = document.createElement('div') const transEndEventNames = { WebkitAnimation: 'webkitAnimationEnd', // Chrome, Safari and Opera - animation: 'animationend' // Standard syntax + animation: 'animationend', // Standard syntax } for (const i in transEndEventNames) { if (Object.prototype.hasOwnProperty.call(transEndEventNames, i) && typeof testEl.style[i] !== 'undefined') { diff --git a/src/utils/dom/domUtils.js b/src/utils/dom/domUtils.js index 66423832a..31a0d2f56 100644 --- a/src/utils/dom/domUtils.js +++ b/src/utils/dom/domUtils.js @@ -4,7 +4,7 @@ import { toArray, warn } from '../utils.js' // Remember state in cases where opening and handling a modal will fiddle with it. export const states = { - previousBodyPadding: null + previousBodyPadding: null, } /** @@ -47,7 +47,7 @@ export const hasClass = (elem, className) => { } const removeCustomClasses = (elem, params) => { - toArray(elem.classList).forEach(className => { + toArray(elem.classList).forEach((className) => { if ( !Object.values(swalClasses).includes(className) && !Object.values(iconTypes).includes(className) && @@ -63,7 +63,11 @@ export const applyCustomClass = (elem, params, className) => { if (params.customClass && params.customClass[className]) { if (typeof params.customClass[className] !== 'string' && !params.customClass[className].forEach) { - return warn(`Invalid type of customClass.${className}! Expected string or iterable object, got "${typeof params.customClass[className]}"`) + return warn( + `Invalid type of customClass.${className}! Expected string or iterable object, got "${typeof params.customClass[ + className + ]}"` + ) } addClass(elem, params.customClass[className]) @@ -87,8 +91,10 @@ export const getInput = (popup, inputType) => { case 'checkbox': return popup.querySelector(`.${swalClasses.popup} > .${swalClasses.checkbox} input`) case 'radio': - return popup.querySelector(`.${swalClasses.popup} > .${swalClasses.radio} input:checked`) || + return ( + popup.querySelector(`.${swalClasses.popup} > .${swalClasses.radio} input:checked`) || popup.querySelector(`.${swalClasses.popup} > .${swalClasses.radio} input:first-child`) + ) case 'range': return popup.querySelector(`.${swalClasses.popup} > .${swalClasses.range} input`) default: @@ -176,7 +182,7 @@ export const applyNumericalStyle = (elem, property, value) => { value = parseInt(value) } if (value || parseInt(value) === 0) { - elem.style[property] = (typeof value === 'number') ? `${value}px` : value + elem.style[property] = typeof value === 'number' ? `${value}px` : value } else { elem.style.removeProperty(property) } @@ -211,7 +217,8 @@ export const toggle = (elem, condition, display) => { // borrowed from jquery $(elem).is(':visible') implementation export const isVisible = (elem) => !!(elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length)) -export const allButtonsAreHidden = () => !isVisible(getConfirmButton()) && !isVisible(getDenyButton()) && !isVisible(getCancelButton()) +export const allButtonsAreHidden = () => + !isVisible(getConfirmButton()) && !isVisible(getDenyButton()) && !isVisible(getCancelButton()) export const isScrollable = (elem) => !!(elem.scrollHeight > elem.clientHeight) @@ -245,7 +252,7 @@ export const stopTimerProgressBar = () => { timerProgressBar.style.removeProperty('transition') timerProgressBar.style.width = '100%' const timerProgressBarFullWidth = parseInt(window.getComputedStyle(timerProgressBar).width) - const timerProgressBarPercent = timerProgressBarWidth / timerProgressBarFullWidth * 100 + const timerProgressBarPercent = (timerProgressBarWidth / timerProgressBarFullWidth) * 100 timerProgressBar.style.removeProperty('transition') timerProgressBar.style.width = `${timerProgressBarPercent}%` } diff --git a/src/utils/dom/getters.js b/src/utils/dom/getters.js index 3f9deda56..2b979ab78 100644 --- a/src/utils/dom/getters.js +++ b/src/utils/dom/getters.js @@ -72,7 +72,7 @@ export const getFocusableElements = () => { const focusableElementsWithTabindex = toArray( getPopup().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])') ) - // sort according to tabindex + // sort according to tabindex .sort((a, b) => { const tabindexA = parseInt(a.getAttribute('tabindex')) const tabindexB = parseInt(b.getAttribute('tabindex')) @@ -84,11 +84,11 @@ export const getFocusableElements = () => { return 0 }) - const otherFocusableElements = toArray( - getPopup().querySelectorAll(focusable) - ).filter(el => el.getAttribute('tabindex') !== '-1') + const otherFocusableElements = toArray(getPopup().querySelectorAll(focusable)).filter( + (el) => el.getAttribute('tabindex') !== '-1' + ) - return uniqueArray(focusableElementsWithTabindex.concat(otherFocusableElements)).filter(el => isVisible(el)) + return uniqueArray(focusableElementsWithTabindex.concat(otherFocusableElements)).filter((el) => isVisible(el)) } export const isModal = () => { diff --git a/src/utils/dom/init.js b/src/utils/dom/init.js index 303c6b7f0..d4fdf2770 100644 --- a/src/utils/dom/init.js +++ b/src/utils/dom/init.js @@ -49,11 +49,7 @@ const resetOldContainer = () => { oldContainer.remove() removeClass( [document.documentElement, document.body], - [ - swalClasses['no-backdrop'], - swalClasses['toast-shown'], - swalClasses['has-column'] - ] + [swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['has-column']] ) return true @@ -91,7 +87,7 @@ const addInputChangeListeners = () => { } } -const getTarget = (target) => typeof target === 'string' ? document.querySelector(target) : target +const getTarget = (target) => (typeof target === 'string' ? document.querySelector(target) : target) const setupAccessibility = (params) => { const popup = getPopup() diff --git a/src/utils/dom/inputUtils.js b/src/utils/dom/inputUtils.js index bbc530a56..2321fab4a 100644 --- a/src/utils/dom/inputUtils.js +++ b/src/utils/dom/inputUtils.js @@ -33,15 +33,17 @@ export const getInputValue = (instance, innerParams) => { } } -const getCheckboxValue = (input) => input.checked ? 1 : 0 +const getCheckboxValue = (input) => (input.checked ? 1 : 0) -const getRadioValue = (input) => input.checked ? input.value : null +const getRadioValue = (input) => (input.checked ? input.value : null) -const getFileValue = (input) => input.files.length ? (input.getAttribute('multiple') !== null ? input.files : input.files[0]) : null +const getFileValue = (input) => + input.files.length ? (input.getAttribute('multiple') !== null ? input.files : input.files[0]) : null const handleInputOptions = (instance, params) => { const popup = dom.getPopup() - const processInputOptions = (inputOptions) => populateInputOptions[params.input](popup, formatInputOptions(inputOptions), params) + const processInputOptions = (inputOptions) => + populateInputOptions[params.input](popup, formatInputOptions(inputOptions), params) if (hasToPromiseFn(params.inputOptions) || isPromise(params.inputOptions)) { showLoading(dom.getConfirmButton()) asPromise(params.inputOptions).then((inputOptions) => { @@ -58,12 +60,13 @@ const handleInputOptions = (instance, params) => { const handleInputValue = (instance, params) => { const input = instance.getInput() dom.hide(input) - asPromise(params.inputValue).then((inputValue) => { - input.value = params.input === 'number' ? parseFloat(inputValue) || 0 : `${inputValue}` - dom.show(input) - input.focus() - instance.hideLoading() - }) + asPromise(params.inputValue) + .then((inputValue) => { + input.value = params.input === 'number' ? parseFloat(inputValue) || 0 : `${inputValue}` + dom.show(input) + input.focus() + instance.hideLoading() + }) .catch((err) => { error(`Error in inputValue promise: ${err}`) input.value = '' @@ -83,20 +86,22 @@ const populateInputOptions = { option.selected = isSelected(optionValue, params.inputValue) parent.appendChild(option) } - inputOptions.forEach(inputOption => { + inputOptions.forEach((inputOption) => { const optionValue = inputOption[0] const optionLabel = inputOption[1] // spec: // https://www.w3.org/TR/html401/interact/forms.html#h-17.6 // "...all OPTGROUP elements must be specified directly within a SELECT element (i.e., groups may not be nested)..." // check whether this is a - if (Array.isArray(optionLabel)) { // if it is an array, then it is an + if (Array.isArray(optionLabel)) { + // if it is an array, then it is an const optgroup = document.createElement('optgroup') optgroup.label = optionValue optgroup.disabled = false // not configurable for now select.appendChild(optgroup) - optionLabel.forEach(o => renderOption(optgroup, o[1], o[0])) - } else { // case of + if (typeof valueFormatted === 'object') { + // case of valueFormatted = formatInputOptions(valueFormatted) } result.push([key, valueFormatted]) }) } else { - Object.keys(inputOptions).forEach(key => { + Object.keys(inputOptions).forEach((key) => { let valueFormatted = inputOptions[key] - if (typeof valueFormatted === 'object') { // case of + if (typeof valueFormatted === 'object') { + // case of valueFormatted = formatInputOptions(valueFormatted) } result.push([key, valueFormatted]) diff --git a/src/utils/dom/parseHtmlToContainer.js b/src/utils/dom/parseHtmlToContainer.js index db2efa017..d7e5707a4 100644 --- a/src/utils/dom/parseHtmlToContainer.js +++ b/src/utils/dom/parseHtmlToContainer.js @@ -1,27 +1,38 @@ import { setInnerHtml } from './domUtils.js' +/** + * @param {HTMLElement | object | string} param + * @param {HTMLElement} target + */ export const parseHtmlToContainer = (param, target) => { // DOM element if (param instanceof HTMLElement) { target.appendChild(param) + } // Object - } else if (typeof param === 'object') { + else if (typeof param === 'object') { handleObject(param, target) + } // Plain string - } else if (param) { + else if (param) { setInnerHtml(target, param) } } +/** + * @param {object} param + * @param {HTMLElement} target + */ const handleObject = (param, target) => { // JQuery element(s) if (param.jquery) { handleJqueryElem(target, param) + } // For other objects use their string representation - } else { + else { setInnerHtml(target, param.toString()) } } diff --git a/src/utils/dom/renderers/renderActions.js b/src/utils/dom/renderers/renderActions.js index 901ee7b2e..288b086df 100644 --- a/src/utils/dom/renderers/renderActions.js +++ b/src/utils/dom/renderers/renderActions.js @@ -24,7 +24,7 @@ export const renderActions = (instance, params) => { dom.applyCustomClass(loader, params, 'loader') } -function renderButtons (actions, loader, params) { +function renderButtons(actions, loader, params) { const confirmButton = dom.getConfirmButton() const denyButton = dom.getDenyButton() const cancelButton = dom.getCancelButton() @@ -47,7 +47,7 @@ function renderButtons (actions, loader, params) { } } -function handleButtonsStyling (confirmButton, denyButton, cancelButton, params) { +function handleButtonsStyling(confirmButton, denyButton, cancelButton, params) { if (!params.buttonsStyling) { return dom.removeClass([confirmButton, denyButton, cancelButton], swalClasses.styled) } @@ -69,7 +69,7 @@ function handleButtonsStyling (confirmButton, denyButton, cancelButton, params) } } -function renderButton (button, buttonType, params) { +function renderButton(button, buttonType, params) { dom.toggle(button, params[`show${capitalizeFirstLetter(buttonType)}Button`], 'inline-block') dom.setInnerHtml(button, params[`${buttonType}ButtonText`]) // Set caption text button.setAttribute('aria-label', params[`${buttonType}ButtonAriaLabel`]) // ARIA label diff --git a/src/utils/dom/renderers/renderContainer.js b/src/utils/dom/renderers/renderContainer.js index 22201e346..59bec4201 100644 --- a/src/utils/dom/renderers/renderContainer.js +++ b/src/utils/dom/renderers/renderContainer.js @@ -2,7 +2,7 @@ import { swalClasses } from '../../classes.js' import { warn } from '../../utils.js' import * as dom from '../../dom/index.js' -function handleBackdropParam (container, backdrop) { +function handleBackdropParam(container, backdrop) { if (typeof backdrop === 'string') { container.style.background = backdrop } else if (!backdrop) { @@ -10,7 +10,7 @@ function handleBackdropParam (container, backdrop) { } } -function handlePositionParam (container, position) { +function handlePositionParam(container, position) { if (position in swalClasses) { dom.addClass(container, swalClasses[position]) } else { @@ -19,7 +19,7 @@ function handlePositionParam (container, position) { } } -function handleGrowParam (container, grow) { +function handleGrowParam(container, grow) { if (grow && typeof grow === 'string') { const growClass = `grow-${grow}` if (growClass in swalClasses) { diff --git a/src/utils/dom/renderers/renderContent.js b/src/utils/dom/renderers/renderContent.js index e8764427c..e81dba6a9 100644 --- a/src/utils/dom/renderers/renderContent.js +++ b/src/utils/dom/renderers/renderContent.js @@ -10,14 +10,16 @@ export const renderContent = (instance, params) => { if (params.html) { dom.parseHtmlToContainer(params.html, htmlContainer) dom.show(htmlContainer, 'block') + } // Content as plain text - } else if (params.text) { + else if (params.text) { htmlContainer.textContent = params.text dom.show(htmlContainer, 'block') + } // No content - } else { + else { dom.hide(htmlContainer) } diff --git a/src/utils/dom/renderers/renderIcon.js b/src/utils/dom/renderers/renderIcon.js index dbaf3418c..eb6eafe81 100644 --- a/src/utils/dom/renderers/renderIcon.js +++ b/src/utils/dom/renderers/renderIcon.js @@ -64,30 +64,34 @@ const adjustSuccessIconBackgroundColor = () => { } } +const successIconHtml = ` +
+ +
+
+` + +const errorIconHtml = ` + + + + +` + const setContent = (icon, params) => { icon.textContent = '' if (params.iconHtml) { dom.setInnerHtml(icon, iconContent(params.iconHtml)) } else if (params.icon === 'success') { - dom.setInnerHtml(icon, ` -
- -
-
- `) + dom.setInnerHtml(icon, successIconHtml) } else if (params.icon === 'error') { - dom.setInnerHtml(icon, ` - - - - - `) + dom.setInnerHtml(icon, errorIconHtml) } else { const defaultIconHtml = { question: '?', warning: '!', - info: 'i' + info: 'i', } dom.setInnerHtml(icon, iconContent(defaultIconHtml[params.icon])) } @@ -99,7 +103,12 @@ const setColor = (icon, params) => { } icon.style.color = params.iconColor icon.style.borderColor = params.iconColor - for (const sel of ['.swal2-success-line-tip', '.swal2-success-line-long', '.swal2-x-mark-line-left', '.swal2-x-mark-line-right']) { + for (const sel of [ + '.swal2-success-line-tip', + '.swal2-success-line-long', + '.swal2-x-mark-line-left', + '.swal2-x-mark-line-right', + ]) { dom.setStyle(icon, sel, 'backgroundColor', params.iconColor) } dom.setStyle(icon, '.swal2-success-ring', 'borderColor', params.iconColor) diff --git a/src/utils/dom/renderers/renderInput.js b/src/utils/dom/renderers/renderInput.js index 1a6a02440..14204cc17 100644 --- a/src/utils/dom/renderers/renderInput.js +++ b/src/utils/dom/renderers/renderInput.js @@ -36,7 +36,9 @@ export const renderInput = (instance, params) => { const showInput = (params) => { if (!renderInputType[params.input]) { - return error(`Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "${params.input}"`) + return error( + `Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "${params.input}"` + ) } const inputContainer = getInputContainer(params.input) @@ -105,21 +107,24 @@ const getInputContainer = (inputType) => { const renderInputType = {} renderInputType.text = -renderInputType.email = -renderInputType.password = -renderInputType.number = -renderInputType.tel = -renderInputType.url = (input, params) => { - if (typeof params.inputValue === 'string' || typeof params.inputValue === 'number') { - input.value = params.inputValue - } else if (!isPromise(params.inputValue)) { - warn(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof params.inputValue}"`) - } - setInputLabel(input, input, params) - setInputPlaceholder(input, params) - input.type = params.input - return input -} + renderInputType.email = + renderInputType.password = + renderInputType.number = + renderInputType.tel = + renderInputType.url = + (input, params) => { + if (typeof params.inputValue === 'string' || typeof params.inputValue === 'number') { + input.value = params.inputValue + } else if (!isPromise(params.inputValue)) { + warn( + `Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof params.inputValue}"` + ) + } + setInputLabel(input, input, params) + setInputPlaceholder(input, params) + input.type = params.input + return input + } renderInputType.file = (input, params) => { setInputLabel(input, input, params) @@ -172,10 +177,13 @@ renderInputType.textarea = (textarea, params) => { setInputPlaceholder(textarea, params) setInputLabel(textarea, textarea, params) - const getMargin = (el) => parseInt(window.getComputedStyle(el).marginLeft) + parseInt(window.getComputedStyle(el).marginRight) + const getMargin = (el) => + parseInt(window.getComputedStyle(el).marginLeft) + parseInt(window.getComputedStyle(el).marginRight) - setTimeout(() => { // #2291 - if ('MutationObserver' in window) { // #1699 + // https://github.com/sweetalert2/sweetalert2/issues/2291 + setTimeout(() => { + // https://github.com/sweetalert2/sweetalert2/issues/1699 + if ('MutationObserver' in window) { const initialPopupWidth = parseInt(window.getComputedStyle(dom.getPopup()).width) const textareaResizeHandler = () => { const textareaWidth = textarea.offsetWidth + getMargin(textarea) @@ -186,7 +194,8 @@ renderInputType.textarea = (textarea, params) => { } } new MutationObserver(textareaResizeHandler).observe(textarea, { - attributes: true, attributeFilter: ['style'] + attributes: true, + attributeFilter: ['style'], }) } }) diff --git a/src/utils/dom/renderers/renderPopup.js b/src/utils/dom/renderers/renderPopup.js index 1c231d15e..bf19b6aac 100644 --- a/src/utils/dom/renderers/renderPopup.js +++ b/src/utils/dom/renderers/renderPopup.js @@ -6,7 +6,8 @@ export const renderPopup = (instance, params) => { const popup = dom.getPopup() // Width - if (params.toast) { // #2170 + // https://github.com/sweetalert2/sweetalert2/issues/2170 + if (params.toast) { dom.applyNumericalStyle(container, 'width', params.width) popup.style.width = '100%' popup.insertBefore(dom.getLoader(), dom.getIcon()) diff --git a/src/utils/dom/renderers/renderProgressSteps.js b/src/utils/dom/renderers/renderProgressSteps.js index 04c8f8957..c53fc0f54 100644 --- a/src/utils/dom/renderers/renderProgressSteps.js +++ b/src/utils/dom/renderers/renderProgressSteps.js @@ -29,7 +29,7 @@ export const renderProgressSteps = (instance, params) => { if (params.currentProgressStep >= params.progressSteps.length) { warn( 'Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + - '(currentProgressStep like JS arrays starts from 0)' + '(currentProgressStep like JS arrays starts from 0)' ) } diff --git a/src/utils/getTemplateParams.js b/src/utils/getTemplateParams.js index 1dc22e5ff..4ef0f85a7 100644 --- a/src/utils/getTemplateParams.js +++ b/src/utils/getTemplateParams.js @@ -19,7 +19,7 @@ export const getTemplateParams = (params) => { getSwalImage(templateContent), getSwalIcon(templateContent), getSwalInput(templateContent), - getSwalStringParams(templateContent, swalStringParams), + getSwalStringParams(templateContent, swalStringParams) ) return result } @@ -188,7 +188,11 @@ const showWarningsForAttributes = (el, allowedAttributes) => { if (allowedAttributes.indexOf(attribute.name) === -1) { warn([ `Unrecognized attribute "${attribute.name}" on <${el.tagName.toLowerCase()}>.`, - `${allowedAttributes.length ? `Allowed attributes are: ${allowedAttributes.join(', ')}` : 'To set the value, use HTML within the element.'}` + `${ + allowedAttributes.length + ? `Allowed attributes are: ${allowedAttributes.join(', ')}` + : 'To set the value, use HTML within the element.' + }`, ]) } }) diff --git a/src/utils/iosFix.js b/src/utils/iosFix.js index d71b52b58..f5531ab97 100644 --- a/src/utils/iosFix.js +++ b/src/utils/iosFix.js @@ -5,8 +5,10 @@ import { swalClasses } from '../utils/classes.js' // Fix iOS scrolling http://stackoverflow.com/q/39626302 export const iOSfix = () => { - // @ts-ignore - const iOS = (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1) + const iOS = + // @ts-ignore + (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) || + (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1) if (iOS && !dom.hasClass(document.body, swalClasses.iosfix)) { const offset = document.body.scrollTop document.body.style.top = `${offset * -1}px` @@ -32,7 +34,10 @@ const addBottomPaddingForTallPopups = () => { } } -const lockBodyScroll = () => { // #1246 +/** + * https://github.com/sweetalert2/sweetalert2/issues/1246 + */ +const lockBodyScroll = () => { const container = dom.getContainer() let preventTouchMove container.ontouchstart = (e) => { @@ -79,7 +84,13 @@ const isStylus = (event) => { return event.touches && event.touches.length && event.touches[0].touchType === 'stylus' } -const isZoom = (event) => { // #1891 +/** + * https://github.com/sweetalert2/sweetalert2/issues/1891 + * + * @param {TouchEvent} event + * @returns {boolean} + */ +const isZoom = (event) => { return event.touches && event.touches.length > 1 } @@ -88,6 +99,6 @@ export const undoIOSfix = () => { const offset = parseInt(document.body.style.top, 10) dom.removeClass(document.body, swalClasses.iosfix) document.body.style.top = '' - document.body.scrollTop = (offset * -1) + document.body.scrollTop = offset * -1 } } diff --git a/src/utils/params.js b/src/utils/params.js index 61802f6e7..c49b93bbc 100644 --- a/src/utils/params.js +++ b/src/utils/params.js @@ -87,7 +87,7 @@ export const defaultParams = { willClose: undefined, didClose: undefined, didDestroy: undefined, - scrollbarPadding: true + scrollbarPadding: true, } export const updatableParams = [ @@ -147,7 +147,7 @@ const toastIncompatibleParams = [ 'focusCancel', 'returnFocus', 'heightAuto', - 'keydownListenerCapture' + 'keydownListenerCapture', ] /** diff --git a/src/utils/setParameters.js b/src/utils/setParameters.js index 908ceb6fc..faf959d7f 100644 --- a/src/utils/setParameters.js +++ b/src/utils/setParameters.js @@ -2,7 +2,7 @@ import { warn } from './utils.js' import * as dom from './dom/index.js' import defaultInputValidators from './defaultInputValidators.js' -function setDefaultInputValidators (params) { +function setDefaultInputValidators(params) { // Use default `inputValidator` for supported input types if not provided if (!params.inputValidator) { Object.keys(defaultInputValidators).forEach((key) => { @@ -13,7 +13,7 @@ function setDefaultInputValidators (params) { } } -function validateCustomTargetElement (params) { +function validateCustomTargetElement(params) { // Determine if the custom target element is valid if ( !params.target || @@ -30,15 +30,15 @@ function validateCustomTargetElement (params) { * * @param params */ -export default function setParameters (params) { +export default function setParameters(params) { setDefaultInputValidators(params) // showLoaderOnConfirm && preConfirm if (params.showLoaderOnConfirm && !params.preConfirm) { warn( 'showLoaderOnConfirm is set to true, but preConfirm is not defined.\n' + - 'showLoaderOnConfirm should be used together with preConfirm, see usage example:\n' + - 'https://sweetalert2.github.io/#ajax-request' + 'showLoaderOnConfirm should be used together with preConfirm, see usage example:\n' + + 'https://sweetalert2.github.io/#ajax-request' ) } diff --git a/src/utils/utils.js b/src/utils/utils.js index 00e8d5577..f5c117def 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -65,7 +65,9 @@ export const warnOnce = (message) => { * Show a one-time console warning about deprecated params/methods */ export const warnAboutDeprecation = (deprecatedParam, useInstead) => { - warnOnce(`"${deprecatedParam}" is deprecated and will be removed in the next major release. Please use "${useInstead}" instead.`) + warnOnce( + `"${deprecatedParam}" is deprecated and will be removed in the next major release. Please use "${useInstead}" instead.` + ) } /** @@ -73,10 +75,10 @@ export const warnAboutDeprecation = (deprecatedParam, useInstead) => { * Otherwise, just pass the value through * @param arg */ -export const callIfFunction = (arg) => typeof arg === 'function' ? arg() : arg +export const callIfFunction = (arg) => (typeof arg === 'function' ? arg() : arg) export const hasToPromiseFn = (arg) => arg && typeof arg.toPromise === 'function' -export const asPromise = (arg) => hasToPromiseFn(arg) ? arg.toPromise() : Promise.resolve(arg) +export const asPromise = (arg) => (hasToPromiseFn(arg) ? arg.toPromise() : Promise.resolve(arg)) export const isPromise = (arg) => arg && Promise.resolve(arg) === arg diff --git a/sweetalert2.code-workspace b/sweetalert2.code-workspace new file mode 100644 index 000000000..16da1af64 --- /dev/null +++ b/sweetalert2.code-workspace @@ -0,0 +1,19 @@ +{ + "settings": { + "editor.formatOnSave": true, + "editor.tabSize": 2, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true, + "source.fixAll.stylelint": true + }, + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "folders": [ + { + "path": "." + } + ], + "extensions": { + "recommendations": ["dbaeumer.vscode-eslint", "stylelint.vscode-stylelint", "esbenp.prettier-vscode"] + } +} diff --git a/test/.eslintrc.js b/test/.eslintrc.js deleted file mode 100644 index 2327986d8..000000000 --- a/test/.eslintrc.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - globals: { - 'beforeAll': false, - 'describe': false, - 'it': false, - 'QUnit': false - }, - rules: { - 'no-unsanitized/property': 0, - } -} diff --git a/tools/build-dist.js b/tools/build-dist.js index 4c4d2b899..e8a93c421 100644 --- a/tools/build-dist.js +++ b/tools/build-dist.js @@ -1,3 +1,4 @@ +/* eslint @typescript-eslint/no-var-requires: 0 */ const pify = require('pify') const rimraf = require('rimraf') const execute = require('@sweetalert2/execute') diff --git a/tools/purge-jsdelivr.js b/tools/purge-jsdelivr.mjs similarity index 70% rename from tools/purge-jsdelivr.js rename to tools/purge-jsdelivr.mjs index 201f49ce3..8f3349e36 100644 --- a/tools/purge-jsdelivr.js +++ b/tools/purge-jsdelivr.mjs @@ -1,7 +1,7 @@ -const execute = require('@sweetalert2/execute') -const fs = require('fs') +import execute from '@sweetalert2/execute' +import fs from 'fs' -const log = console.log // eslint-disable-line +const log = console.log // eslint-disable-line no-console ;(async () => { log(`Purge jsdelivr cache...`) @@ -15,7 +15,9 @@ const log = console.log // eslint-disable-line // dist for (const distFile of distFiles) { log(` - dist/${distFile}`) - await execute(`curl --silent https://purge.jsdelivr.net/npm/sweetalert2${version}/dist/${distFile}`, { skipLogging: true }) + await execute(`curl --silent https://purge.jsdelivr.net/npm/sweetalert2${version}/dist/${distFile}`, { + skipLogging: true, + }) } } diff --git a/yarn.lock b/yarn.lock index 6230527f0..9f077335b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15,19 +15,19 @@ integrity sha512-m7OkX0IdKLKPpBlJtF561YJal5y/jyI5fNfWbPxh2D/nbzzGI4qRyrD8xO2jB24u7l+5I2a43scCG2IrfjC50Q== "@babel/core@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.7.tgz#db990f931f6d40cb9b87a0dc7d2adc749f1dcbcf" - integrity sha512-aeLaqcqThRNZYmbMqtulsetOQZ/5gbR/dWruUCJcpas4Qoyy+QeagfDsPdMrqwsPRDNxJvBlRiZxxX7THO7qtA== + version "7.16.12" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.12.tgz#5edc53c1b71e54881315923ae2aedea2522bb784" + integrity sha512-dK5PtG1uiN2ikk++5OzSYsitZKny4wOCD0nrO4TqnW4BVBTQ2NGS3NgilvT/TEyxTST7LNyWV/T4tXDoD3fOgg== dependencies: "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.16.7" + "@babel/generator" "^7.16.8" "@babel/helper-compilation-targets" "^7.16.7" "@babel/helper-module-transforms" "^7.16.7" "@babel/helpers" "^7.16.7" - "@babel/parser" "^7.16.7" + "@babel/parser" "^7.16.12" "@babel/template" "^7.16.7" - "@babel/traverse" "^7.16.7" - "@babel/types" "^7.16.7" + "@babel/traverse" "^7.16.10" + "@babel/types" "^7.16.8" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -35,7 +35,7 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.16.7", "@babel/generator@^7.16.8": +"@babel/generator@^7.16.8": version "7.16.8" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.8.tgz#359d44d966b8cd059d543250ce79596f792f2ebe" integrity sha512-1ojZwE9+lOXzcWdWmO6TbUzDfqLD39CmEhN8+2cX9XkDo5yW1OpgfejfliysR2AWLpMamTiOiAp/mtroaymhpw== @@ -69,10 +69,10 @@ browserslist "^4.17.5" semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.7.tgz#9c5b34b53a01f2097daf10678d65135c1b9f84ba" - integrity sha512-kIFozAvVfK05DM4EVQYKK+zteWvY85BFdGBRQBytRyY3y+6PX0DkDOn/CZ3lEuczCfrCxEzwt0YtP/87YPTWSw== +"@babel/helper-create-class-features-plugin@^7.16.10", "@babel/helper-create-class-features-plugin@^7.16.7": + version "7.16.10" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.10.tgz#8a6959b9cc818a88815ba3c5474619e9c0f2c21c" + integrity sha512-wDeej0pu3WN/ffTxMNCPW5UCiOav8IcLRxSIyp/9+IF2xJUM9h/OYjg0IJLHaL6F8oU8kqMz9nc1vryXhMsgXg== dependencies: "@babel/helper-annotate-as-pure" "^7.16.7" "@babel/helper-environment-visitor" "^7.16.7" @@ -90,10 +90,10 @@ "@babel/helper-annotate-as-pure" "^7.16.7" regexpu-core "^4.7.1" -"@babel/helper-define-polyfill-provider@^0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.0.tgz#c5b10cf4b324ff840140bb07e05b8564af2ae971" - integrity sha512-7hfT8lUljl/tM3h+izTX/pO3W3frz2ok6Pk+gzys8iJqDfZrZy2pXjRTZAvG2YmfHun1X4q8/UZRLatMfqc5Tg== +"@babel/helper-define-polyfill-provider@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.1.tgz#52411b445bdb2e676869e5a74960d2d3826d2665" + integrity sha512-J9hGMpJQmtWmj46B3kBHmL38UhJGhYX7eqkcq+2gsstyYt341HmPeWspihX43yVRA0mS+8GGk2Gckc7bY/HCmA== dependencies: "@babel/helper-compilation-targets" "^7.13.0" "@babel/helper-module-imports" "^7.12.13" @@ -252,18 +252,18 @@ "@babel/types" "^7.16.7" "@babel/highlight@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.7.tgz#81a01d7d675046f0d96f82450d9d9578bdfd6b0b" - integrity sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw== + version "7.16.10" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88" + integrity sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw== dependencies: "@babel/helper-validator-identifier" "^7.16.7" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.16.7", "@babel/parser@^7.16.8": - version "7.16.8" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.8.tgz#61c243a3875f7d0b0962b0543a33ece6ff2f1f17" - integrity sha512-i7jDUfrVBWc+7OKcBzEe5n7fbv3i2fWtxKzzCvOjnzSxMfWMigAhtfJ7qzZNGFNMsCCd67+uz553dYKWXPvCKw== +"@babel/parser@^7.16.10", "@babel/parser@^7.16.12", "@babel/parser@^7.16.7": + version "7.16.12" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.12.tgz#9474794f9a650cf5e2f892444227f98e28cdf8b6" + integrity sha512-VfaV15po8RiZssrkPweyvbGVSe4x2y+aciFCgn0n0/SJMR22cwofRV1mtnJQYcSB1wUTaA/X1LnA3es66MCO5A== "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.16.7": version "7.16.7" @@ -383,12 +383,12 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-proposal-private-methods@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.7.tgz#e418e3aa6f86edd6d327ce84eff188e479f571e0" - integrity sha512-7twV3pzhrRxSwHeIvFE6coPgvo+exNDOiGUMg39o2LiLo1Y+4aKpfkcLGcg1UHonzorCt7SNXnoMyCnnIOA8Sw== +"@babel/plugin-proposal-private-methods@^7.16.11": + version "7.16.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.11.tgz#e8df108288555ff259f4527dbe84813aac3a1c50" + integrity sha512-F/2uAkPlXDr8+BHpZvo19w3hLFKge+k75XUprE6jaqKxjGkSYcK+4c+bup5PdW/7W/Rpjwql7FTVEDW+fRAQsw== dependencies: - "@babel/helper-create-class-features-plugin" "^7.16.7" + "@babel/helper-create-class-features-plugin" "^7.16.10" "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-proposal-private-property-in-object@^7.16.7": @@ -758,9 +758,9 @@ "@babel/helper-plugin-utils" "^7.16.7" "@babel/preset-env@^7.16.7": - version "7.16.8" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.16.8.tgz#e682fa0bcd1cf49621d64a8956318ddfb9a05af9" - integrity sha512-9rNKgVCdwHb3z1IlbMyft6yIXIeP3xz6vWvGaLHrJThuEIqWfHb0DNBH9VuTgnDfdbUDhkmkvMZS/YMCtP7Elg== + version "7.16.11" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.16.11.tgz#5dd88fd885fae36f88fd7c8342475c9f0abe2982" + integrity sha512-qcmWG8R7ZW6WBRPZK//y+E3Cli151B20W1Rv7ln27vuPaXU/8TKms6jFdiJtF7UDTxcrb7mZd88tAeK9LjdT8g== dependencies: "@babel/compat-data" "^7.16.8" "@babel/helper-compilation-targets" "^7.16.7" @@ -780,7 +780,7 @@ "@babel/plugin-proposal-object-rest-spread" "^7.16.7" "@babel/plugin-proposal-optional-catch-binding" "^7.16.7" "@babel/plugin-proposal-optional-chaining" "^7.16.7" - "@babel/plugin-proposal-private-methods" "^7.16.7" + "@babel/plugin-proposal-private-methods" "^7.16.11" "@babel/plugin-proposal-private-property-in-object" "^7.16.7" "@babel/plugin-proposal-unicode-property-regex" "^7.16.7" "@babel/plugin-syntax-async-generators" "^7.8.4" @@ -864,10 +864,10 @@ "@babel/parser" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/traverse@^7.13.0", "@babel/traverse@^7.16.7", "@babel/traverse@^7.16.8": - version "7.16.8" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.8.tgz#bab2f2b09a5fe8a8d9cad22cbfe3ba1d126fef9c" - integrity sha512-xe+H7JlvKsDQwXRsBhSnq1/+9c+LlQcCK3Tn/l5sbx02HYns/cn7ibp9+RV1sIUqu7hKg91NWsgHurO9dowITQ== +"@babel/traverse@^7.13.0", "@babel/traverse@^7.16.10", "@babel/traverse@^7.16.7", "@babel/traverse@^7.16.8": + version "7.16.10" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.10.tgz#448f940defbe95b5a8029975b051f75993e8239f" + integrity sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw== dependencies: "@babel/code-frame" "^7.16.7" "@babel/generator" "^7.16.8" @@ -875,7 +875,7 @@ "@babel/helper-function-name" "^7.16.7" "@babel/helper-hoist-variables" "^7.16.7" "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.16.8" + "@babel/parser" "^7.16.10" "@babel/types" "^7.16.8" debug "^4.1.0" globals "^11.1.0" @@ -888,10 +888,10 @@ "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" -"@cspell/cspell-bundled-dicts@^5.15.2": - version "5.15.2" - resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-5.15.2.tgz#9cc960084f9e0a9dc07521fd83a1bac4deba9168" - integrity sha512-pzcEwzzqSiwuvpmLaePxI/J3fvrHxvpcKQL2LWbJyI+dvKBP7hW6EJ9rDi2tPbNWN1cabSJB/NCq16ZfJ1P0aA== +"@cspell/cspell-bundled-dicts@^5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-5.16.0.tgz#29bffec623ba2e5b9c06d0ed9649bd0499633259" + integrity sha512-7O8Y6FMzTn5pnHUDjnQJ3cgIAHT5jfN05NKGu9FFikmsXsMmDRikr/OeuhK5tDOWLRIxZwmFrVMMGgBe6mj26Q== dependencies: "@cspell/dict-ada" "^1.1.2" "@cspell/dict-aws" "^1.0.14" @@ -931,10 +931,10 @@ "@cspell/dict-typescript" "^1.0.19" "@cspell/dict-vue" "^2.0.1" -"@cspell/cspell-types@^5.15.2": - version "5.15.2" - resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-5.15.2.tgz#e3c48a5d4acc78c28076a803eb7064a540f3c7b8" - integrity sha512-3ec/rmAIfkxIdOC4lcqBJaGyUX8V2qapzNCntFURo727Q77EPXDFMiWmSDEyD4Xud+Sjt95ktjg5vKgL7Xf0PA== +"@cspell/cspell-types@^5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-5.16.0.tgz#9bc0484f65de93f81d27bfc9b4936ea86eecc0ab" + integrity sha512-pKBeOrUyZtp4DVNbikkpeAT/gob7gT2zun4v3jYdQEbDKYMRN7wTKlqfHJ4VxbF/yS45g7jizEc245xMUkxPHQ== "@cspell/dict-ada@^1.1.2": version "1.1.2" @@ -1255,16 +1255,13 @@ integrity sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ== "@sweetalert2/eslint-config@^1.0.11": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@sweetalert2/eslint-config/-/eslint-config-1.0.11.tgz#4fd312b84e042ef4cfb9d91219902061ffe07e7a" - integrity sha512-874GKMgb4wSkN19cTsU6f86BTESSktdcLVwJR/ZJ7hb31RAI2gh1GOm2Jp8MiYr4X9HcRBoIlLzW+vV8vacq1A== + version "1.0.17" + resolved "https://registry.yarnpkg.com/@sweetalert2/eslint-config/-/eslint-config-1.0.17.tgz#a9971e12cfb0f97c46ff459c3b1c71842562e85d" + integrity sha512-+JjzvTcqg8bmEEoNV/aWeRTcrspmfW+PIn0f+2C/uniMXRqelKC0LzZZLgTxWHyt9RBfBypQdykCRdDMXxW0lQ== dependencies: "@typescript-eslint/eslint-plugin" "^5.0.0" "@typescript-eslint/parser" "^5.0.0" - eslint-config-standard "^16.0.0" - eslint-plugin-import "^2.17.2" - eslint-plugin-node "^11.0.0" - eslint-plugin-promise "^6.0.0" + eslint-config-prettier "^8.3.0" "@sweetalert2/execute@^1.0.0": version "1.0.1" @@ -1273,6 +1270,11 @@ dependencies: execa "^2.0.0" +"@sweetalert2/prettier-config@^1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@sweetalert2/prettier-config/-/prettier-config-1.0.1.tgz#6992ac7a65768e6bbf013b8d6578194ea55267c1" + integrity sha512-8wsVLywp8CSahMYqWQ0Um3ezVKQiPOBBaA9avGODpbnEIfwK+Ow21IyobQ20GvJy8G0LoX2kdwSEuBN6qLAOEw== + "@sweetalert2/stylelint-config@^2.0.6": version "2.0.6" resolved "https://registry.yarnpkg.com/@sweetalert2/stylelint-config/-/stylelint-config-2.0.6.tgz#9acc5554dd44a8de5379406257dcac8b60643c24" @@ -1304,14 +1306,14 @@ integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== "@types/node@*": - version "17.0.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.8.tgz#50d680c8a8a78fe30abe6906453b21ad8ab0ad7b" - integrity sha512-YofkM6fGv4gDJq78g4j0mMuGMkZVxZDgtU0JRdx6FgiJDG+0fY0GKVolOV8WqVmEhLCXkQRjwDdKyPxJp/uucg== + version "17.0.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.10.tgz#616f16e9d3a2a3d618136b1be244315d95bd7cab" + integrity sha512-S/3xB4KzyFxYGCppyDt68yzBU9ysL88lSdIah4D6cptdcltc4NCPCAMc0+PCpg/lLIyC7IPvj2Z52OJWeIUkog== "@types/node@^14.14.31": - version "14.18.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.5.tgz#0dd636fe7b2c6055cbed0d4ca3b7fb540f130a96" - integrity sha512-LMy+vDDcQR48EZdEx5wRX1q/sEl6NdGuHXPnfeL8ixkwCOSZ2qnIyIZmcCbdX0MeRqHhAcHmX+haCbrS8Run+A== + version "14.18.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.9.tgz#0e5944eefe2b287391279a19b407aa98bd14436d" + integrity sha512-j11XSuRuAlft6vLDEX4RvhqC0KxNxx6QIyMXNb0vHHSNPXTPeiy3algESWmOOIzEtiEL0qiowPU3ewW9hHVa7Q== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -1323,10 +1325,10 @@ resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== -"@types/sinonjs__fake-timers@^6.0.2": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.4.tgz#0ecc1b9259b76598ef01942f547904ce61a6a77d" - integrity sha512-IFQTJARgMUBF+xVd2b+hIgXWrZEjND3vJtRCvIelcFB5SIXfjV4bOHbHJ0eXKh+0COrBRc8MqteKAz/j88rE0A== +"@types/sinonjs__fake-timers@8.1.1": + version "8.1.1" + resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz#b49c2c70150141a15e0fa7e79cf1f92a72934ce3" + integrity sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g== "@types/sizzle@^2.3.2": version "2.3.3" @@ -1341,13 +1343,13 @@ "@types/node" "*" "@typescript-eslint/eslint-plugin@^5.0.0": - version "5.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.1.tgz#e5a86d7e1f9dc0b3df1e6d94feaf20dd838d066c" - integrity sha512-Xv9tkFlyD4MQGpJgTo6wqDqGvHIRmRgah/2Sjz1PUnJTawjHWIwBivUE9x0QtU2WVii9baYgavo/bHjrZJkqTw== + version "5.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.0.tgz#e90afea96dff8620892ad216b0e4ccdf8ee32d3a" + integrity sha512-XXVKnMsq2fuu9K2KsIxPUGqb6xAImz8MEChClbXmE3VbveFtBUU5bzM6IPVWqzyADIgdkS2Ws/6Xo7W2TeZWjQ== dependencies: - "@typescript-eslint/experimental-utils" "5.9.1" - "@typescript-eslint/scope-manager" "5.9.1" - "@typescript-eslint/type-utils" "5.9.1" + "@typescript-eslint/scope-manager" "5.10.0" + "@typescript-eslint/type-utils" "5.10.0" + "@typescript-eslint/utils" "5.10.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -1355,69 +1357,69 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@5.9.1": - version "5.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.1.tgz#8c407c4dd5ffe522329df6e4c9c2b52206d5f7f1" - integrity sha512-cb1Njyss0mLL9kLXgS/eEY53SZQ9sT519wpX3i+U457l2UXRDuo87hgKfgRazmu9/tQb0x2sr3Y0yrU+Zz0y+w== - dependencies: - "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.9.1" - "@typescript-eslint/types" "5.9.1" - "@typescript-eslint/typescript-estree" "5.9.1" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" - "@typescript-eslint/parser@^5.0.0": - version "5.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.9.1.tgz#b114011010a87e17b3265ca715e16c76a9834cef" - integrity sha512-PLYO0AmwD6s6n0ZQB5kqPgfvh73p0+VqopQQLuNfi7Lm0EpfKyDalchpVwkE+81k5HeiRrTV/9w1aNHzjD7C4g== + version "5.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.10.0.tgz#8f59e036f5f1cffc178cacbd5ccdd02aeb96c91c" + integrity sha512-pJB2CCeHWtwOAeIxv8CHVGJhI5FNyJAIpx5Pt72YkK3QfEzt6qAlXZuyaBmyfOdM62qU0rbxJzNToPTVeJGrQw== dependencies: - "@typescript-eslint/scope-manager" "5.9.1" - "@typescript-eslint/types" "5.9.1" - "@typescript-eslint/typescript-estree" "5.9.1" + "@typescript-eslint/scope-manager" "5.10.0" + "@typescript-eslint/types" "5.10.0" + "@typescript-eslint/typescript-estree" "5.10.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.9.1": - version "5.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.9.1.tgz#6c27be89f1a9409f284d95dfa08ee3400166fe69" - integrity sha512-8BwvWkho3B/UOtzRyW07ffJXPaLSUKFBjpq8aqsRvu6HdEuzCY57+ffT7QoV4QXJXWSU1+7g3wE4AlgImmQ9pQ== +"@typescript-eslint/scope-manager@5.10.0": + version "5.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.10.0.tgz#bb5d872e8b9e36203908595507fbc4d3105329cb" + integrity sha512-tgNgUgb4MhqK6DoKn3RBhyZ9aJga7EQrw+2/OiDk5hKf3pTVZWyqBi7ukP+Z0iEEDMF5FDa64LqODzlfE4O/Dg== dependencies: - "@typescript-eslint/types" "5.9.1" - "@typescript-eslint/visitor-keys" "5.9.1" + "@typescript-eslint/types" "5.10.0" + "@typescript-eslint/visitor-keys" "5.10.0" -"@typescript-eslint/type-utils@5.9.1": - version "5.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.9.1.tgz#c6832ffe655b9b1fec642d36db1a262d721193de" - integrity sha512-tRSpdBnPRssjlUh35rE9ug5HrUvaB9ntREy7gPXXKwmIx61TNN7+l5YKgi1hMKxo5NvqZCfYhA5FvyuJG6X6vg== +"@typescript-eslint/type-utils@5.10.0": + version "5.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.10.0.tgz#8524b9479c19c478347a7df216827e749e4a51e5" + integrity sha512-TzlyTmufJO5V886N+hTJBGIfnjQDQ32rJYxPaeiyWKdjsv2Ld5l8cbS7pxim4DeNs62fKzRSt8Q14Evs4JnZyQ== dependencies: - "@typescript-eslint/experimental-utils" "5.9.1" + "@typescript-eslint/utils" "5.10.0" debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.9.1": - version "5.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.9.1.tgz#1bef8f238a2fb32ebc6ff6d75020d9f47a1593c6" - integrity sha512-SsWegWudWpkZCwwYcKoDwuAjoZXnM1y2EbEerTHho19Hmm+bQ56QG4L4jrtCu0bI5STaRTvRTZmjprWlTw/5NQ== +"@typescript-eslint/types@5.10.0": + version "5.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.0.tgz#beb3cb345076f5b088afe996d57bcd1dfddaa75c" + integrity sha512-wUljCgkqHsMZbw60IbOqT/puLfyqqD5PquGiBo1u1IS3PLxdi3RDGlyf032IJyh+eQoGhz9kzhtZa+VC4eWTlQ== -"@typescript-eslint/typescript-estree@5.9.1": - version "5.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.1.tgz#d5b996f49476495070d2b8dd354861cf33c005d6" - integrity sha512-gL1sP6A/KG0HwrahVXI9fZyeVTxEYV//6PmcOn1tD0rw8VhUWYeZeuWHwwhnewnvEMcHjhnJLOBhA9rK4vmb8A== +"@typescript-eslint/typescript-estree@5.10.0": + version "5.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.0.tgz#4be24a3dea0f930bb1397c46187d0efdd955a224" + integrity sha512-x+7e5IqfwLwsxTdliHRtlIYkgdtYXzE0CkFeV6ytAqq431ZyxCFzNMNR5sr3WOlIG/ihVZr9K/y71VHTF/DUQA== dependencies: - "@typescript-eslint/types" "5.9.1" - "@typescript-eslint/visitor-keys" "5.9.1" + "@typescript-eslint/types" "5.10.0" + "@typescript-eslint/visitor-keys" "5.10.0" debug "^4.3.2" globby "^11.0.4" is-glob "^4.0.3" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@5.9.1": - version "5.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.1.tgz#f52206f38128dd4f675cf28070a41596eee985b7" - integrity sha512-Xh37pNz9e9ryW4TVdwiFzmr4hloty8cFj8GTWMXh3Z8swGwyQWeCcNgF0hm6t09iZd6eiZmIf4zHedQVP6TVtg== +"@typescript-eslint/utils@5.10.0": + version "5.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.10.0.tgz#c3d152a85da77c400e37281355561c72fb1b5a65" + integrity sha512-IGYwlt1CVcFoE2ueW4/ioEwybR60RAdGeiJX/iDAw0t5w0wK3S7QncDwpmsM70nKgGTuVchEWB8lwZwHqPAWRg== dependencies: - "@typescript-eslint/types" "5.9.1" + "@types/json-schema" "^7.0.9" + "@typescript-eslint/scope-manager" "5.10.0" + "@typescript-eslint/types" "5.10.0" + "@typescript-eslint/typescript-estree" "5.10.0" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + +"@typescript-eslint/visitor-keys@5.10.0": + version "5.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.0.tgz#770215497ad67cd15a572b52089991d5dfe06281" + integrity sha512-GMxj0K1uyrFLPKASLmZzCuSddmjZVbVj3Ouy5QVuIGKZopxvOr24JsS7gruz6C3GExE01mublZ3mIBOaon9zuQ== + dependencies: + "@typescript-eslint/types" "5.10.0" eslint-visitor-keys "^3.0.0" accepts@~1.3.4: @@ -1462,9 +1464,9 @@ ajv@^6.10.0, ajv@^6.12.4: uri-js "^4.2.2" ajv@^8.0.1: - version "8.8.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.8.2.tgz#01b4fef2007a28bf75f0b7fc009f62679de4abbb" - integrity sha512-x9VuX+R/jcFj1DHo/fCp99esgGDWiHENrKxaCENuCxpoMCmAt/COCGVDwA7kleEpEzJjDnvh3yGoOuLu0Dtllw== + version "8.9.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.9.0.tgz#738019146638824dea25edcf299dcba1b0e7eb18" + integrity sha512-qOKJyNj/h+OWx7s5DePL6Zu1KeM9jPZhwBqs+7DzP6bGOvqzVCSf0xueYmVuaC/oQ/VtS2zLMLHdQFbkka+XDQ== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" @@ -1788,28 +1790,28 @@ babel-plugin-dynamic-import-node@^2.3.3: object.assign "^4.1.0" babel-plugin-polyfill-corejs2@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.0.tgz#407082d0d355ba565af24126fb6cb8e9115251fd" - integrity sha512-wMDoBJ6uG4u4PNFh72Ty6t3EgfA91puCuAwKIazbQlci+ENb/UU9A3xG5lutjUIiXCIn1CY5L15r9LimiJyrSA== + version "0.3.1" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.1.tgz#440f1b70ccfaabc6b676d196239b138f8a2cfba5" + integrity sha512-v7/T6EQcNfVLfcN2X8Lulb7DjprieyLWJK/zOWH5DUYcAgex9sP3h25Q+DLsX9TloXe3y1O8l2q2Jv9q8UVB9w== dependencies: "@babel/compat-data" "^7.13.11" - "@babel/helper-define-polyfill-provider" "^0.3.0" + "@babel/helper-define-polyfill-provider" "^0.3.1" semver "^6.1.1" babel-plugin-polyfill-corejs3@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.0.tgz#f81371be3fe499d39e074e272a1ef86533f3d268" - integrity sha512-Hcrgnmkf+4JTj73GbK3bBhlVPiLL47owUAnoJIf69Hakl3q+KfodbDXiZWGMM7iqCZTxCG3Z2VRfPNYES4rXqQ== + version "0.5.1" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.1.tgz#d66183bf10976ea677f4149a7fcc4d8df43d4060" + integrity sha512-TihqEe4sQcb/QcPJvxe94/9RZuLQuF1+To4WqQcRvc+3J3gLCPIPgDKzGLG6zmQLfH3nn25heRuDNkS2KR4I8A== dependencies: - "@babel/helper-define-polyfill-provider" "^0.3.0" + "@babel/helper-define-polyfill-provider" "^0.3.1" core-js-compat "^3.20.0" babel-plugin-polyfill-regenerator@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.0.tgz#9ebbcd7186e1a33e21c5e20cae4e7983949533be" - integrity sha512-dhAPTDLGoMW5/84wkgwiLRwMnio2i1fUe53EuvtKMv0pn2p3S8OCoV1xAzfJPl0KOX7IB89s2ib85vbYiea3jg== + version "0.3.1" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.1.tgz#2c0678ea47c75c8cc2fbb1852278d8fb68233990" + integrity sha512-Y2B06tvgHYt1x0yz17jGkGeeMr5FeKUu+ASJ+N6nB5lQ8Dapfg42i0OVrf8PNGJ3zKL4A23snMi1IRwrqqND7A== dependencies: - "@babel/helper-define-polyfill-provider" "^0.3.0" + "@babel/helper-define-polyfill-provider" "^0.3.1" bach@^1.0.0: version "1.2.0" @@ -1846,6 +1848,11 @@ base64-arraybuffer@0.1.4: resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz#9818c79e059b1355f97e0428a017c838e90ba812" integrity sha1-mBjHngWbE1X5fgQooBfIOOkLqBI= +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + base64id@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/base64id/-/base64id-2.0.0.tgz#2770ac6bc47d312af97a8bf9a634342e0cd25cb6" @@ -1903,7 +1910,7 @@ blob@0.0.5: resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.5.tgz#d680eeef25f8cd91ad533f5b01eed48e64caf683" integrity sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig== -bluebird@3.7.2: +bluebird@^3.7.2: version "3.7.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== @@ -2038,6 +2045,14 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== +buffer@^5.6.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + bytes@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.1.tgz#3f018291cb4cbad9accb6e6970bca9c8889e879a" @@ -2096,9 +2111,9 @@ camelcase@^5.0.0, camelcase@^5.3.1: integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== caniuse-lite@^1.0.30001286, caniuse-lite@^1.0.30001297: - version "1.0.30001299" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001299.tgz#d753bf6444ed401eb503cbbe17aa3e1451b5a68c" - integrity sha512-iujN4+x7QzqA2NCSrS5VUy+4gLmRd4xv6vbBBsmfVqTx8bLAD8097euLqQgKxSVLvxjSDcvF1T/i9ocgnUFexw== + version "1.0.30001301" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001301.tgz#ebc9086026534cab0dab99425d9c3b4425e5f450" + integrity sha512-csfD/GpHMqgEL3V3uIgosvh+SVIQvCh43SNu9HRbP1lnxkKm1kjDG4f32PP571JplkLjfS+mg2p1gxR7MYrrIA== caseless@~0.12.0: version "0.12.0" @@ -2139,9 +2154,9 @@ check-more-types@^2.24.0: integrity sha1-FCD/sQ/URNz8ebQ4kbv//TKoRgA= "chokidar@>=3.0.0 <4.0.0", chokidar@^3.5.1: - version "3.5.2" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" - integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== dependencies: anymatch "~3.1.2" braces "~3.0.2" @@ -2488,9 +2503,9 @@ copy-props@^2.0.1: is-plain-object "^5.0.0" core-js-compat@^3.20.0, core-js-compat@^3.20.2: - version "3.20.2" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.20.2.tgz#d1ff6936c7330959b46b2e08b122a8b14e26140b" - integrity sha512-qZEzVQ+5Qh6cROaTPFLNS4lkvQ6mBzE3R6A6EEpssj7Zr2egMHgsy4XapdifqJDGC9CBiNv7s+ejI96rLNQFdg== + version "3.20.3" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.20.3.tgz#d71f85f94eb5e4bea3407412e549daa083d23bd6" + integrity sha512-c8M5h0IkNZ+I92QhIpuSijOxGAcj3lgpsWdkCqmUTZNwidujF4r3pi6x1DCN+Vcs5qTS2XWWMfWSuCqyupX8gw== dependencies: browserslist "^4.19.1" semver "7.0.0" @@ -2530,40 +2545,40 @@ crypto-random-string@^2.0.0: resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== -cspell-gitignore@^5.15.2: - version "5.15.2" - resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-5.15.2.tgz#fa9f62d2cb1e95f056a82eec779e48815e46e856" - integrity sha512-st2V3rNBZzmuuUVywvEkAyhFD4TLMihHjTRauc5tCLR/zvveTjdXmgGHOSEn6afjuUfB8yRk4OdtK787EMaJhA== +cspell-gitignore@^5.16.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-5.16.0.tgz#2cd55a0802f4a05ba89eb3b04c68b191c9f3843f" + integrity sha512-G7yN0R2EqFSNpn3bQ4SGOmydaaYq5BHSiPqsX3vJSJn0wErZz3m/kpKcXrtLPw5/tAM0SfZWhAp1K3MEjrb6xQ== dependencies: - cspell-glob "^5.15.2" + cspell-glob "^5.16.0" find-up "^5.0.0" -cspell-glob@^5.15.2: - version "5.15.2" - resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-5.15.2.tgz#3f2ac3fabbeb04dfd4a1ed45c0ec5f978cb45349" - integrity sha512-lX14VwKOO+6CMHVobEf6br5YnIXD+MxpX/MdZPv34OsdOyQol4/gJ49MXN0suD+nTqsX0HH93B0osHfTDAXa6Q== +cspell-glob@^5.16.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-5.16.0.tgz#ea210b2a5ab7a871d2982f3806f46ecdea71c87d" + integrity sha512-u1cNhmNi5VC6QZ6W+FQEAFIowLdU+/fuh6811Hb//MfTNpe2HDbVrjredQrtaETpyImjy4VG/aA7iSWGGuUAcw== dependencies: micromatch "^4.0.4" -cspell-io@^5.15.2: - version "5.15.2" - resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-5.15.2.tgz#38b1f515844bc9d3dc410af10adac7ce653acaa7" - integrity sha512-wqSO7RDtDKcnTvuew2kOVykxAki8xVTZWNzRJJTA0myyvNTkA9TbXS9EXR4L7BuEUfUjI8mKscmpkmvg+eRMPg== +cspell-io@^5.16.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-5.16.0.tgz#e7043f960071ef453ba794d0ccd096a42f24d261" + integrity sha512-nrRbNewf8PMEq8W7D1D0jEwxwJ1dH588EPPu9Q+iT+DItvcBL+mQmGlz8kS7KBh579ioW2vecWUekQ3HSmAgGg== -cspell-lib@^5.15.2: - version "5.15.2" - resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-5.15.2.tgz#3047e04427cab4558230dc8106567ebebbc213b0" - integrity sha512-pSBVw8xVy/cd6W3Jx+0N4qyKQyEoN+LfqrCeA8fCpyzb0XTI50dISVghNCUHgmUuleXTZP3DCBC4YD9ZdHmwbA== +cspell-lib@^5.16.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-5.16.0.tgz#b8a3fa78bc07f7628171f4bb5146803bb5cc3ddb" + integrity sha512-IpTPseI4SounQEqfWupOLgEXPcbucWJdbCYkxKXWfl15xfWRo2seYV0RECkJ8pSZKqsCXo6x08i7CrKjvV5N5Q== dependencies: - "@cspell/cspell-bundled-dicts" "^5.15.2" - "@cspell/cspell-types" "^5.15.2" + "@cspell/cspell-bundled-dicts" "^5.16.0" + "@cspell/cspell-types" "^5.16.0" clear-module "^4.1.2" comment-json "^4.1.1" configstore "^5.0.1" cosmiconfig "^7.0.1" - cspell-glob "^5.15.2" - cspell-io "^5.15.2" - cspell-trie-lib "^5.15.2" + cspell-glob "^5.16.0" + cspell-io "^5.16.0" + cspell-trie-lib "^5.16.0" find-up "^5.0.0" fs-extra "^10.0.0" gensequence "^3.1.1" @@ -2572,25 +2587,25 @@ cspell-lib@^5.15.2: resolve-global "^1.0.0" vscode-uri "^3.0.3" -cspell-trie-lib@^5.15.2: - version "5.15.2" - resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-5.15.2.tgz#ed0bb9902d4bfd98d4e928afb325d79aa17df44d" - integrity sha512-AKdzxwGxuuNzph7eO6nm89jyIDrbCnPVUCFDq2sSpNrn6sptmifogMvrZTHzVwFLXpusfRLpSene80A2wr5OxA== +cspell-trie-lib@^5.16.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-5.16.0.tgz#191d367179307cf34aed8ffa923371e5287586c1" + integrity sha512-Dpxr0SManHi4D3sAJI1SA14lwTGdmubv88yrRuFd7TU5ihG39BIMxfoAoSRWkqXUEub5QLhAKhftOBUJIm4cIw== dependencies: fs-extra "^10.0.0" gensequence "^3.1.1" cspell@^5.15.1: - version "5.15.2" - resolved "https://registry.yarnpkg.com/cspell/-/cspell-5.15.2.tgz#16ee571d3e4316085ffe39c282e360909493198b" - integrity sha512-q/UWqkDMCB83uwb6LgDr7j/79RxeWbDY28J2kqktmAOk2Th4+ZuR7/IfxHOBUFvUYtbPxp1p8iz8v57G6U97Jg== + version "5.16.0" + resolved "https://registry.yarnpkg.com/cspell/-/cspell-5.16.0.tgz#bc4fab60ab259f25c4b2878bfb600850b6aa3684" + integrity sha512-giK0IZz1cK51mTSTox51GUxgcbKy5Y5yXvyqVpfQ6m4nATSuiSRiMPvlxX3Er2uAiNkolyLTIgUxBAV/c8U3PQ== dependencies: chalk "^4.1.2" commander "^8.3.0" comment-json "^4.1.1" - cspell-gitignore "^5.15.2" - cspell-glob "^5.15.2" - cspell-lib "^5.15.2" + cspell-gitignore "^5.16.0" + cspell-glob "^5.16.0" + cspell-lib "^5.16.0" fast-json-stable-stringify "^2.1.0" file-entry-cache "^6.0.1" fs-extra "^10.0.0" @@ -2620,18 +2635,19 @@ cssesc@^3.0.0: integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== cypress@^9.2.0: - version "9.2.1" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.2.1.tgz#47f2457e5ca7ede48be9a4176f20f30ccf3b3902" - integrity sha512-LVEe4yWCo4xO0Vd8iYjFHRyd5ulRvM56XqMgAdn05Qb9kJ6iJdO/MmjKD8gNd768698cp1FDuSmFQZHVZGk+Og== + version "9.3.1" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.3.1.tgz#8116f52d49d6daf90a91e88f3eafd940234d2958" + integrity sha512-BODdPesxX6bkVUnH8BVsV8I/jn57zQtO1FEOUTiuG2us3kslW7g0tcuwiny7CKCmJUZz8S/D587ppC+s58a+5Q== dependencies: "@cypress/request" "^2.88.10" "@cypress/xvfb" "^1.2.4" "@types/node" "^14.14.31" - "@types/sinonjs__fake-timers" "^6.0.2" + "@types/sinonjs__fake-timers" "8.1.1" "@types/sizzle" "^2.3.2" arch "^2.2.0" blob-util "^2.0.2" - bluebird "3.7.2" + bluebird "^3.7.2" + buffer "^5.6.0" cachedir "^2.3.0" chalk "^4.1.0" check-more-types "^2.24.0" @@ -2911,9 +2927,9 @@ ee-first@1.1.1: integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= electron-to-chromium@^1.4.17: - version "1.4.44" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.44.tgz#8a41923afdd6ef5ddabe001626036ba5d1d64ae6" - integrity sha512-tHGWiUUmY7GABK8+DNcr474cnZDTzD8x1736SlDosVH8+/vRJeqfaIBAEHFtMjddz/0T4rKKYsxEc8BwQRdBpw== + version "1.4.51" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.51.tgz#a432f5a5d983ace79278a33057300cf949627e63" + integrity sha512-JNEmcYl3mk1tGQmy0EvL5eik/CKSBuzAyGP0QFdG6LIgxQe3II0BL1m2zKc2MZMf3uGqHWE1TFddJML0RpjSHQ== emoji-regex@^8.0.0: version "8.0.0" @@ -3077,10 +3093,10 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-config-standard@^16.0.0: - version "16.0.3" - resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-16.0.3.tgz#6c8761e544e96c531ff92642eeb87842b8488516" - integrity sha512-x4fmJL5hGqNJKGHSjnLdgA6U6h1YW/G2dW9fA+cyVur4SK6lyue8+UgNKWlZtUDTXvgKDD/Oa3GQjmB5kjtVvg== +eslint-config-prettier@^8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a" + integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew== eslint-import-resolver-node@^0.3.6: version "0.3.6" @@ -3105,15 +3121,7 @@ eslint-plugin-cypress@^2.12.1: dependencies: globals "^11.12.0" -eslint-plugin-es@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz#75a7cdfdccddc0589934aeeb384175f221c57893" - integrity sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ== - dependencies: - eslint-utils "^2.0.0" - regexpp "^3.0.0" - -eslint-plugin-import@^2.17.2: +eslint-plugin-import@^2.25.4: version "2.25.4" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz#322f3f916a4e9e991ac7af32032c25ce313209f1" integrity sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA== @@ -3137,23 +3145,6 @@ eslint-plugin-no-unsanitized@^4.0.1: resolved "https://registry.yarnpkg.com/eslint-plugin-no-unsanitized/-/eslint-plugin-no-unsanitized-4.0.1.tgz#e2343265467ba2270ade478cbe07bbafeaea412d" integrity sha512-y/lAMWnPPC7RYuUdxlEL/XiCL8FehN9h9s3Kjqbp/Kv0i9NZs+IXSC2kS546Fa4Bumwy31HlVS/OdWX0Kxb5Xg== -eslint-plugin-node@^11.0.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz#c95544416ee4ada26740a30474eefc5402dc671d" - integrity sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g== - dependencies: - eslint-plugin-es "^3.0.0" - eslint-utils "^2.0.0" - ignore "^5.1.1" - minimatch "^3.0.4" - resolve "^1.10.1" - semver "^6.1.0" - -eslint-plugin-promise@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-6.0.0.tgz#017652c07c9816413a41e11c30adc42c3d55ff18" - integrity sha512-7GPezalm5Bfi/E22PnQxDWH2iW9GTvAlUNTztemeHb6c1BniSyoeTrM87JkC0wYdi6aQrZX9p2qEiAno8aTcbw== - eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" @@ -3170,13 +3161,6 @@ eslint-scope@^7.1.0: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-utils@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" - integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== - dependencies: - eslint-visitor-keys "^1.1.0" - eslint-utils@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" @@ -3184,22 +3168,12 @@ eslint-utils@^3.0.0: dependencies: eslint-visitor-keys "^2.0.0" -eslint-visitor-keys@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== - eslint-visitor-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2" - integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== - -eslint-visitor-keys@^3.2.0: +eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0, eslint-visitor-keys@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz#6fbb166a6798ee5991358bc2daa1ba76cc1254a1" integrity sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ== @@ -3455,9 +3429,9 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fast-glob@^3.2.7, fast-glob@^3.2.9: - version "3.2.10" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.10.tgz#2734f83baa7f43b7fd41e13bc34438f4ffe284ee" - integrity sha512-s9nFhFnvR63wls6/kM88kQqDhMu0AfdjqouE2l5GVQPbqLgyFjjU5ry/r2yKsJxpb9Py1EYNqieFrmMaX4v++A== + version "3.2.11" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" + integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" @@ -4281,12 +4255,17 @@ iconv-lite@0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" +ieee754@^1.1.13: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.1.1, ignore@^5.1.8, ignore@^5.2.0: +ignore@^5.1.8, ignore@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== @@ -4449,7 +4428,7 @@ is-ci@^3.0.0: dependencies: ci-info "^3.2.0" -is-core-module@^2.5.0, is-core-module@^2.8.0: +is-core-module@^2.5.0, is-core-module@^2.8.0, is-core-module@^2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== @@ -5273,9 +5252,9 @@ nan@^2.12.1: integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ== nanoid@^3.1.30: - version "3.1.32" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.32.tgz#8f96069e6239cc0a9ae8c0d3b41a3b4933a88c0a" - integrity sha512-F8mf7R3iT9bvThBoW4tGXhXFHCctyCiUUPrWF8WaTqa3h96d9QybkSeba43XVOOE3oiLfkVDe4bT8MeGmkrTxw== + version "3.2.0" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.2.0.tgz#62667522da6673971cca916a6d3eff3f415ff80c" + integrity sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA== nanomatch@^1.2.9: version "1.2.13" @@ -5820,9 +5799,9 @@ postcss-scss@^4.0.2: integrity sha512-j4KxzWovfdHsyxwl1BxkUal/O4uirvHgdzMKS1aWJBAV0qh2qj5qAZqpeBfVUYGWv+4iK9Az7SPyZ4fyNju1uA== postcss-selector-parser@^6.0.6, postcss-selector-parser@^6.0.7: - version "6.0.8" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.8.tgz#f023ed7a9ea736cd7ef70342996e8e78645a7914" - integrity sha512-D5PG53d209Z1Uhcc0qAZ5U3t5HagH3cxu+WLZ22jt3gLUpXM4eXXfiO14jiDWST3NNooX/E8wISfOhZ9eIjGTQ== + version "6.0.9" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.9.tgz#ee71c3b9ff63d9cd130838876c13a2ec1a992b2f" + integrity sha512-UO3SgnZOVTwu4kyLR22UQ1xZh086RyNZppb7lLAKBFK8a32ttG5i87Y/P3+2bRSjZNyJ1B7hfFNo273tKe9YxQ== dependencies: cssesc "^3.0.0" util-deprecate "^1.0.2" @@ -5851,6 +5830,11 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prettier@^2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" + integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg== + pretty-bytes@^5.6.0: version "5.6.0" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" @@ -6072,7 +6056,7 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexpp@^3.0.0, regexpp@^3.2.0: +regexpp@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== @@ -6225,12 +6209,12 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.4.0: - version "1.21.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.21.0.tgz#b51adc97f3472e6a5cf4444d34bc9d6b9037591f" - integrity sha512-3wCbTpk5WJlyE4mSOtDLhqQmGFi0/TD9VPwmiolnk8U0wRgMEktqCXd3vy5buTO3tljvalNvKrjHEfrd2WpEKA== +resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.4.0: + version "1.22.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" + integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== dependencies: - is-core-module "^2.8.0" + is-core-module "^2.8.1" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -6301,9 +6285,9 @@ rollup@^0.68.2: "@types/node" "*" rollup@^2.64.0: - version "2.64.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.64.0.tgz#f0f59774e21fbb56de438a37d06a2189632b207a" - integrity sha512-+c+lbw1lexBKSMb1yxGDVfJ+vchJH3qLbmavR+awDinTDA2C5Ug9u7lkOzj62SCu0PKUExsW36tpgW7Fmpn3yQ== + version "2.66.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.66.0.tgz#ee529ea15a20485d579039637fec3050bad03bbb" + integrity sha512-L6mKOkdyP8HK5kKJXaiWG7KZDumPJjuo1P+cfyHOJPNNTK3Moe7zCH5+fy7v8pVmHXtlxorzaBjvkBMB23s98g== optionalDependencies: fsevents "~2.3.2" @@ -6356,9 +6340,9 @@ safe-regex@^1.1.0: integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== sass@^1.47.0: - version "1.48.0" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.48.0.tgz#b53cfccc1b8ab4be375cc54f306fda9d4711162c" - integrity sha512-hQi5g4DcfjcipotoHZ80l7GNJHGqQS5LwMBjVYB/TaT0vcSSpbgM8Ad7cgfsB2M0MinbkEQQPO9+sjjSiwxqmw== + version "1.49.0" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.49.0.tgz#65ec1b1d9a6bc1bae8d2c9d4b392c13f5d32c078" + integrity sha512-TVwVdNDj6p6b4QymJtNtRS2YtLJ/CqZriGg0eIAbAKMlN8Xy6kbv33FsEZSF7FufFFM705SQviHjjThfaQ4VNw== dependencies: chokidar ">=3.0.0 <4.0.0" immutable "^4.0.0" @@ -6381,7 +6365,7 @@ semver@7.0.0: resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== -semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: +semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== @@ -6609,9 +6593,9 @@ socket.io@2.4.0: socket.io-parser "~3.4.0" "source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.1.tgz#a1741c131e3c77d048252adfa24e23b908670caf" - integrity sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA== + version "1.0.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== source-map-resolve@^0.5.0: version "0.5.3" @@ -7247,9 +7231,9 @@ typedarray@^0.0.6: integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= typescript@^4.5.4: - version "4.5.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.4.tgz#a17d3a0263bf5c8723b9c52f43c5084edf13c2e8" - integrity sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg== + version "4.5.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3" + integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA== ua-parser-js@1.0.2: version "1.0.2"