diff --git a/package.json b/package.json index d837a93..59bea66 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,9 @@ "build:babel": "babel src -d dist", "prepublish": "npm run clean && npm run build", "test": "jest ./tests --passWithNoTests", + "test:watch": "jest ./tests --watch", + "test:coverage": "jest ./tests --coverage", + "test:verbose": "jest ./tests --verbose", "clean": "shx rm -rf ./coverage && shx rm -rf ./dist", "lint:prettier": "prettier --write src/", "lint": "eslint --ext .js . --ignore-path ./.eslintignore --resolve-plugins-relative-to .", diff --git a/src/settings.js b/src/settings.js index fb19bdd..1c224b4 100644 --- a/src/settings.js +++ b/src/settings.js @@ -1,26 +1,6 @@ const settings = { - component: EmailTemplateBodyComponent, - // params: { footerComponent, logoTop, logoBottom, content }, - params: addon1 -} + component: null, + params: {} +}; - -return settings; - - -// const objectAssign = require('object-assign'); - -// objectAssign({foo: 0}, {bar: 1}); -// //=> {foo: 0, bar: 1} - -// // multiple sources -// objectAssign({foo: 0}, {bar: 1}, {baz: 2}); -// //=> {foo: 0, bar: 1, baz: 2} - -// // overwrites equal keys -// objectAssign({foo: 0}, {foo: 1}, {foo: 2}); -// //=> {foo: 2} - -// // ignores null and undefined sources -// objectAssign({foo: 0}, null, {bar: 1}, undefined); -// //=> {foo: 0, bar: 1} \ No newline at end of file +export default settings; \ No newline at end of file diff --git a/tests/displayFactoryTwoPointFive.test.js b/tests/displayFactoryTwoPointFive.test.js new file mode 100644 index 0000000..294a5fb --- /dev/null +++ b/tests/displayFactoryTwoPointFive.test.js @@ -0,0 +1,122 @@ +import displayFactoryTwoPointFive from '../src/displayFactoryTwoPointFive'; + +describe('displayFactoryTwoPointFive', () => { + let factory; + + beforeEach(() => { + factory = new displayFactoryTwoPointFive(); + }); + + describe('module exports', () => { + it('should export a class (function)', () => { + expect(typeof displayFactoryTwoPointFive).toBe('function'); + }); + + it('should be instantiable', () => { + expect(() => new displayFactoryTwoPointFive()).not.toThrow(); + }); + }); + + describe('initialization', () => { + it('should initialize with error set to false', () => { + expect(factory.error).toBe(false); + }); + + it('should initialize with empty partial string', () => { + expect(factory.partial).toBe(''); + }); + }); + + describe('isError()', () => { + it('should return false when no error', () => { + expect(factory.isError()).toBe(false); + }); + + it('should return true when error is set', () => { + factory.error = true; + expect(factory.isError()).toBe(true); + }); + }); + + describe('setPartial() and getPartial()', () => { + it('should set and get the partial property', () => { + factory.setPartial('
Content
'); + expect(factory.getPartial()).toBe('
Content
'); + }); + + it('should return empty string initially', () => { + expect(factory.getPartial()).toBe(''); + }); + }); + + describe('create() - basic functionality', () => { + it('should call component with params and subcomponents', () => { + const mockComponent = jest.fn().mockReturnValue('rendered'); + const settings = { + component: mockComponent, + params: { id: 1, title: 'Test' }, + subcomponents: [] + }; + + const result = factory.create(settings); + + expect(mockComponent).toHaveBeenCalledWith({ id: 1, title: 'Test' }, []); + expect(result).toBe('rendered'); + }); + + it('should handle missing subcomponents', () => { + const mockComponent = jest.fn().mockReturnValue('ok'); + const result = factory.create({ component: mockComponent, params: {} }); + expect(result).toBe('ok'); + expect(mockComponent).toHaveBeenCalledWith({}, undefined); + }); + }); + + describe('create() - error handling', () => { + it('should handle component execution errors without throwing', () => { + const consoleLogSpy = jest.spyOn(console, 'log').mockImplementation(); + const errorComponent = jest.fn().mockImplementation(() => { + throw new Error('Component error'); + }); + + expect(() => factory.create({ component: errorComponent, params: {} })).not.toThrow(); + expect(consoleLogSpy).toHaveBeenCalled(); + consoleLogSpy.mockRestore(); + }); + + it('should return undefined when component throws', () => { + const consoleLogSpy = jest.spyOn(console, 'log').mockImplementation(); + const errorComponent = jest.fn().mockImplementation(() => { + throw new Error('fail'); + }); + + const result = factory.create({ component: errorComponent, params: {} }); + expect(result).toBeUndefined(); + consoleLogSpy.mockRestore(); + }); + }); + + describe('create() - parameter handling', () => { + it('should handle complex nested parameters', () => { + const mockComponent = jest.fn().mockReturnValue('nested'); + const settings = { + component: mockComponent, + params: { nested: { level1: { level2: 'value' } } } + }; + + const result = factory.create(settings); + expect(result).toBe('nested'); + }); + + it('should handle array parameters', () => { + const mockComponent = jest.fn().mockReturnValue('arrays'); + const settings = { + component: mockComponent, + params: { items: [1, 2, 3], names: ['a', 'b', 'c'] } + }; + + const result = factory.create(settings); + expect(result).toBe('arrays'); + }); + }); +}); diff --git a/tests/easyFactory.test.js b/tests/easyFactory.test.js new file mode 100644 index 0000000..f09ddcc --- /dev/null +++ b/tests/easyFactory.test.js @@ -0,0 +1,127 @@ +import Factory from '../src/easyFactory'; + +describe('easyFactory (Factory base class)', () => { + describe('Factory.getClass()', () => { + it('should be a static method', () => { + expect(typeof Factory.getClass).toBe('function'); + }); + + it('should throw error when called on base class', () => { + expect(() => { + Factory.getClass({ type: 'test' }); + }).toThrow('This method should be implemented in the factory subclasses'); + }); + + it('should include context in the error message', () => { + expect(() => { + Factory.getClass({ type: 'special' }); + }).toThrow(/Context: \[object Object\]/); + }); + }); + + describe('Factory.create()', () => { + it('should be a static method', () => { + expect(typeof Factory.create).toBe('function'); + }); + + it('should throw error when called on base class (delegates to getClass)', () => { + expect(() => { + Factory.create({ type: 'test' }); + }).toThrow('This method should be implemented in the factory subclasses'); + }); + }); + + describe('Subclass implementation', () => { + class AdminUser { + constructor(name) { + this.name = name; + this.role = 'admin'; + } + } + + class RegularUser { + constructor(name) { + this.name = name; + this.role = 'user'; + } + } + + class UserFactory extends Factory { + static getClass(context) { + if (context.type === 'admin') { + return AdminUser; + } else if (context.type === 'user') { + return RegularUser; + } + throw new Error('Unknown user type'); + } + } + + it('should create correct subclass instance for admin', () => { + const admin = UserFactory.create({ type: 'admin' }, 'John'); + expect(admin).toBeInstanceOf(AdminUser); + expect(admin.role).toBe('admin'); + expect(admin.name).toBe('John'); + }); + + it('should create correct subclass instance for user', () => { + const user = UserFactory.create({ type: 'user' }, 'Jane'); + expect(user).toBeInstanceOf(RegularUser); + expect(user.role).toBe('user'); + expect(user.name).toBe('Jane'); + }); + + it('should create different instances for different types', () => { + const admin = UserFactory.create({ type: 'admin' }, 'Admin User'); + const user = UserFactory.create({ type: 'user' }, 'Regular User'); + + expect(admin).toBeInstanceOf(AdminUser); + expect(user).toBeInstanceOf(RegularUser); + }); + + it('should pass multiple arguments to constructor', () => { + class ExtendedUser { + constructor(name, email, age) { + this.name = name; + this.email = email; + this.age = age; + } + } + + class ExtendedFactory extends Factory { + static getClass() { + return ExtendedUser; + } + } + + const user = ExtendedFactory.create({}, 'Alice', 'alice@example.com', 30); + expect(user.name).toBe('Alice'); + expect(user.email).toBe('alice@example.com'); + expect(user.age).toBe(30); + }); + + it('should handle no extra arguments', () => { + class SimpleItem { + constructor() { + this.initialized = true; + } + } + + class SimpleFactory extends Factory { + static getClass() { + return SimpleItem; + } + } + + const result = SimpleFactory.create({}); + expect(result).toBeInstanceOf(SimpleItem); + expect(result.initialized).toBe(true); + }); + + it('should throw for unknown context type', () => { + expect(() => { + UserFactory.create({ type: 'unknown' }); + }).toThrow('Unknown user type'); + }); + }); +}); diff --git a/tests/factoryFour.test.js b/tests/factoryFour.test.js new file mode 100644 index 0000000..3f34f30 --- /dev/null +++ b/tests/factoryFour.test.js @@ -0,0 +1,84 @@ +import { factoryFour } from '../src/factoryFour'; + +describe('factoryFour', () => { + describe('function signature', () => { + it('should exist and be callable', () => { + expect(typeof factoryFour).toBe('function'); + }); + + it('should return an object when called with valid settings', () => { + const mockComponent = jest.fn().mockReturnValue('result'); + const result = factoryFour({ component: mockComponent, params: {}, subcomponents: [] }); + expect(typeof result).toBe('object'); + expect(result).not.toBeNull(); + }); + }); + + describe('returned object', () => { + let instance; + let mockComponent; + + beforeEach(() => { + mockComponent = jest.fn().mockReturnValue('rendered'); + instance = factoryFour({ + component: mockComponent, + params: { name: 'Test', value: 42 }, + subcomponents: [] + }); + }); + + it('should expose params on returned object', () => { + expect(instance.params).toEqual({ name: 'Test', value: 42 }); + }); + + it('should expose changeParams method', () => { + expect(typeof instance.changeParams).toBe('function'); + }); + + it('should expose start method', () => { + expect(typeof instance.start).toBe('function'); + }); + + it('should expose display method', () => { + expect(typeof instance.display).toBe('function'); + }); + + it('should merge params via changeParams()', () => { + instance.changeParams({ extra: 'value' }); + expect(instance.params).toEqual({ name: 'Test', value: 42, extra: 'value' }); + }); + + it('should overwrite existing params via changeParams()', () => { + instance.changeParams({ name: 'Updated' }); + expect(instance.params.name).toBe('Updated'); + }); + + it('should call the component function on display()', () => { + instance.display(); + expect(mockComponent).toHaveBeenCalledWith( + { name: 'Test', value: 42 }, + [] + ); + }); + + it('should return the component result from display()', () => { + const result = instance.display(); + expect(result).toBe('rendered'); + }); + }); + + describe('parameter handling', () => { + it('should handle empty params object', () => { + const mockComponent = jest.fn().mockReturnValue('ok'); + expect(() => factoryFour({ component: mockComponent, params: {} })).not.toThrow(); + }); + + it('should return consistent results for same input', () => { + const mockComponent = jest.fn().mockReturnValue('same'); + const params = { id: 1 }; + const result1 = factoryFour({ component: mockComponent, params }); + const result2 = factoryFour({ component: mockComponent, params }); + expect(result1.params).toEqual(result2.params); + }); + }); +}); diff --git a/tests/factoryTwo.test.js b/tests/factoryTwo.test.js new file mode 100644 index 0000000..914f88b --- /dev/null +++ b/tests/factoryTwo.test.js @@ -0,0 +1,149 @@ +import displayFactoryTwo from '../src/factoryTwo'; + +describe('displayFactoryTwo', () => { + let factory; + + beforeEach(() => { + factory = new displayFactoryTwo(); + }); + + describe('initialization', () => { + it('should initialize with error set to false', () => { + expect(factory.error).toBe(false); + }); + + it('should initialize with empty partial string', () => { + expect(factory.partial).toBe(''); + }); + }); + + describe('isError()', () => { + it('should return false when no error', () => { + expect(factory.isError()).toBe(false); + }); + + it('should return true when error is set', () => { + factory.error = true; + expect(factory.isError()).toBe(true); + }); + }); + + describe('setPartial()', () => { + it('should set the partial property', () => { + const testString = '
Test Content
'; + factory.setPartial(testString); + expect(factory.partial).toBe(testString); + }); + + it('should overwrite existing partial', () => { + factory.setPartial('First'); + factory.setPartial('Second'); + expect(factory.partial).toBe('Second'); + }); + }); + + describe('getPartial()', () => { + it('should return the partial property', () => { + factory.partial = 'test partial'; + expect(factory.getPartial()).toBe('test partial'); + }); + + it('should return empty string initially', () => { + expect(factory.getPartial()).toBe(''); + }); + }); + + describe('create()', () => { + it('should call component function with params and subcomponents', () => { + const mockComponent = jest.fn().mockReturnValue('rendered'); + const settings = { + component: mockComponent, + params: { name: 'Test' }, + subcomponents: [] + }; + + const result = factory.create(settings); + + expect(mockComponent).toHaveBeenCalledWith({ name: 'Test' }, []); + expect(result).toBe('rendered'); + }); + + it('should handle component without subcomponents', () => { + const mockComponent = jest.fn().mockReturnValue('content'); + const settings = { + component: mockComponent, + params: { id: 1 } + }; + + const result = factory.create(settings); + + expect(mockComponent).toHaveBeenCalledWith({ id: 1 }, undefined); + expect(result).toBe('content'); + }); + + it('should catch and log errors from component', () => { + const consoleLogSpy = jest.spyOn(console, 'log').mockImplementation(); + const mockComponent = jest.fn().mockImplementation(() => { + throw new Error('Component error'); + }); + const settings = { + component: mockComponent, + params: { test: true }, + subcomponents: [] + }; + + const result = factory.create(settings); + + expect(consoleLogSpy).toHaveBeenCalled(); + expect(result).toBeUndefined(); + + consoleLogSpy.mockRestore(); + }); + + it('should return undefined if component throws error', () => { + const consoleLogSpy = jest.spyOn(console, 'log').mockImplementation(); + const mockComponent = jest.fn().mockImplementation(() => { + throw new Error('Render failed'); + }); + const settings = { + component: mockComponent, + params: {} + }; + + const result = factory.create(settings); + + expect(result).toBeUndefined(); + consoleLogSpy.mockRestore(); + }); + + it('should handle complex component parameters', () => { + const mockComponent = jest.fn().mockReturnValue('complex'); + const complexParams = { + items: [{ id: 1, name: 'Item 1' }], + nested: { prop: 'value' } + }; + const settings = { + component: mockComponent, + params: complexParams, + subcomponents: [{ type: 'header' }, { type: 'footer' }] + }; + + const result = factory.create(settings); + + expect(mockComponent).toHaveBeenCalledWith(complexParams, [ + { type: 'header' }, + { type: 'footer' } + ]); + expect(result).toBe('complex'); + }); + }); + + describe('display()', () => { + it('should call getPartial method', () => { + const spy = jest.spyOn(factory, 'getPartial'); + factory.display(); + expect(spy).toHaveBeenCalled(); + spy.mockRestore(); + }); + }); +}); diff --git a/tests/integration.test.js b/tests/integration.test.js new file mode 100644 index 0000000..9065cdf --- /dev/null +++ b/tests/integration.test.js @@ -0,0 +1,205 @@ +import displayFactoryTwo from '../src/factoryTwo'; +import displayFactoryTwoPointFive from '../src/displayFactoryTwoPointFive'; +import { factoryFour } from '../src/factoryFour'; +import Factory from '../src/easyFactory'; + +describe('Integration Tests', () => { + describe('Multiple factories working together', () => { + it('should support creating with displayFactoryTwo and handling output', () => { + const factory = new displayFactoryTwo(); + const mockComponent = jest.fn().mockReturnValue('
Test
'); + + const result = factory.create({ + component: mockComponent, + params: { content: 'test' } + }); + expect(result).toBe('
Test
'); + }); + + it('should support error handling across factories', () => { + const factory = new displayFactoryTwo(); + const errorComponent = jest.fn().mockImplementation(() => { + throw new Error('Component error'); + }); + + const consoleLogSpy = jest.spyOn(console, 'log').mockImplementation(); + factory.create({ component: errorComponent, params: {} }); + expect(consoleLogSpy).toHaveBeenCalled(); + consoleLogSpy.mockRestore(); + }); + + it('should behave identically for displayFactoryTwo and displayFactoryTwoPointFive', () => { + const factoryA = new displayFactoryTwo(); + const factoryB = new displayFactoryTwoPointFive(); + const mockComponent = jest.fn().mockReturnValue('same result'); + const settings = { component: mockComponent, params: { x: 1 }, subcomponents: [] }; + + const resultA = factoryA.create(settings); + const resultB = factoryB.create(settings); + + expect(resultA).toBe(resultB); + }); + }); + + describe('Component composition', () => { + it('should handle component with subcomponents', () => { + const factory = new displayFactoryTwo(); + const parentComponent = jest.fn().mockReturnValue('
Parent
'); + const subcomponents = [ + { render: () => 'Sub1' }, + { render: () => 'Sub2' } + ]; + + const result = factory.create({ + component: parentComponent, + params: { title: 'Parent' }, + subcomponents + }); + + expect(parentComponent).toHaveBeenCalledWith({ title: 'Parent' }, subcomponents); + expect(result).toBe('
Parent
'); + }); + }); + + describe('Template object workflow', () => { + it('should create template and retrieve partial', () => { + const factory = new displayFactoryTwo(); + const templateComponent = jest.fn() + .mockReturnValue(''); + + const result = factory.create({ + component: templateComponent, + params: { name: 'John', email: 'john@example.com' } + }); + factory.setPartial(result); + + expect(factory.getPartial()).toBe(''); + expect(factory.isError()).toBe(false); + }); + + it('should handle template error state', () => { + const factory = new displayFactoryTwo(); + factory.error = true; + expect(factory.isError()).toBe(true); + }); + }); + + describe('factoryFour workflow', () => { + it('should flow data through component chain via display()', () => { + const transformComponent = jest.fn().mockImplementation((params) => { + return JSON.stringify({ ...params, processed: true }); + }); + + const instance = factoryFour({ + component: transformComponent, + params: { userId: 1, userName: 'Test User' } + }); + + const result = instance.display(); + const parsed = JSON.parse(result); + expect(parsed.processed).toBe(true); + expect(parsed.userId).toBe(1); + }); + + it('should update params and reflect them in start()', () => { + const consoleLogSpy = jest.spyOn(console, 'log').mockImplementation(); + const mockComponent = jest.fn(); + const instance = factoryFour({ + component: mockComponent, + params: { a: 1 } + }); + + instance.changeParams({ b: 2 }); + instance.start(); + + expect(consoleLogSpy).toHaveBeenCalledWith({ a: 1, b: 2 }); + consoleLogSpy.mockRestore(); + }); + }); + + describe('Factory subclass pattern', () => { + it('should create instances through custom factory subclass', () => { + class Widget { + constructor(type, label) { + this.type = type; + this.label = label; + } + } + + class ButtonWidget extends Widget { + constructor(label) { + super('button', label); + } + } + + class WidgetFactory extends Factory { + static getClass(context) { + if (context.type === 'button') return ButtonWidget; + throw new Error(`Unknown widget: ${context.type}`); + } + } + + const btn = WidgetFactory.create({ type: 'button' }, 'Click Me'); + expect(btn).toBeInstanceOf(ButtonWidget); + expect(btn.type).toBe('button'); + expect(btn.label).toBe('Click Me'); + }); + }); + + describe('Edge cases and stress tests', () => { + it('should handle 100+ rapid sequential creates', () => { + const factory = new displayFactoryTwo(); + const component = jest.fn().mockReturnValue('result'); + + for (let i = 0; i < 100; i++) { + factory.create({ component, params: { iteration: i } }); + } + + expect(component).toHaveBeenCalledTimes(100); + }); + + it('should handle large parameter objects (1000+ properties)', () => { + const factory = new displayFactoryTwo(); + const largeParams = {}; + for (let i = 0; i < 1000; i++) { + largeParams[`key${i}`] = `value${i}`; + } + + const component = jest.fn().mockReturnValue('result'); + factory.create({ component, params: largeParams }); + + expect(component).toHaveBeenCalledWith(largeParams, undefined); + }); + + it('should handle deeply nested objects (50 levels)', () => { + const factory = new displayFactoryTwo(); + const deepParams = { level: 0 }; + let current = deepParams; + for (let i = 1; i < 50; i++) { + current.nested = { level: i }; + current = current.nested; + } + + const component = jest.fn().mockReturnValue('deep'); + factory.create({ component, params: deepParams }); + expect(component).toHaveBeenCalled(); + }); + + it('should recover from errors without affecting subsequent calls', () => { + const factory = new displayFactoryTwo(); + const consoleLogSpy = jest.spyOn(console, 'log').mockImplementation(); + + const component = jest.fn() + .mockImplementationOnce(() => { throw new Error('First error'); }) + .mockReturnValueOnce('recovery'); + + factory.create({ component, params: {} }); + const result = factory.create({ component, params: {} }); + + expect(result).toBe('recovery'); + expect(factory.isError()).toBe(false); + + consoleLogSpy.mockRestore(); + }); + }); +}); diff --git a/tests/settings.test.js b/tests/settings.test.js new file mode 100644 index 0000000..894f5ad --- /dev/null +++ b/tests/settings.test.js @@ -0,0 +1,26 @@ +import settings from '../src/settings'; + +describe('Settings Module', () => { + it('should export a settings object', () => { + expect(settings).toBeDefined(); + }); + + it('should be an object', () => { + expect(typeof settings).toBe('object'); + expect(settings).not.toBeNull(); + }); + + describe('configuration properties', () => { + it('should have at least one property', () => { + expect(Object.keys(settings).length).toBeGreaterThan(0); + }); + + it('should have a component property', () => { + expect('component' in settings).toBe(true); + }); + + it('should have a params property', () => { + expect('params' in settings).toBe(true); + }); + }); +}); diff --git a/yarn.lock b/yarn.lock index a0d7d5d..bf1e58e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -38,7 +38,7 @@ resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.1.tgz" integrity sha512-EWZ4mE2diW3QALKvDMiXnbZpRvlj+nayZ112nK93SnhqOtpdsbVD4W+2tEoT3YNBAG9RBR0ISY758ZkOgsn6pQ== -"@babel/core@7.20.2", "@babel/core@^7.11.6", "@babel/core@^7.12.3": +"@babel/core@^7.0.0", "@babel/core@^7.0.0-0", "@babel/core@^7.11.6", "@babel/core@^7.12.0", "@babel/core@^7.12.3", "@babel/core@^7.13.0", "@babel/core@^7.4.0-0", "@babel/core@^7.8.0", "@babel/core@>=7.11.0", "@babel/core@7.20.2": version "7.20.2" resolved "https://registry.npmjs.org/@babel/core/-/core-7.20.2.tgz" integrity sha512-w7DbG8DtMrJcFOi4VrLm+8QM4az8Mo+PuLBKLp2zrYRCow8W/f9xiXm5sN53C8HksCyDQwCKha9JiDoIyPjT2g== @@ -465,7 +465,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-dynamic-import@7.8.3", "@babel/plugin-syntax-dynamic-import@^7.8.3": +"@babel/plugin-syntax-dynamic-import@^7.8.3", "@babel/plugin-syntax-dynamic-import@7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz" integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== @@ -690,7 +690,7 @@ "@babel/helper-module-transforms" "^7.19.6" "@babel/helper-plugin-utils" "^7.19.0" -"@babel/plugin-transform-modules-commonjs@7.19.6", "@babel/plugin-transform-modules-commonjs@^7.19.6": +"@babel/plugin-transform-modules-commonjs@^7.19.6", "@babel/plugin-transform-modules-commonjs@7.19.6": version "7.19.6" resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.19.6.tgz" integrity sha512-8PIa1ym4XRTKuSsOUXqDG0YaOlEuTVvHMe5JCfgBMOtHvJKw/4NGovEGN33viISshG/rZNVrACiBmPQLvWN8xQ== @@ -1227,7 +1227,7 @@ resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.1.tgz" integrity sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ== -"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10": +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@1.4.14": version "1.4.14" resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== @@ -1333,7 +1333,7 @@ dependencies: "@sinonjs/commons" "^1.7.0" -"@types/babel__core@^7.1.14": +"@types/babel__core@^7.1.14", "@types/babel__core@^7.1.9": version "7.1.19" resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.19.tgz" integrity sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw== @@ -1451,7 +1451,7 @@ acorn@^5.7.3: resolved "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz" integrity sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg== -acorn@^8.8.0: +"acorn@^6.0.0 || ^7.0.0 || ^8.0.0", acorn@^8.8.0: version "8.8.1" resolved "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz" integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== @@ -1485,7 +1485,14 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -ansi-styles@^4.0.0, ansi-styles@^4.1.0: +ansi-styles@^4.0.0: + version "4.3.0" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== @@ -1640,7 +1647,17 @@ bl@~0.8.1: dependencies: readable-stream "~1.0.26" -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: +bn.js@^4.0.0: + version "4.12.0" + resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== + +bn.js@^4.1.0: + version "4.12.0" + resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== + +bn.js@^4.11.9: version "4.12.0" resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== @@ -1740,7 +1757,7 @@ browserify-sign@^4.0.0: readable-stream "^3.6.0" safe-buffer "^5.2.0" -browserslist@^4.21.3, browserslist@^4.21.4: +browserslist@^4.21.3, browserslist@^4.21.4, "browserslist@>= 4.21.0": version "4.21.4" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz" integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw== @@ -1797,11 +1814,6 @@ caniuse-lite@^1.0.30001400: resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001431.tgz" integrity sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ== -chalk@5.1.2: - version "5.1.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz" - integrity sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ== - chalk@^2.0.0: version "2.4.2" resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" @@ -1819,6 +1831,11 @@ chalk@^4.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@5.1.2: + version "5.1.2" + resolved "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz" + integrity sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ== + char-regex@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz" @@ -1895,16 +1912,16 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - color-name@~1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + commander@^4.0.1: version "4.1.1" resolved "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz" @@ -2149,14 +2166,6 @@ eslint-plugin-json@3.1.0: lodash "^4.17.21" vscode-json-languageservice "^4.1.6" -eslint-scope@5.1.1: - version "5.1.1" - resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== - dependencies: - esrecurse "^4.3.0" - estraverse "^4.1.1" - eslint-scope@^7.1.1: version "7.1.1" resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz" @@ -2165,6 +2174,14 @@ eslint-scope@^7.1.1: esrecurse "^4.3.0" estraverse "^5.2.0" +eslint-scope@5.1.1: + version "5.1.1" + resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + eslint-utils@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz" @@ -2187,7 +2204,7 @@ eslint-visitor-keys@^3.3.0: resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@8.27.0: +"eslint@^7.5.0 || ^8.0.0", "eslint@>= 4.12.1", eslint@>=5, eslint@8.27.0: version "8.27.0" resolved "https://registry.npmjs.org/eslint/-/eslint-8.27.0.tgz" integrity sha512-0y1bfG2ho7mty+SiILVf9PfuRA49ek4Nc60Wmmu62QlobNR+CeXa4xXIJgcuwSQgZiWaPH+5BDsctpIW0PR/wQ== @@ -2265,7 +2282,12 @@ estraverse@^4.1.1: resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== -estraverse@^5.1.0, estraverse@^5.2.0: +estraverse@^5.1.0: + version "5.3.0" + resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +estraverse@^5.2.0: version "5.3.0" resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== @@ -2416,11 +2438,6 @@ fs.realpath@^1.0.0: resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@*, fsevents@^2.3.2, fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== - function-bind@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" @@ -2609,7 +2626,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3: +inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3, inherits@2: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -2704,16 +2721,16 @@ is@~0.2.6: resolved "https://registry.npmjs.org/is/-/is-0.2.7.tgz" integrity sha512-ajQCouIvkcSnl2iRdK70Jug9mohIHVX9uKpoWnl115ov0R5mzBvRrXxrnHbsA+8AdwCwc/sfw7HXmd4I5EJBdQ== -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" - integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== - isarray@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" + integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== + isbuffer@~0.0.0: version "0.0.0" resolved "https://registry.npmjs.org/isbuffer/-/isbuffer-0.0.0.tgz" @@ -2969,7 +2986,7 @@ jest-resolve-dependencies@^29.3.1: jest-regex-util "^29.2.0" jest-snapshot "^29.3.1" -jest-resolve@^29.3.1: +jest-resolve@*, jest-resolve@^29.3.1: version "29.3.1" resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.3.1.tgz" integrity sha512-amXJgH/Ng712w3Uz5gqzFBBjxV8WFLSmNjoreBGMqxgCz5cH7swmBZzgBaCIOsvb0NbpJ0vgaSFdJqMdT+rADw== @@ -3216,6 +3233,11 @@ level-filesystem@^1.0.1: once "^1.3.0" xtend "^2.2.0" +level-fix-range@~1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/level-fix-range/-/level-fix-range-1.0.2.tgz" + integrity sha512-9llaVn6uqBiSlBP+wKiIEoBa01FwEISFgHSZiyec2S0KpyLUkGR4afW/FCZ/X8y+QJvzS0u4PGOlZDdh1/1avQ== + level-fix-range@2.0: version "2.0.0" resolved "https://registry.npmjs.org/level-fix-range/-/level-fix-range-2.0.0.tgz" @@ -3223,11 +3245,6 @@ level-fix-range@2.0: dependencies: clone "~0.1.9" -level-fix-range@~1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/level-fix-range/-/level-fix-range-1.0.2.tgz" - integrity sha512-9llaVn6uqBiSlBP+wKiIEoBa01FwEISFgHSZiyec2S0KpyLUkGR4afW/FCZ/X8y+QJvzS0u4PGOlZDdh1/1avQ== - "level-hooks@>=4.4.0 <5": version "4.5.0" resolved "https://registry.npmjs.org/level-hooks/-/level-hooks-4.5.0.tgz" @@ -3247,7 +3264,7 @@ level-js@^2.1.3: typedarray-to-buffer "~1.0.0" xtend "~2.1.2" -level-peek@1.0.6, level-peek@^1.0.6: +level-peek@^1.0.6, level-peek@1.0.6: version "1.0.6" resolved "https://registry.npmjs.org/level-peek/-/level-peek-1.0.6.tgz" integrity sha512-TKEzH5TxROTjQxWMczt9sizVgnmJ4F3hotBI48xCTYvOKd/4gA/uY0XjKkhJFo6BMic8Tqjf6jFMLWeg3MAbqQ== @@ -3758,7 +3775,17 @@ readable-stream@^3.6.0: string_decoder "^1.1.1" util-deprecate "^1.0.1" -readable-stream@~1.0.26, readable-stream@~1.0.26-4: +readable-stream@~1.0.26-4: + version "1.0.34" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" + integrity sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@~1.0.26: version "1.0.34" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" integrity sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg== @@ -3925,7 +3952,7 @@ rollup-pluginutils@^2.3.1: dependencies: estree-walker "^0.6.1" -rollup@3.4.0: +rollup@^1.20.0||^2.0.0||^3.0.0, rollup@^2.68.0||^3.0.0, rollup@^2.78.0||^3.0.0, rollup@3.4.0: version "3.4.0" resolved "https://registry.npmjs.org/rollup/-/rollup-3.4.0.tgz" integrity sha512-4g8ZrEFK7UbDvy3JF+d5bLiC8UKkS3n/27/cnVeESwB1LVPl6MoPL32/6+SCQ1vHTp6Mvp2veIHtwELhi+uXEw== @@ -3944,7 +3971,12 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@^5.2.0, safe-buffer@~5.2.0: +safe-buffer@^5.2.0: + version "5.2.1" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -4063,6 +4095,25 @@ stack-utils@^2.0.3: dependencies: escape-string-regexp "^2.0.0" +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + integrity sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ== + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + string-length@^4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz" @@ -4085,25 +4136,6 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - integrity sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ== - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz"