chore: remove alias path and fix export default
This commit is contained in:
parent
1f774a974a
commit
e7bc6db7cd
|
@ -2,8 +2,5 @@ module.exports = {
|
|||
preset: 'ts-jest',
|
||||
testEnvironment: 'node',
|
||||
moduleDirectories: ['node_modules'],
|
||||
moduleNameMapper: {
|
||||
'@/(.*)': '<rootDir>/src/$1',
|
||||
},
|
||||
testMatch: ['<rootDir>/__tests__/**/*.test.ts'],
|
||||
};
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
|||
import { MathMLElement } from '@/data/protocols/mathml-element';
|
||||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../protocols/mathml-element';
|
||||
import { ToLaTeXConverter } from '../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElementToLatexConverterAdapter } from '../usecases/mathml-to-latex-convertion/mathml-element-to-latex-converter-adapter';
|
||||
|
||||
export const mathMLElementToLaTeXConverter = (mathMLElement: MathMLElement): ToLaTeXConverter =>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../protocols/mathml-element';
|
||||
|
||||
export class MathMLElementToLaTexConverter implements ToLaTeXConverter {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { mathMLElementToLaTeXConverter } from '../../../helpers';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { mathMLElementToLaTeXConverter } from '../../../helpers';
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { mathMLElementToLaTeXConverter } from '../../../helpers/mathml-element-to-latex-converter';
|
||||
import { InvalidNumberOfChildrenError } from '../../../errors';
|
||||
import { latexAccents } from '@/syntax/latex-accents';
|
||||
import { latexAccents } from '../../../../syntax/latex-accents';
|
||||
|
||||
export class GenericUnderOver implements ToLaTeXConverter {
|
||||
private readonly _mathmlElement: MathMLElement;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { mathMLElementToLaTeXConverter } from '../../../helpers/mathml-element-to-latex-converter';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { mathMLElementToLaTeXConverter } from '../../../helpers/mathml-element-to-latex-converter';
|
||||
import { normalizeWhiteSpaces } from '../../../helpers/normalize-whitespace';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { mathMLElementToLaTeXConverter } from '../../../helpers/mathml-element-to-latex-converter';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { mathMLElementToLaTeXConverter } from '../../../helpers/mathml-element-to-latex-converter';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { mathMLElementToLaTeXConverter } from '../../../helpers/mathml-element-to-latex-converter';
|
||||
import { GenericWrapper, JoinWithManySeparators } from '../../../helpers';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { InvalidNumberOfChildrenError } from '../../../errors';
|
||||
import { ParenthesisWrapper, mathMLElementToLaTeXConverter } from '../../../helpers';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { normalizeWhiteSpaces } from '../../../helpers';
|
||||
import { allMathSymbolsByChar, allMathSymbolsByGlyph } from '@/syntax';
|
||||
import { allMathSymbolsByChar, allMathSymbolsByGlyph } from '../../../../syntax';
|
||||
|
||||
export class MI implements ToLaTeXConverter {
|
||||
private readonly _mathmlElement: MathMLElement;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { mathMLElementToLaTeXConverter, ParenthesisWrapper } from '../../../helpers';
|
||||
import { InvalidNumberOfChildrenError } from '../../../errors';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { normalizeWhiteSpaces } from '../../../helpers';
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { normalizeWhiteSpaces } from '../../../helpers';
|
||||
import { allMathOperatorsByChar, allMathOperatorsByGlyph } from '@/syntax';
|
||||
import { allMathOperatorsByChar, allMathOperatorsByGlyph } from '../../../../syntax';
|
||||
|
||||
export class MO implements ToLaTeXConverter {
|
||||
private readonly _mathmlElement: MathMLElement;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
|
||||
export class MPhantom implements ToLaTeXConverter {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { mathMLElementToLaTeXConverter } from '../../../helpers';
|
||||
import { InvalidNumberOfChildrenError } from '../../../errors';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { mathMLElementToLaTeXConverter } from '../../../helpers';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { mathMLElementToLaTeXConverter, ParenthesisWrapper, BracketWrapper } from '../../../helpers';
|
||||
import { InvalidNumberOfChildrenError } from '../../../errors';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { mathMLElementToLaTeXConverter, ParenthesisWrapper, BracketWrapper } from '../../../helpers';
|
||||
import { InvalidNumberOfChildrenError } from '../../../errors';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { mathMLElementToLaTeXConverter, ParenthesisWrapper, BracketWrapper } from '../../../helpers';
|
||||
import { InvalidNumberOfChildrenError } from '../../../errors';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { mathMLElementToLaTeXConverter } from '../../../helpers';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
|
||||
export class MText implements ToLaTeXConverter {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { mathMLElementToLaTeXConverter } from '../../../helpers';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ToLaTeXConverter } from '@/domain/usecases/to-latex-converter';
|
||||
import { ToLaTeXConverter } from '../../../../domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../protocols/mathml-element';
|
||||
import { mathMLElementToLaTeXConverter } from '../../../helpers';
|
||||
import { InvalidNumberOfChildrenError } from '../../../errors';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as ToLatexConverters from './converters';
|
||||
import { MathMLElement } from '@/data/protocols/mathml-element';
|
||||
import { ToLaTeXConverter, ToLaTeXConverterClass } from '@/domain/usecases/to-latex-converter';
|
||||
import { MathMLElement } from '../../../data/protocols/mathml-element';
|
||||
import { ToLaTeXConverter, ToLaTeXConverterClass } from '../../../domain/usecases/to-latex-converter';
|
||||
|
||||
export class MathMLElementToLatexConverterAdapter {
|
||||
private readonly _mathMLElement: MathMLElement;
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
import { MathMLToLaTeX } from '@/main';
|
||||
import { MathMLToLaTeX } from './main';
|
||||
|
||||
export default MathMLToLaTeX;
|
||||
module.exports = MathMLToLaTeX;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { MathMLElement } from '@/data/protocols/mathml-element';
|
||||
import { MathMLElement } from '../../../data/protocols/mathml-element';
|
||||
|
||||
export class ElementsToMathMLAdapter {
|
||||
convert(els: Element[]): MathMLElement[] {
|
||||
|
|
|
@ -3,7 +3,7 @@ import xmldom from 'xmldom';
|
|||
import { DOMParser } from 'xmldom';
|
||||
import { ElementsToMathMLAdapter } from './xmldom-elements-to-mathml-elements-adapter';
|
||||
import { ErrorHandler } from './error-handler';
|
||||
import { MathMLElement } from '@/data/protocols/mathml-element';
|
||||
import { MathMLElement } from '../../../data/protocols/mathml-element';
|
||||
|
||||
export class XmlToMathMLAdapter {
|
||||
private _xml = '';
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
import { XmlToMathMLAdapter, ElementsToMathMLAdapter, ErrorHandler } from '@/infra/usecases/xmldom-to-mathml-elements';
|
||||
import {
|
||||
XmlToMathMLAdapter,
|
||||
ElementsToMathMLAdapter,
|
||||
ErrorHandler,
|
||||
} from '../../infra/usecases/xmldom-to-mathml-elements';
|
||||
|
||||
export const makeToMathElementsConverter = (): XmlToMathMLAdapter => {
|
||||
const elementsToMathMLAdapter = new ElementsToMathMLAdapter();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { MathMLElementToLatexConverterAdapter } from '@/data/usecases/mathml-to-latex-convertion/mathml-element-to-latex-converter-adapter';
|
||||
import { MathMLElementToLatexConverterAdapter } from '../data/usecases/mathml-to-latex-convertion/mathml-element-to-latex-converter-adapter';
|
||||
import { makeToMathElementsConverter } from './factories';
|
||||
|
||||
export class MathMLToLaTeX {
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "src",
|
||||
"outDir": "dist",
|
||||
"target": "es5",
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"declaration": true,
|
||||
"strict": true,
|
||||
"rootDir": "src",
|
||||
"baseUrl": "src",
|
||||
"outDir": "dist",
|
||||
"paths": {
|
||||
"@/*": ["*"]
|
||||
}
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules", "**/__tests__/*"]
|
||||
|
|
Loading…
Reference in New Issue