fix: typo for source

This commit is contained in:
yutotnh
2022-06-27 12:34:28 +09:00
parent 5619b54cdb
commit 4d4b77f39f
11 changed files with 28 additions and 28 deletions

View File

@@ -21,7 +21,7 @@ export const updateCurrentConfig = (siteCfg, _directives) => {
const d = _directives[i];
sanitize(d);
// Apply the data from the directive where the the overrides the themeVaraibles
// Apply the data from the directive where the the overrides the themeVariables
sumOfDirectives = assignWithDepth(sumOfDirectives, d);
}
@@ -67,7 +67,7 @@ export const setSiteConfig = (conf) => {
return siteConfig;
};
export const saveConfigFromInitilize = (conf) => {
export const saveConfigFromInitialize = (conf) => {
configFromInitialize = assignWithDepth({}, conf);
};

View File

@@ -30,7 +30,7 @@ describe('Graphlib decorations', () => {
expect(int.x).toBeCloseTo(192.4609375);
expect(int.y).toBeCloseTo(145.15711441743503);
});
it('case 3 - intersection on otop of box outside point greater then inside point', function () {
it('case 3 - intersection on top of box outside point greater then inside point', function () {
const o = { x: 157, y: 39 };
const i = { x: 104, y: 105 };
const node2 = {

View File

@@ -58,7 +58,7 @@ describe('[Comments] when parsing', () => {
});
it('should handle comments at the end no trailing newline', function () {
const res = flow.parser.parse('graph TD;\n A-->B\n%% Commento');
const res = flow.parser.parse('graph TD;\n A-->B\n%% Comment');
const vert = flow.parser.yy.getVertices();
const edges = flow.parser.yy.getEdges();
@@ -73,7 +73,7 @@ describe('[Comments] when parsing', () => {
});
it('should handle comments at the end many trailing newlines', function () {
const res = flow.parser.parse('graph TD;\n A-->B\n%% Commento\n\n\n');
const res = flow.parser.parse('graph TD;\n A-->B\n%% Comment\n\n\n');
const vert = flow.parser.yy.getVertices();
const edges = flow.parser.yy.getEdges();

View File

@@ -12,7 +12,7 @@ describe('parsing a flow chart', function () {
flow.parser.yy.clear();
});
it('should handle a trailing whitespaces after statememnts', function () {
it('should handle a trailing whitespaces after statements', function () {
const res = flow.parser.parse('graph TD;\n\n\n %% Comment\n A-->B; \n B-->C;');
const vert = flow.parser.yy.getVertices();

View File

@@ -107,8 +107,8 @@ describe('state diagram, ', function () {
});
it('handle "as" in state names 2', function () {
const str = `stateDiagram-v2
assembleas
state assembleas
assemblies
state assemblies
`;
parser.parse(str);
@@ -207,14 +207,14 @@ describe('state diagram, ', function () {
parser.parse(str);
});
it('should handle state deifintions with separation of id', function () {
it('should handle state definitions with separation of id', function () {
const str = `stateDiagram-v2\n
state "Long state description" as state1
`;
parser.parse(str);
});
it('should handle state deifintions with separation of id', function () {
it('should handle state definitions with separation of id', function () {
const str = `stateDiagram-v2
state "Not Shooting State" as NotShooting {
state "Idle mode" as Idle

View File

@@ -122,8 +122,8 @@ describe('state diagram, ', function () {
});
it('handle "as" in state names 2', function () {
const str = `stateDiagram
assembleas
state assembleas
assemblies
state assemblies
`;
parser.parse(str);
@@ -222,14 +222,14 @@ describe('state diagram, ', function () {
parser.parse(str);
});
it('should handle state deifintions with separation of id', function () {
it('should handle state defintions with separation of id', function () {
const str = `stateDiagram\n
state "Long state description" as state1
`;
parser.parse(str);
});
it('should handle state deifintions with separation of id', function () {
it('should handle state defintions with separation of id', function () {
const str = `stateDiagram
state "Not Shooting State" as NotShooting {
state "Idle mode" as Idle

View File

@@ -90,7 +90,7 @@ const initThrowsErrors = function () {
mermaidAPI.updateSiteConfig({ gantt: mermaid.ganttConfig });
}
const idGeneratior = new utils.initIdGeneratior(conf.deterministicIds, conf.deterministicIDSeed);
const idGenerator = new utils.initIdGenerator(conf.deterministicIds, conf.deterministicIDSeed);
let txt;
@@ -105,7 +105,7 @@ const initThrowsErrors = function () {
continue;
}
const id = `mermaid-${idGeneratior.next()}`;
const id = `mermaid-${idGenerator.next()}`;
// Fetch the graph definition including tags
txt = element.innerHTML;
@@ -189,7 +189,7 @@ if (typeof document !== 'undefined') {
}
/**
* ## setParseErrorHandler Alternativet to directly setting parseError using:
* ## setParseErrorHandler Alternative to directly setting parseError using:
*
* ```js
* mermaid.parseError = function(err,hash){=

View File

@@ -272,7 +272,7 @@ const render = function (id, _txt, cb, container) {
// let d3Iframe;
let root = select('body');
// In regular execurtion the container will be the div with a mermaid class
// In regular execution the container will be the div with a mermaid class
if (typeof container !== 'undefined') {
if (cnf.securityLevel === 'sandbox') {
// IF we are in sandboxed mode, we do everyting mermaid related
@@ -317,7 +317,7 @@ const render = function (id, _txt, cb, container) {
} else {
// No container was provided
// If there is an existsing element with the id, we remove it
// this likley a previously rendered diagram
// this likely a previously rendered diagram
const existingSvg = document.getElementById(id);
if (existingSvg) {
existingSvg.remove();
@@ -741,7 +741,7 @@ function initialize(options) {
}
}
// Set default options
configApi.saveConfigFromInitilize(options);
configApi.saveConfigFromInitialize(options);
if (options && options.theme && theme[options.theme]) {
// Todo merge with user options

View File

@@ -945,7 +945,7 @@ export const setupGraphViewbox = function (graph, svgElem, padding, useMaxWidth)
// Ensure the viewBox includes the whole svgBounds area with extra space for padding
const vBox = `0 0 ${width} ${height}`;
log.debug(
'Grpah.label',
'Graph.label',
graph._label,
'swidth',
sWidth,
@@ -966,7 +966,7 @@ export const setupGraphViewbox = function (graph, svgElem, padding, useMaxWidth)
svgElem.select('g').attr('transform', `translate(${tx}, ${ty})`);
};
export const initIdGeneratior = class iterator {
export const initIdGenerator = class iterator {
constructor(deterministic, seed) {
this.deterministic = deterministic;
this.seed = seed;
@@ -1080,7 +1080,7 @@ export default {
memoize,
runFunc,
entityDecode,
initIdGeneratior,
initIdGenerator: initIdGenerator,
directiveSanitizer,
sanitizeCss,
};

View File

@@ -302,7 +302,7 @@ describe('when calculating SVG size', function () {
describe('when initializing the id generator', function () {
it('should return a random number generator based on Date', function (done) {
const idGenerator = new utils.initIdGeneratior(false);
const idGenerator = new utils.initIdGenerator(false);
expect(typeof idGenerator.next).toEqual('function');
const lastId = idGenerator.next();
setTimeout(() => {
@@ -312,7 +312,7 @@ describe('when initializing the id generator', function () {
});
it('should return a non random number generator', function () {
const idGenerator = new utils.initIdGeneratior(true);
const idGenerator = new utils.initIdGenerator(true);
expect(typeof idGenerator.next).toEqual('function');
const start = 0;
const lastId = idGenerator.next();
@@ -321,7 +321,7 @@ describe('when initializing the id generator', function () {
});
it('should return a non random number generator based on seed', function () {
const idGenerator = new utils.initIdGeneratior(true, 'thisIsASeed');
const idGenerator = new utils.initIdGenerator(true, 'thisIsASeed');
expect(typeof idGenerator.next).toEqual('function');
const start = 11;
const lastId = idGenerator.next();