Merge pull request #1828 from Tyriar/1507_remove_layering

Remove utils/ folder
This commit is contained in:
Daniel Imms
2018-12-11 06:27:49 -08:00
committed by GitHub
16 changed files with 16 additions and 16 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ import { assert, expect } from 'chai';
import { ITerminal } from './Types'; import { ITerminal } from './Types';
import { Buffer, DEFAULT_ATTR, CHAR_DATA_CHAR_INDEX } from './Buffer'; import { Buffer, DEFAULT_ATTR, CHAR_DATA_CHAR_INDEX } from './Buffer';
import { CircularList } from './common/CircularList'; import { CircularList } from './common/CircularList';
import { MockTerminal, TestTerminal } from './utils/TestUtils.test'; import { MockTerminal, TestTerminal } from './ui/TestUtils.test';
import { BufferLine } from './BufferLine'; import { BufferLine } from './BufferLine';
const INIT_COLS = 80; const INIT_COLS = 80;
+1 -1
View File
@@ -7,7 +7,7 @@ import { assert } from 'chai';
import { ITerminal } from './Types'; import { ITerminal } from './Types';
import { BufferSet } from './BufferSet'; import { BufferSet } from './BufferSet';
import { Buffer } from './Buffer'; import { Buffer } from './Buffer';
import { MockTerminal } from './utils/TestUtils.test'; import { MockTerminal } from './ui/TestUtils.test';
describe('BufferSet', () => { describe('BufferSet', () => {
let terminal: ITerminal; let terminal: ITerminal;
+1 -1
View File
@@ -3,7 +3,7 @@
* @license MIT * @license MIT
*/ */
import { TestTerminal } from './utils/TestUtils.test'; import { TestTerminal } from './ui/TestUtils.test';
import { assert } from 'chai'; import { assert } from 'chai';
import { getStringCellWidth, wcwidth } from './CharWidth'; import { getStringCellWidth, wcwidth } from './CharWidth';
import { IBuffer } from './Types'; import { IBuffer } from './Types';
+1 -1
View File
@@ -5,7 +5,7 @@
import { assert, expect } from 'chai'; import { assert, expect } from 'chai';
import { InputHandler } from './InputHandler'; import { InputHandler } from './InputHandler';
import { MockInputHandlingTerminal } from './utils/TestUtils.test'; import { MockInputHandlingTerminal } from './ui/TestUtils.test';
import { NULL_CELL_CHAR, NULL_CELL_CODE, NULL_CELL_WIDTH, CHAR_DATA_CHAR_INDEX, CHAR_DATA_ATTR_INDEX, DEFAULT_ATTR } from './Buffer'; import { NULL_CELL_CHAR, NULL_CELL_CODE, NULL_CELL_WIDTH, CHAR_DATA_CHAR_INDEX, CHAR_DATA_ATTR_INDEX, DEFAULT_ATTR } from './Buffer';
import { Terminal } from './Terminal'; import { Terminal } from './Terminal';
import { IBufferLine } from './Types'; import { IBufferLine } from './Types';
+1 -1
View File
@@ -7,7 +7,7 @@ import { assert } from 'chai';
import { IMouseZoneManager, IMouseZone } from './ui/Types'; import { IMouseZoneManager, IMouseZone } from './ui/Types';
import { ILinkMatcher, ITerminal, IBufferLine } from './Types'; import { ILinkMatcher, ITerminal, IBufferLine } from './Types';
import { Linkifier } from './Linkifier'; import { Linkifier } from './Linkifier';
import { MockBuffer, MockTerminal, TestTerminal } from './utils/TestUtils.test'; import { MockBuffer, MockTerminal, TestTerminal } from './ui/TestUtils.test';
import { CircularList } from './common/CircularList'; import { CircularList } from './common/CircularList';
import { BufferLine } from './BufferLine'; import { BufferLine } from './BufferLine';
+1 -1
View File
@@ -9,7 +9,7 @@ import { SelectionManager, SelectionMode } from './SelectionManager';
import { SelectionModel } from './SelectionModel'; import { SelectionModel } from './SelectionModel';
import { BufferSet } from './BufferSet'; import { BufferSet } from './BufferSet';
import { ITerminal, IBuffer, IBufferLine } from './Types'; import { ITerminal, IBuffer, IBufferLine } from './Types';
import { MockTerminal } from './utils/TestUtils.test'; import { MockTerminal } from './ui/TestUtils.test';
import { BufferLine } from './BufferLine'; import { BufferLine } from './BufferLine';
class TestMockTerminal extends MockTerminal { class TestMockTerminal extends MockTerminal {
+1 -1
View File
@@ -5,7 +5,7 @@
import { ITerminal, ISelectionManager, IBuffer, CharData, IBufferLine } from './Types'; import { ITerminal, ISelectionManager, IBuffer, CharData, IBufferLine } from './Types';
import { XtermListener } from './common/Types'; import { XtermListener } from './common/Types';
import { MouseHelper } from './utils/MouseHelper'; import { MouseHelper } from './ui/MouseHelper';
import * as Browser from './core/Platform'; import * as Browser from './core/Platform';
import { CharMeasure } from './ui/CharMeasure'; import { CharMeasure } from './ui/CharMeasure';
import { EventEmitter } from './common/EventEmitter'; import { EventEmitter } from './common/EventEmitter';
+1 -1
View File
@@ -7,7 +7,7 @@ import { assert } from 'chai';
import { ITerminal } from './Types'; import { ITerminal } from './Types';
import { SelectionModel } from './SelectionModel'; import { SelectionModel } from './SelectionModel';
import { BufferSet } from './BufferSet'; import { BufferSet } from './BufferSet';
import { MockTerminal } from './utils/TestUtils.test'; import { MockTerminal } from './ui/TestUtils.test';
class TestSelectionModel extends SelectionModel { class TestSelectionModel extends SelectionModel {
constructor( constructor(
+1 -1
View File
@@ -5,7 +5,7 @@
import { assert, expect } from 'chai'; import { assert, expect } from 'chai';
import { Terminal } from './Terminal'; import { Terminal } from './Terminal';
import { MockViewport, MockCompositionHelper, MockRenderer } from './utils/TestUtils.test'; import { MockViewport, MockCompositionHelper, MockRenderer } from './ui/TestUtils.test';
import { CHAR_DATA_CHAR_INDEX, CHAR_DATA_WIDTH_INDEX, DEFAULT_ATTR } from './Buffer'; import { CHAR_DATA_CHAR_INDEX, CHAR_DATA_WIDTH_INDEX, DEFAULT_ATTR } from './Buffer';
const INIT_COLS = 80; const INIT_COLS = 80;
+2 -2
View File
@@ -39,8 +39,7 @@ import { CharMeasure } from './ui/CharMeasure';
import * as Browser from './core/Platform'; import * as Browser from './core/Platform';
import { addDisposableDomListener } from './ui/Lifecycle'; import { addDisposableDomListener } from './ui/Lifecycle';
import * as Strings from './Strings'; import * as Strings from './Strings';
import { MouseHelper } from './utils/MouseHelper'; import { MouseHelper } from './ui/MouseHelper';
import { clone } from './utils/Clone';
import { DEFAULT_BELL_SOUND, SoundManager } from './SoundManager'; import { DEFAULT_BELL_SOUND, SoundManager } from './SoundManager';
import { DEFAULT_ANSI_COLORS } from './renderer/ColorManager'; import { DEFAULT_ANSI_COLORS } from './renderer/ColorManager';
import { MouseZoneManager } from './ui/MouseZoneManager'; import { MouseZoneManager } from './ui/MouseZoneManager';
@@ -52,6 +51,7 @@ import { DomRenderer } from './renderer/dom/DomRenderer';
import { IKeyboardEvent } from './common/Types'; import { IKeyboardEvent } from './common/Types';
import { evaluateKeyboardEvent } from './core/input/Keyboard'; import { evaluateKeyboardEvent } from './core/input/Keyboard';
import { KeyboardResultType, ICharset } from './core/Types'; import { KeyboardResultType, ICharset } from './core/Types';
import { clone } from './common/Clone';
// Let it work inside Node.js for automated testing purposes. // Let it work inside Node.js for automated testing purposes.
const document = (typeof window !== 'undefined') ? window.document : null; const document = (typeof window !== 'undefined') ? window.document : null;
@@ -101,7 +101,7 @@ describe('clone', () => {
test.a.b.c.d.e.f = 'bar'; test.a.b.c.d.e.f = 'bar';
// The values at a greater depth then 5 should not be cloned // The values at a greater depth then 5 should not be cloned
assert.equal(cloned.a.b.c.d.e.f, 'bar'); assert.equal((cloned as any).a.b.c.d.e.f, 'bar');
}); });
it('should allow an optional maximum depth to be set', () => { it('should allow an optional maximum depth to be set', () => {
@@ -118,7 +118,7 @@ describe('clone', () => {
test.a.b.c = 'bar'; test.a.b.c = 'bar';
// The values at a greater depth then 2 should not be cloned // The values at a greater depth then 2 should not be cloned
assert.equal(cloned.a.b.c, 'bar'); assert.equal((cloned as any).a.b.c, 'bar');
}); });
it('should not throw when cloning a recursive reference', () => { it('should not throw when cloning a recursive reference', () => {
+2 -2
View File
@@ -6,7 +6,7 @@
/* /*
* A simple utility for cloning values * A simple utility for cloning values
*/ */
export const clone = <T>(val: T, depth: number = 5): T => { export function clone<T>(val: T, depth: number = 5): T | null {
if (typeof val !== 'object') { if (typeof val !== 'object') {
return val; return val;
} }
@@ -25,4 +25,4 @@ export const clone = <T>(val: T, depth: number = 5): T => {
} }
return clonedObject as T; return clonedObject as T;
}; }
+1 -1
View File
@@ -1,6 +1,6 @@
import { assert } from 'chai'; import { assert } from 'chai';
import { MockTerminal, MockBuffer } from '../utils/TestUtils.test'; import { MockTerminal, MockBuffer } from '../ui/TestUtils.test';
import { CircularList } from '../common/CircularList'; import { CircularList } from '../common/CircularList';
import { ICharacterJoinerRegistry } from './Types'; import { ICharacterJoinerRegistry } from './Types';