@vscode/base-node
Advanced tools
Comparing version 0.1.15-6 to 0.1.15-7
@@ -5,3 +5,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; | ||
import Event, { Emitter } from 'vs/base/common/event'; | ||
import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; | ||
export interface ITelemetryData { | ||
from?: string; | ||
target?: string; | ||
[key: string]: any; | ||
} | ||
export interface IAction extends IDisposable { | ||
@@ -80,2 +84,3 @@ id: string; | ||
run(action: IAction, context?: any): TPromise<any>; | ||
protected runAction(action: IAction, context?: any): TPromise<any>; | ||
} |
/** | ||
* Returns the last element of an array. | ||
* @param array The array. | ||
* @param n Which element from the end (default ist zero). | ||
* @param n Which element from the end (default is zero). | ||
*/ | ||
@@ -16,2 +16,19 @@ export declare function tail<T>(array: T[], n?: number): T; | ||
/** | ||
* Like `Array#sort` but always stable. Usually runs a little slower `than Array#sort` | ||
* so only use this when actually needing stable sort. | ||
*/ | ||
export declare function mergeSort<T>(data: T[], compare: (a: T, b: T) => number): T[]; | ||
export declare function groupBy<T>(data: T[], compare: (a: T, b: T) => number): T[][]; | ||
/** | ||
* Takes two *sorted* arrays and computes their delta (removed, added elements). | ||
* Finishes in `Math.min(before.length, after.length)` steps. | ||
* @param before | ||
* @param after | ||
* @param compare | ||
*/ | ||
export declare function delta<T>(before: T[], after: T[], compare: (a: T, b: T) => number): { | ||
removed: T[]; | ||
added: T[]; | ||
}; | ||
/** | ||
* Returns the top N elements from the array. | ||
@@ -63,1 +80,6 @@ * | ||
export declare function insert<T>(array: T[], element: T): () => void; | ||
/** | ||
* Insert `insertArr` inside `target` at `insertIndex`. | ||
* Please don't touch unless you understand https://jsperf.com/inserting-an-array-within-an-array | ||
*/ | ||
export declare function arrayInsert<T>(target: T[], insertIndex: number, insertArr: T[]): T[]; |
import { Promise, TPromise } from 'vs/base/common/winjs.base'; | ||
import { CancellationToken } from 'vs/base/common/cancellation'; | ||
import { Disposable } from 'vs/base/common/lifecycle'; | ||
import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; | ||
import Event from 'vs/base/common/event'; | ||
import URI from 'vs/base/common/uri'; | ||
export declare function toThenable<T>(arg: T | Thenable<T>): Thenable<T>; | ||
@@ -145,2 +146,3 @@ export declare function asWinJsPromise<T>(callback: (token: CancellationToken) => T | TPromise<T> | Thenable<T>): TPromise<T>; | ||
readonly onFinished: Event<void>; | ||
readonly size: number; | ||
queue(promiseFactory: ITask<Promise>): Promise; | ||
@@ -157,2 +159,12 @@ private consume(); | ||
} | ||
/** | ||
* A helper to organize queues per resource. The ResourceQueue makes sure to manage queues per resource | ||
* by disposing them once the queue is empty. | ||
*/ | ||
export declare class ResourceQueue<T> { | ||
private queues; | ||
constructor(); | ||
queueFor(resource: URI): Queue<void>; | ||
} | ||
export declare function setDisposableTimeout(handler: Function, timeout: number, ...args: any[]): IDisposable; | ||
export declare class TimeoutTimer extends Disposable { | ||
@@ -159,0 +171,0 @@ private _token; |
@@ -16,16 +16,12 @@ export declare class RGBA { | ||
/** | ||
* Alpha: integer in [0-255] | ||
* Alpha: float in [0-1] | ||
*/ | ||
readonly a: number; | ||
constructor(r: number, g: number, b: number, a: number); | ||
constructor(r: number, g: number, b: number, a?: number); | ||
static equals(a: RGBA, b: RGBA): boolean; | ||
private static _clampInt_0_255(c); | ||
} | ||
/** | ||
* http://en.wikipedia.org/wiki/HSL_color_space | ||
*/ | ||
export declare class HSLA { | ||
_hslaBrand: void; | ||
/** | ||
* Hue: float in [0, 360] | ||
* Hue: integer in [0, 360] | ||
*/ | ||
@@ -46,15 +42,50 @@ readonly h: number; | ||
constructor(h: number, s: number, l: number, a: number); | ||
private static _clampFloat_0_360(hue); | ||
private static _clampFloat_0_1(n); | ||
static equals(a: HSLA, b: HSLA): boolean; | ||
/** | ||
* Converts an RGB color value to HSL. Conversion formula | ||
* adapted from http://en.wikipedia.org/wiki/HSL_color_space. | ||
* Assumes r, g, and b are contained in the set [0, 255] and | ||
* returns h in the set [0, 360], s, and l in the set [0, 1]. | ||
*/ | ||
static fromRGBA(rgba: RGBA): HSLA; | ||
private static _hue2rgb(p, q, t); | ||
/** | ||
* Converts an HSL color value to RGB. Conversion formula | ||
* adapted from http://en.wikipedia.org/wiki/HSL_color_space. | ||
* Assumes h in the set [0, 360] s, and l are contained in the set [0, 1] and | ||
* returns r, g, and b in the set [0, 255]. | ||
*/ | ||
static toRGBA(hsla: HSLA): RGBA; | ||
} | ||
export declare class Color { | ||
static fromRGBA(rgba: RGBA): Color; | ||
export declare class HSVA { | ||
_hsvaBrand: void; | ||
/** | ||
* Creates a color from a hex string (#RRGGBB or #RRGGBBAA). | ||
* Hue: integer in [0, 360] | ||
*/ | ||
readonly h: number; | ||
/** | ||
* Saturation: float in [0, 1] | ||
*/ | ||
readonly s: number; | ||
/** | ||
* Value: float in [0, 1] | ||
*/ | ||
readonly v: number; | ||
/** | ||
* Alpha: float in [0, 1] | ||
*/ | ||
readonly a: number; | ||
constructor(h: number, s: number, v: number, a: number); | ||
static equals(a: HSVA, b: HSVA): boolean; | ||
static fromRGBA(rgba: RGBA): HSVA; | ||
static toRGBA(hsva: HSVA): RGBA; | ||
} | ||
export declare class Color { | ||
static fromHex(hex: string): Color; | ||
static fromHSLA(hsla: HSLA): Color; | ||
private readonly rgba; | ||
private hsla; | ||
private constructor(arg); | ||
readonly rgba: RGBA; | ||
private _hsla; | ||
readonly hsla: HSLA; | ||
private _hsva; | ||
readonly hsva: HSVA; | ||
constructor(arg: RGBA | HSLA | HSVA); | ||
equals(other: Color): boolean; | ||
@@ -65,4 +96,4 @@ /** | ||
*/ | ||
getLuminosity(): number; | ||
private static _luminosityFor(color); | ||
getRelativeLuminance(): number; | ||
private static _relativeLuminanceForComponent(color); | ||
/** | ||
@@ -72,3 +103,3 @@ * http://www.w3.org/TR/WCAG20/#contrast-ratiodef | ||
*/ | ||
getContrast(another: Color): number; | ||
getContrastRatio(another: Color): number; | ||
/** | ||
@@ -89,17 +120,46 @@ * http://24ways.org/2010/calculating-color-contrast | ||
transparent(factor: number): Color; | ||
isTransparent(): boolean; | ||
isOpaque(): boolean; | ||
opposite(): Color; | ||
blend(c: Color): Color; | ||
toString(): string; | ||
/** | ||
* Prins the color as #RRGGBB | ||
*/ | ||
toRGBHex(): string; | ||
/** | ||
* Prins the color as #RRGGBBAA | ||
*/ | ||
toRGBAHex(): string; | ||
private static _toTwoDigitHex(n); | ||
toHSLA(): HSLA; | ||
toRGBA(): RGBA; | ||
static getLighterColor(of: Color, relative: Color, factor?: number): Color; | ||
static getDarkerColor(of: Color, relative: Color, factor?: number): Color; | ||
static readonly white: Color; | ||
static readonly black: Color; | ||
static readonly red: Color; | ||
static readonly blue: Color; | ||
static readonly green: Color; | ||
static readonly cyan: Color; | ||
static readonly lightgrey: Color; | ||
static readonly transparent: Color; | ||
} | ||
export declare namespace Color { | ||
namespace Format { | ||
namespace CSS { | ||
function formatRGB(color: Color): string; | ||
function formatRGBA(color: Color): string; | ||
function formatHSL(color: Color): string; | ||
function formatHSLA(color: Color): string; | ||
/** | ||
* Formats the color as #RRGGBB | ||
*/ | ||
function formatHex(color: Color): string; | ||
/** | ||
* Formats the color as #RRGGBBAA | ||
* If 'compact' is set, colors without transparancy will be printed as #RRGGBB | ||
*/ | ||
function formatHexA(color: Color, compact?: boolean): string; | ||
/** | ||
* The default format will use HEX if opaque and RGBA otherwise. | ||
*/ | ||
function format(color: Color): string | null; | ||
/** | ||
* Converts an Hex color value to a Color. | ||
* returns r, g, and b are contained in the set [0, 255] | ||
* @param hex string (#RGB, #RGBA, #RRGGBB or #RRGGBBAA). | ||
*/ | ||
function parseHex(hex: string): Color | null; | ||
} | ||
} | ||
} |
export declare function setFileNameComparer(collator: Intl.Collator): void; | ||
export declare function compareFileNames(one: string, other: string): number; | ||
export declare function noIntlCompareFileNames(one: string, other: string): number; | ||
export declare function compareFileExtensions(one: string, other: string): number; | ||
export declare function comparePaths(one: string, other: string): number; | ||
export declare function compareAnything(one: string, other: string, lookFor: string): number; | ||
@@ -5,0 +7,0 @@ export declare function compareByPrefix(one: string, other: string, lookFor: string): number; |
@@ -0,1 +1,2 @@ | ||
export declare function createDecorator(mapFn: (fn: Function) => Function): Function; | ||
export declare function memoize(target: any, key: string, descriptor: any): void; |
@@ -1,2 +0,2 @@ | ||
export declare function stringDiff(original: string, modified: string): IDiffChange[]; | ||
export declare function stringDiff(original: string, modified: string, pretty: boolean): IDiffChange[]; | ||
export interface ISequence { | ||
@@ -70,3 +70,5 @@ getLength(): number; | ||
private ElementsAreEqual(originalIndex, newIndex); | ||
ComputeDiff(): IDiffChange[]; | ||
private OriginalElementsAreEqual(index1, index2); | ||
private ModifiedElementsAreEqual(index1, index2); | ||
ComputeDiff(pretty: boolean): IDiffChange[]; | ||
/** | ||
@@ -77,3 +79,3 @@ * Computes the differences between the original and modified input | ||
*/ | ||
private _ComputeDiff(originalStart, originalEnd, modifiedStart, modifiedEnd); | ||
private _ComputeDiff(originalStart, originalEnd, modifiedStart, modifiedEnd, pretty); | ||
/** | ||
@@ -104,2 +106,16 @@ * Private helper method which computes the differences on the bounded range | ||
/** | ||
* Shifts the given changes to provide a more intuitive diff. | ||
* While the first element in a diff matches the first element after the diff, | ||
* we shift the diff down. | ||
* | ||
* @param changes The list of changes to shift | ||
* @returns The shifted changes | ||
*/ | ||
private ShiftChanges(changes); | ||
private _OriginalIsBoundary(index); | ||
private _OriginalRegionIsBoundary(originalStart, originalLength); | ||
private _ModifiedIsBoundary(index); | ||
private _ModifiedRegionIsBoundary(modifiedStart, modifiedLength); | ||
private _boundaryScore(originalStart, originalLength, modifiedStart, modifiedLength); | ||
/** | ||
* Concatenates the two input DiffChange lists and returns the resulting | ||
@@ -106,0 +122,0 @@ * list. |
export interface ISequence { | ||
getLength(): number; | ||
getElementHash(index: number): string; | ||
[index: number]: string; | ||
} | ||
@@ -5,0 +6,0 @@ export interface IDiffChange { |
@@ -1,2 +0,7 @@ | ||
import { IXHRResponse } from 'vs/base/common/http'; | ||
export interface IXHRResponse { | ||
responseText: string; | ||
status: number; | ||
readyState: number; | ||
getResponseHeader: (header: string) => string; | ||
} | ||
export interface IConnectionErrorData { | ||
@@ -3,0 +8,0 @@ status: number; |
@@ -22,8 +22,31 @@ import { IAction } from 'vs/base/common/actions'; | ||
} | ||
export declare let errorHandler: ErrorHandler; | ||
export declare const errorHandler: ErrorHandler; | ||
export declare function setUnexpectedErrorHandler(newUnexpectedErrorHandler: (e: any) => void): void; | ||
export declare function onUnexpectedError(e: any): void; | ||
export declare function onUnexpectedExternalError(e: any): void; | ||
export declare function onUnexpectedPromiseError<T>(promise: TPromise<T>): TPromise<T>; | ||
export declare function onUnexpectedError(e: any): undefined; | ||
export declare function onUnexpectedExternalError(e: any): undefined; | ||
export declare function onUnexpectedPromiseError<T>(promise: TPromise<T>): TPromise<T | void>; | ||
export interface SerializedError { | ||
readonly $isError: true; | ||
readonly name: string; | ||
readonly message: string; | ||
readonly stack: string; | ||
} | ||
export declare function transformErrorForSerialization(error: Error): SerializedError; | ||
export declare function transformErrorForSerialization(error: any): any; | ||
export interface V8CallSite { | ||
getThis(): any; | ||
getTypeName(): string; | ||
getFunction(): string; | ||
getFunctionName(): string; | ||
getMethodName(): string; | ||
getFileName(): string; | ||
getLineNumber(): number; | ||
getColumnNumber(): number; | ||
getEvalOrigin(): string; | ||
isToplevel(): boolean; | ||
isEval(): boolean; | ||
isNative(): boolean; | ||
isConstructor(): boolean; | ||
toString(): string; | ||
} | ||
/** | ||
@@ -44,2 +67,3 @@ * Checks if the given error is a promise in canceled state | ||
export declare function readonly(name?: string): Error; | ||
export declare function disposed(what: string): Error; | ||
export interface IErrorOptions { | ||
@@ -46,0 +70,0 @@ severity?: Severity; |
@@ -33,1 +33,5 @@ export interface IFilter { | ||
export declare function matchesFuzzy(word: string, wordToMatchAgainst: string, enableSeparateSubstringMatching?: boolean): IMatch[]; | ||
export declare function createMatches(position: number[]): IMatch[]; | ||
export declare function fuzzyScore(pattern: string, word: string, patternMaxWhitespaceIgnore?: number): [number, number[]]; | ||
export declare function nextTypoPermutation(pattern: string, patternPos: number): string; | ||
export declare function fuzzyScoreGraceful(pattern: string, word: string): [number, number[]]; |
@@ -0,4 +1,7 @@ | ||
import { TPromise } from 'vs/base/common/winjs.base'; | ||
export interface IExpression { | ||
[pattern: string]: boolean | SiblingClause | any; | ||
} | ||
export declare function getEmptyExpression(): IExpression; | ||
export declare function mergeExpressions(...expressions: IExpression[]): IExpression; | ||
export interface SiblingClause { | ||
@@ -9,4 +12,7 @@ when: string; | ||
export declare type ParsedPattern = (path: string, basename?: string) => boolean; | ||
export declare type ParsedExpression = (path: string, basename?: string, siblingsFn?: () => string[]) => string; | ||
export declare type ParsedExpression = (path: string, basename?: string, siblingsFn?: () => string[] | TPromise<string[]>) => string | TPromise<string>; | ||
export interface IGlobOptions { | ||
/** | ||
* Simplify patterns for use as exclusion filters during tree traversal to skip entire subtrees. Cannot be used outside of a tree traversal. | ||
*/ | ||
trimForExclusions?: boolean; | ||
@@ -34,3 +40,7 @@ } | ||
export declare function parse(expression: IExpression, options?: IGlobOptions): ParsedExpression; | ||
/** | ||
* Same as `parse`, but the ParsedExpression is guaranteed to return a Promise | ||
*/ | ||
export declare function parseToAsync(expression: IExpression, options?: IGlobOptions): ParsedExpression; | ||
export declare function getBasenameTerms(patternOrExpression: ParsedPattern | ParsedExpression): string[]; | ||
export declare function getPathTerms(patternOrExpression: ParsedPattern | ParsedExpression): string[]; |
@@ -7,3 +7,5 @@ import { INavigator } from 'vs/base/common/iterator'; | ||
constructor(history?: T[], limit?: number); | ||
getHistory(): T[]; | ||
add(t: T): void; | ||
addIfNotPresent(t: T): void; | ||
next(): T; | ||
@@ -17,2 +19,4 @@ previous(): T; | ||
private _reduceToLimit(); | ||
private _initialize(history); | ||
private readonly _elements; | ||
} |
@@ -1,33 +0,17 @@ | ||
/** | ||
* MarkedString can be used to render human readable text. It is either a markdown string | ||
* or a code-block that provides a language and a code snippet. Note that | ||
* markdown strings will be sanitized - that means html will be escaped. | ||
*/ | ||
export declare type MarkedString = string | { | ||
readonly language: string; | ||
readonly value: string; | ||
}; | ||
export interface IHTMLContentElementCode { | ||
language: string; | ||
export interface IMarkdownString { | ||
value: string; | ||
isTrusted?: boolean; | ||
} | ||
export declare function markedStringsEquals(a: MarkedString | MarkedString[], b: MarkedString | MarkedString[]): boolean; | ||
export declare function textToMarkedString(text: string): MarkedString; | ||
export declare class MarkdownString implements IMarkdownString { | ||
value: string; | ||
isTrusted?: boolean; | ||
constructor(value?: string); | ||
appendText(value: string): MarkdownString; | ||
appendMarkdown(value: string): MarkdownString; | ||
appendCodeblock(langId: string, code: string): MarkdownString; | ||
} | ||
export declare function isEmptyMarkdownString(oneOrMany: IMarkdownString | IMarkdownString[]): boolean; | ||
export declare function isMarkdownString(thing: any): thing is IMarkdownString; | ||
export declare function markedStringsEquals(a: IMarkdownString | IMarkdownString[], b: IMarkdownString | IMarkdownString[]): boolean; | ||
export declare function removeMarkdownEscapes(text: string): string; | ||
export interface IHTMLContentElement { | ||
/** | ||
* supports **bold**, __italics__, and [[actions]] | ||
*/ | ||
formattedText?: string; | ||
text?: string; | ||
className?: string; | ||
style?: string; | ||
customStyle?: any; | ||
tagName?: string; | ||
children?: IHTMLContentElement[]; | ||
isText?: boolean; | ||
role?: string; | ||
markdown?: string; | ||
code?: IHTMLContentElementCode; | ||
} | ||
export declare function htmlContentElementArrEquals(a: IHTMLContentElement[], b: IHTMLContentElement[]): boolean; | ||
export declare function containsCommandLink(value: string): boolean; |
@@ -8,2 +8,3 @@ export declare enum ScanError { | ||
InvalidEscapeCharacter = 5, | ||
InvalidCharacter = 6, | ||
} | ||
@@ -91,3 +92,2 @@ export declare enum SyntaxKind { | ||
} | ||
export declare function getParseErrorMessage(errorCode: ParseErrorCode): string; | ||
export declare type NodeType = 'object' | 'array' | 'property' | 'string' | 'number' | 'boolean' | 'null'; | ||
@@ -94,0 +94,0 @@ export interface Node { |
@@ -38,2 +38,3 @@ export interface IJSONSchema { | ||
errorMessage?: string; | ||
patternErrorMessage?: string; | ||
deprecationMessage?: string; | ||
@@ -40,0 +41,0 @@ enumDescriptions?: string[]; |
@@ -0,1 +1,2 @@ | ||
import { OperatingSystem } from 'vs/base/common/platform'; | ||
/** | ||
@@ -170,21 +171,19 @@ * Virtual Key Codes, the value does not hold any inherent meaning. | ||
/** | ||
* Cover all key codes when IME is processing input. | ||
*/ | ||
KEY_IN_COMPOSITION = 109, | ||
ABNT_C1 = 110, | ||
ABNT_C2 = 111, | ||
/** | ||
* Placed last to cover the length of the enum. | ||
* Please do not depend on this value! | ||
*/ | ||
MAX_VALUE = 109, | ||
MAX_VALUE = 112, | ||
} | ||
export interface IReverseMap { | ||
[str: string]: KeyCode; | ||
} | ||
export declare class Mapping { | ||
_fromKeyCode: string[]; | ||
_toKeyCode: IReverseMap; | ||
constructor(fromKeyCode: string[], toKeyCode: IReverseMap); | ||
fromKeyCode(keyCode: KeyCode): string; | ||
toKeyCode(str: string): KeyCode; | ||
} | ||
export declare let USER_SETTINGS: Mapping; | ||
export declare namespace KeyCodeUtils { | ||
function toString(key: KeyCode): string; | ||
function toString(keyCode: KeyCode): string; | ||
function fromString(key: string): KeyCode; | ||
function toUserSettingsUS(keyCode: KeyCode): string; | ||
function toUserSettingsGeneral(keyCode: KeyCode): string; | ||
function fromUserSettings(key: string): KeyCode; | ||
} | ||
@@ -198,23 +197,77 @@ export declare const enum KeyMod { | ||
export declare function KeyChord(firstPart: number, secondPart: number): number; | ||
export declare class BinaryKeybindings { | ||
static extractFirstPart(keybinding: number): number; | ||
static extractChordPart(keybinding: number): number; | ||
static hasChord(keybinding: number): boolean; | ||
static hasCtrlCmd(keybinding: number): boolean; | ||
static hasShift(keybinding: number): boolean; | ||
static hasAlt(keybinding: number): boolean; | ||
static hasWinCtrl(keybinding: number): boolean; | ||
static isModifierKey(keybinding: number): boolean; | ||
static extractKeyCode(keybinding: number): KeyCode; | ||
export declare function createKeybinding(keybinding: number, OS: OperatingSystem): Keybinding; | ||
export declare function createSimpleKeybinding(keybinding: number, OS: OperatingSystem): SimpleKeybinding; | ||
export declare const enum KeybindingType { | ||
Simple = 1, | ||
Chord = 2, | ||
} | ||
export declare class Keybinding { | ||
value: number; | ||
constructor(keybinding: number); | ||
export declare class SimpleKeybinding { | ||
readonly type: KeybindingType; | ||
readonly ctrlKey: boolean; | ||
readonly shiftKey: boolean; | ||
readonly altKey: boolean; | ||
readonly metaKey: boolean; | ||
readonly keyCode: KeyCode; | ||
constructor(ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean, keyCode: KeyCode); | ||
equals(other: Keybinding): boolean; | ||
hasCtrlCmd(): boolean; | ||
hasShift(): boolean; | ||
hasAlt(): boolean; | ||
hasWinCtrl(): boolean; | ||
isModifierKey(): boolean; | ||
getKeyCode(): KeyCode; | ||
/** | ||
* Does this keybinding refer to the key code of a modifier and it also has the modifier flag? | ||
*/ | ||
isDuplicateModifierCase(): boolean; | ||
} | ||
export declare class ChordKeybinding { | ||
readonly type: KeybindingType; | ||
readonly firstPart: SimpleKeybinding; | ||
readonly chordPart: SimpleKeybinding; | ||
constructor(firstPart: SimpleKeybinding, chordPart: SimpleKeybinding); | ||
} | ||
export declare type Keybinding = SimpleKeybinding | ChordKeybinding; | ||
export declare class ResolvedKeybindingPart { | ||
readonly ctrlKey: boolean; | ||
readonly shiftKey: boolean; | ||
readonly altKey: boolean; | ||
readonly metaKey: boolean; | ||
readonly keyLabel: string; | ||
readonly keyAriaLabel: string; | ||
constructor(ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean, kbLabel: string, kbAriaLabel: string); | ||
} | ||
/** | ||
* A resolved keybinding. Can be a simple keybinding or a chord keybinding. | ||
*/ | ||
export declare abstract class ResolvedKeybinding { | ||
/** | ||
* This prints the binding in a format suitable for displaying in the UI. | ||
*/ | ||
abstract getLabel(): string; | ||
/** | ||
* This prints the binding in a format suitable for ARIA. | ||
*/ | ||
abstract getAriaLabel(): string; | ||
/** | ||
* This prints the binding in a format suitable for electron's accelerators. | ||
* See https://github.com/electron/electron/blob/master/docs/api/accelerator.md | ||
*/ | ||
abstract getElectronAccelerator(): string; | ||
/** | ||
* This prints the binding in a format suitable for user settings. | ||
*/ | ||
abstract getUserSettingsLabel(): string; | ||
/** | ||
* Is the user settings label reflecting the label? | ||
*/ | ||
abstract isWYSIWYG(): boolean; | ||
/** | ||
* Is the binding a chord? | ||
*/ | ||
abstract isChord(): boolean; | ||
/** | ||
* Returns the firstPart, chordPart that should be used for dispatching. | ||
*/ | ||
abstract getDispatchParts(): [string, string]; | ||
/** | ||
* Returns the firstPart, chordPart of the keybinding. | ||
* For simple keybindings, the second element will be null. | ||
*/ | ||
abstract getParts(): [ResolvedKeybindingPart, ResolvedKeybindingPart]; | ||
} |
@@ -8,18 +8,13 @@ import URI from 'vs/base/common/uri'; | ||
} | ||
export interface IWorkspaceProvider { | ||
export interface IRootProvider { | ||
getRoot(resource: URI): URI; | ||
getWorkspace(): { | ||
resource: URI; | ||
roots: URI[]; | ||
}; | ||
} | ||
export declare class PathLabelProvider implements ILabelProvider { | ||
private root; | ||
constructor(arg1?: URI | string | IWorkspaceProvider); | ||
getLabel(arg1: URI | string | IWorkspaceProvider): string; | ||
export interface IUserHomeProvider { | ||
userHome: string; | ||
} | ||
export declare function getPathLabel(resource: URI | string, basePathProvider?: URI | string | IWorkspaceProvider): string; | ||
/** | ||
* Shortens the paths but keeps them easy to distinguish. | ||
* Replaces not important parts with ellipsis. | ||
* Every shorten path matches only one original path and vice versa. | ||
*/ | ||
export declare function getPathLabel(resource: URI | string, rootProvider?: IRootProvider, userHomeProvider?: IUserHomeProvider): string; | ||
export declare function tildify(path: string, userHome: string): string; | ||
export declare function shorten(paths: string[]): string[]; | ||
@@ -38,1 +33,16 @@ export interface ISeparator { | ||
}): string; | ||
/** | ||
* Handles mnemonics for menu items. Depending on OS: | ||
* - Windows: Supported via & character (replace && with &) | ||
* - Linux: Supported via & character (replace && with &) | ||
* - macOS: Unsupported (replace && with empty string) | ||
*/ | ||
export declare function mnemonicMenuLabel(label: string, forceDisableMnemonics?: boolean): string; | ||
/** | ||
* Handles mnemonics for buttons. Depending on OS: | ||
* - Windows: Supported via & character (replace && with &) | ||
* - Linux: Supported via _ character (replace && with _) | ||
* - macOS: Unsupported (replace && with empty string) | ||
*/ | ||
export declare function mnemonicButtonLabel(label: string): string; | ||
export declare function unmnemonicLabel(label: string): string; |
@@ -1,4 +0,4 @@ | ||
export declare let MIME_TEXT: string; | ||
export declare let MIME_BINARY: string; | ||
export declare let MIME_UNKNOWN: string; | ||
export declare const MIME_TEXT = "text/plain"; | ||
export declare const MIME_BINARY = "application/octet-stream"; | ||
export declare const MIME_UNKNOWN = "application/unknown"; | ||
export interface ITextMimeAssociation { | ||
@@ -5,0 +5,0 @@ id: string; |
@@ -1,2 +0,1 @@ | ||
import { TPromise } from 'vs/base/common/winjs.base'; | ||
export declare namespace Schemas { | ||
@@ -29,12 +28,1 @@ /** | ||
} | ||
export interface IXHROptions { | ||
type?: string; | ||
url?: string; | ||
user?: string; | ||
password?: string; | ||
responseType?: string; | ||
headers?: any; | ||
customRequestInitializer?: (req: any) => void; | ||
data?: any; | ||
} | ||
export declare function xhr(options: IXHROptions): TPromise<XMLHttpRequest>; |
@@ -10,4 +10,4 @@ export declare function clone<T>(obj: T): T; | ||
export declare function assign(destination: any, ...sources: any[]): any; | ||
export declare function toObject<T, R>(arr: T[], keyMap: (T) => string, valueMap?: (T) => R): { | ||
[key: string]: R; | ||
export declare function toObject<T>(arr: T[], keyMap: (t: T) => string): { | ||
[key: string]: T; | ||
}; | ||
@@ -35,1 +35,15 @@ export declare function equals(one: any, other: any): boolean; | ||
export declare function getOrDefault<T, R>(obj: T, fn: (obj: T) => R, defaultValue?: R): R; | ||
/** | ||
* Returns an object that has keys for each value that is different in the base object. Keys | ||
* that do not exist in the target but in the base object are not considered. | ||
* | ||
* Note: This is not a deep-diffing method, so the values are strictly taken into the resulting | ||
* object if they differ. | ||
* | ||
* @param base the object to diff against | ||
* @param obj the object to use for diffing | ||
*/ | ||
export declare type obj = { | ||
[key: string]: any; | ||
}; | ||
export declare function distinct(base: obj, target: obj): obj; |
@@ -16,12 +16,25 @@ import { IStringDictionary } from 'vs/base/common/collections'; | ||
} | ||
export interface ILogger { | ||
log(value: string): void; | ||
export interface IProblemReporter { | ||
info(message: string): void; | ||
warn(message: string): void; | ||
error(message: string): void; | ||
fatal(message: string): void; | ||
status: ValidationStatus; | ||
} | ||
export declare class NullProblemReporter implements IProblemReporter { | ||
info(message: string): void; | ||
warn(message: string): void; | ||
error(message: string): void; | ||
fatal(message: string): void; | ||
status: ValidationStatus; | ||
} | ||
export declare abstract class Parser { | ||
private _logger; | ||
private validationStatus; | ||
constructor(logger: ILogger, validationStatus?: ValidationStatus); | ||
readonly logger: ILogger; | ||
readonly status: ValidationStatus; | ||
protected log(message: string): void; | ||
private _problemReporter; | ||
constructor(problemReporter: IProblemReporter); | ||
reset(): void; | ||
readonly problemReporter: IProblemReporter; | ||
info(message: string): void; | ||
warn(message: string): void; | ||
error(message: string): void; | ||
fatal(message: string): void; | ||
protected is(value: any, func: (value: any) => boolean, wrongTypeState?: ValidationState, wrongTypeMessage?: string, undefinedState?: ValidationState, undefinedMessage?: string): boolean; | ||
@@ -28,0 +41,0 @@ protected static merge<T>(destination: T, source: T, overwrite: boolean): void; |
@@ -38,4 +38,10 @@ /** | ||
export declare function isUNC(path: string): boolean; | ||
export declare function makePosixAbsolute(path: string): string; | ||
export declare function isEqualOrParent(path: string, candidate: string): boolean; | ||
export declare function isValidBasename(name: string): boolean; | ||
export declare function isEqual(pathA: string, pathB: string, ignoreCase?: boolean): boolean; | ||
export declare function isEqualOrParent(path: string, candidate: string, ignoreCase?: boolean): boolean; | ||
/** | ||
* Adapted from Node's path.isAbsolute functions | ||
*/ | ||
export declare function isAbsolute(path: string): boolean; | ||
export declare function isAbsolute_win32(path: string): boolean; | ||
export declare function isAbsolute_posix(path: string): boolean; |
import { IStringDictionary } from 'vs/base/common/collections'; | ||
import { ValidationStatus, ILogger, Parser } from 'vs/base/common/parsers'; | ||
import { IProblemReporter, Parser } from 'vs/base/common/parsers'; | ||
/** | ||
@@ -138,3 +138,3 @@ * Options to be passed to the external program or shell. | ||
export declare class ExecutableParser extends Parser { | ||
constructor(logger: ILogger, validationStatus?: ValidationStatus); | ||
constructor(logger: IProblemReporter); | ||
parse(json: Config.Executable, parserOptions?: ParserOptions): Executable; | ||
@@ -141,0 +141,0 @@ parseExecutable(json: Config.BaseExecutable, globals?: Executable): Executable; |
@@ -1,2 +0,2 @@ | ||
import { Disposable } from 'vs/base/common/lifecycle'; | ||
import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; | ||
import Event from 'vs/base/common/event'; | ||
@@ -22,3 +22,3 @@ export declare enum ScrollbarVisibility { | ||
} | ||
export declare class ScrollState { | ||
export declare class ScrollState implements IScrollDimensions, IScrollPosition { | ||
_scrollStateBrand: void; | ||
@@ -33,10 +33,30 @@ readonly width: number; | ||
equals(other: ScrollState): boolean; | ||
withScrollDimensions(update: INewScrollDimensions): ScrollState; | ||
withScrollPosition(update: INewScrollPosition): ScrollState; | ||
createScrollEvent(previous: ScrollState): ScrollEvent; | ||
} | ||
export interface INewScrollState { | ||
export interface IScrollDimensions { | ||
readonly width: number; | ||
readonly scrollWidth: number; | ||
readonly height: number; | ||
readonly scrollHeight: number; | ||
} | ||
export interface INewScrollDimensions { | ||
width?: number; | ||
scrollWidth?: number; | ||
scrollLeft?: number; | ||
height?: number; | ||
scrollHeight?: number; | ||
} | ||
export interface IScrollPosition { | ||
readonly scrollLeft: number; | ||
readonly scrollTop: number; | ||
} | ||
export interface ISmoothScrollPosition { | ||
readonly scrollLeft: number; | ||
readonly scrollTop: number; | ||
readonly width: number; | ||
readonly height: number; | ||
} | ||
export interface INewScrollPosition { | ||
scrollLeft?: number; | ||
scrollTop?: number; | ||
@@ -46,8 +66,55 @@ } | ||
_scrollableBrand: void; | ||
private _smoothScrollDuration; | ||
private readonly _scheduleAtNextAnimationFrame; | ||
private _state; | ||
private _smoothScrolling; | ||
private _onScroll; | ||
onScroll: Event<ScrollEvent>; | ||
constructor(); | ||
getState(): ScrollState; | ||
updateState(update: INewScrollState): void; | ||
constructor(smoothScrollDuration: number, scheduleAtNextAnimationFrame: (callback: () => void) => IDisposable); | ||
dispose(): void; | ||
setSmoothScrollDuration(smoothScrollDuration: number): void; | ||
validateScrollPosition(scrollPosition: INewScrollPosition): IScrollPosition; | ||
getScrollDimensions(): IScrollDimensions; | ||
setScrollDimensions(dimensions: INewScrollDimensions): void; | ||
/** | ||
* Returns the final scroll position that the instance will have once the smooth scroll animation concludes. | ||
* If no scroll animation is occuring, it will return the current scroll position instead. | ||
*/ | ||
getFutureScrollPosition(): IScrollPosition; | ||
/** | ||
* Returns the current scroll position. | ||
* Note: This result might be an intermediate scroll position, as there might be an ongoing smooth scroll animation. | ||
*/ | ||
getCurrentScrollPosition(): IScrollPosition; | ||
setScrollPositionNow(update: INewScrollPosition): void; | ||
setScrollPositionSmooth(update: INewScrollPosition): void; | ||
private _performSmoothScrolling(); | ||
private _setState(newState); | ||
} | ||
export declare class SmoothScrollingUpdate { | ||
readonly scrollLeft: number; | ||
readonly scrollTop: number; | ||
readonly isDone: boolean; | ||
constructor(scrollLeft: number, scrollTop: number, isDone: boolean); | ||
} | ||
export interface IAnimation { | ||
(completion: number): number; | ||
} | ||
export declare class SmoothScrollingOperation { | ||
readonly from: ISmoothScrollPosition; | ||
to: ISmoothScrollPosition; | ||
readonly duration: number; | ||
private readonly _startTime; | ||
animationFrameDisposable: IDisposable; | ||
private scrollLeft; | ||
private scrollTop; | ||
protected constructor(from: ISmoothScrollPosition, to: ISmoothScrollPosition, startTime: number, duration: number); | ||
private _initAnimations(); | ||
private _initAnimation(from, to, viewportSize); | ||
dispose(): void; | ||
acceptScrollDimensions(state: ScrollState): void; | ||
tick(): SmoothScrollingUpdate; | ||
protected _tick(now: number): SmoothScrollingUpdate; | ||
combine(from: ISmoothScrollPosition, to: ISmoothScrollPosition, duration: number): SmoothScrollingOperation; | ||
static start(from: ISmoothScrollPosition, to: ISmoothScrollPosition, duration: number): SmoothScrollingOperation; | ||
} |
@@ -14,5 +14,7 @@ import { IDisposable } from 'vs/base/common/lifecycle'; | ||
export interface IConfigOptions<T> { | ||
onError: (error: Error | string) => void; | ||
defaultConfig?: T; | ||
changeBufferDelay?: number; | ||
parse?: (content: string, errors: any[]) => T; | ||
initCallback?: (config: T) => void; | ||
} | ||
@@ -19,0 +21,0 @@ /** |
@@ -0,1 +1,2 @@ | ||
import { TPromise } from 'vs/base/common/winjs.base'; | ||
export declare const UTF8 = "utf8"; | ||
@@ -14,4 +15,14 @@ export declare const UTF8_with_bom = "utf8bom"; | ||
* Detects the Byte Order Mark in a given file. | ||
* If no BOM is detected, `encoding` will be null. | ||
* If no BOM is detected, null will be passed to callback. | ||
*/ | ||
export declare function detectEncodingByBOM(file: string, callback: (error: Error, encoding: string) => void): void; | ||
export declare function detectEncodingByBOM(file: string): TPromise<string>; | ||
/** | ||
* Guesses the encoding from buffer. | ||
*/ | ||
export declare function guessEncodingByBuffer(buffer: NodeBuffer): TPromise<string>; | ||
/** | ||
* The encodings that are allowed in a settings file don't match the canonical encoding labels specified by WHATWG. | ||
* See https://encoding.spec.whatwg.org/#names-and-labels | ||
* Iconv-lite strips all non-alphanumeric characters, but ripgrep doesn't. For backcompat, allow these labels. | ||
*/ | ||
export declare function toCanonicalName(enc: string): string; |
@@ -11,3 +11,2 @@ export declare function readdirSync(path: string): string[]; | ||
export declare function writeFileAndFlush(path: string, data: string | NodeBuffer, options: { | ||
encoding?: string; | ||
mode?: number; | ||
@@ -19,8 +18,10 @@ flag?: string; | ||
* | ||
* Given an absolute, normalized, and existing file path 'realpath' returns the exact path that the file has on disk. | ||
* Given an absolute, normalized, and existing file path 'realcase' returns the exact path that the file has on disk. | ||
* On a case insensitive file system, the returned path might differ from the original path by character casing. | ||
* On a case sensitive file system, the returned path will always be identical to the original path. | ||
* In case of errors, null is returned. But you cannot use this function to verify that a path exists. | ||
* realpathSync does not handle '..' or '.' path segments and it does not take the locale into account. | ||
* realcaseSync does not handle '..' or '.' path segments and it does not take the locale into account. | ||
*/ | ||
export declare function realcaseSync(path: string): string; | ||
export declare function realpathSync(path: string): string; | ||
export declare function realpath(path: string, callback: (error: Error, realpath: string) => void): void; |
@@ -5,4 +5,2 @@ import { TPromise } from 'vs/base/common/winjs.base'; | ||
}; | ||
export declare function _futureMachineIdExperiment(): string; | ||
export declare function getMachineId(): TPromise<string>; | ||
export declare function getStableMachineId(): TPromise<string>; |
import streams = require('stream'); | ||
import { TPromise } from 'vs/base/common/winjs.base'; | ||
import stream = require('vs/base/node/stream'); | ||
export interface IMimeAndEncoding { | ||
@@ -6,3 +8,7 @@ encoding: string; | ||
} | ||
export declare function detectMimeAndEncodingFromBuffer(buffer: NodeBuffer, bytesRead: number): IMimeAndEncoding; | ||
export interface DetectMimesOption { | ||
autoGuessEncoding?: boolean; | ||
} | ||
export declare function detectMimeAndEncodingFromBuffer(readResult: stream.ReadResult, autoGuessEncoding?: false): IMimeAndEncoding; | ||
export declare function detectMimeAndEncodingFromBuffer(readResult: stream.ReadResult, autoGuessEncoding?: boolean): TPromise<IMimeAndEncoding>; | ||
/** | ||
@@ -13,3 +19,3 @@ * Opens the given stream to detect its mime type. Returns an array of mime types sorted from most specific to unspecific. | ||
*/ | ||
export declare function detectMimesFromStream(instream: streams.Readable, nameHint: string, callback: (error: Error, result: IMimeAndEncoding) => void): void; | ||
export declare function detectMimesFromStream(instream: streams.Readable, nameHint: string, option?: DetectMimesOption): TPromise<IMimeAndEncoding>; | ||
/** | ||
@@ -19,2 +25,2 @@ * Opens the given file to detect its mime type. Returns an array of mime types sorted from most specific to unspecific. | ||
*/ | ||
export declare function detectMimesFromFile(absolutePath: string, callback: (error: Error, result: IMimeAndEncoding) => void): void; | ||
export declare function detectMimesFromFile(absolutePath: string, option?: DetectMimesOption): TPromise<IMimeAndEncoding>; |
@@ -1,2 +0,2 @@ | ||
import { Promise, TPromise } from 'vs/base/common/winjs.base'; | ||
import { TPromise } from 'vs/base/common/winjs.base'; | ||
import * as fs from 'fs'; | ||
@@ -11,12 +11,19 @@ export declare function readdir(path: string): TPromise<string[]>; | ||
export declare function lstat(path: string): TPromise<fs.Stats>; | ||
export declare function rename(oldPath: string, newPath: string): Promise; | ||
export declare function rmdir(path: string): Promise; | ||
export declare function unlink(path: string): Promise; | ||
export declare function rename(oldPath: string, newPath: string): TPromise<void>; | ||
export declare function rmdir(path: string): TPromise<void>; | ||
export declare function unlink(path: string): TPromise<void>; | ||
export declare function symlink(target: string, path: string, type?: string): TPromise<void>; | ||
export declare function readlink(path: string): TPromise<string>; | ||
export declare function touch(path: string): TPromise<void>; | ||
export declare function truncate(path: string, len: number): TPromise<void>; | ||
export declare function readFile(path: string): TPromise<Buffer>; | ||
export declare function readFile(path: string, encoding: string): TPromise<string>; | ||
export declare function writeFile(path: string, data: string, encoding?: string): TPromise<void>; | ||
export declare function writeFile(path: string, data: NodeBuffer, encoding?: string): TPromise<void>; | ||
export declare function writeFile(path: string, data: string, options?: { | ||
mode?: number; | ||
flag?: string; | ||
}): TPromise<void>; | ||
export declare function writeFile(path: string, data: NodeBuffer, options?: { | ||
mode?: number; | ||
flag?: string; | ||
}): TPromise<void>; | ||
/** | ||
@@ -23,0 +30,0 @@ * Read a dir and return only subfolders |
import { Agent } from './request'; | ||
import { TPromise } from 'vs/base/common/winjs.base'; | ||
export interface IOptions { | ||
@@ -6,2 +7,2 @@ proxyUrl?: string; | ||
} | ||
export declare function getProxyAgent(rawRequestURL: string, options?: IOptions): Agent; | ||
export declare function getProxyAgent(rawRequestURL: string, options?: IOptions): TPromise<Agent>; |
import { TPromise } from 'vs/base/common/winjs.base'; | ||
import http = require('http'); | ||
import { Stream } from 'stream'; | ||
export declare type Agent = any; | ||
export interface IRawRequestFunction { | ||
(options: http.RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; | ||
} | ||
export interface IRequestOptions { | ||
@@ -15,2 +19,3 @@ type?: string; | ||
strictSSL?: boolean; | ||
getRawRequest?(options: IRequestOptions): IRawRequestFunction; | ||
} | ||
@@ -17,0 +22,0 @@ export interface IRequestContext { |
import stream = require('stream'); | ||
import { TPromise } from 'vs/base/common/winjs.base'; | ||
export interface ReadResult { | ||
buffer: NodeBuffer; | ||
bytesRead: number; | ||
} | ||
/** | ||
* Reads up to total bytes from the provided stream. | ||
*/ | ||
export declare function readExactlyByStream(stream: stream.Readable, totalBytes: number, callback: (err: Error, buffer: NodeBuffer, bytesRead: number) => void): void; | ||
export declare function readExactlyByStream(stream: stream.Readable, totalBytes: number): TPromise<ReadResult>; | ||
/** | ||
* Reads totalBytes from the provided file. | ||
*/ | ||
export declare function readExactlyByFile(file: string, totalBytes: number, callback: (error: Error, buffer: NodeBuffer, bytesRead: number) => void): void; | ||
export declare function readExactlyByFile(file: string, totalBytes: number): TPromise<ReadResult>; | ||
/** | ||
@@ -19,2 +24,2 @@ * Reads a file until a matching string is found. | ||
*/ | ||
export declare function readToMatchingString(file: string, matchingString: string, chunkBytes: number, maximumBytesToRead: number, callback: (error: Error, result: string) => void): void; | ||
export declare function readToMatchingString(file: string, matchingString: string, chunkBytes: number, maximumBytesToRead: number): TPromise<string>; |
@@ -1,2 +0,2 @@ | ||
import { Promise, TPromise } from 'vs/base/common/winjs.base'; | ||
import { TPromise } from 'vs/base/common/winjs.base'; | ||
export interface IExtractOptions { | ||
@@ -10,3 +10,3 @@ overwrite?: boolean; | ||
} | ||
export declare function extract(zipPath: string, targetPath: string, options?: IExtractOptions): Promise; | ||
export declare function extract(zipPath: string, targetPath: string, options?: IExtractOptions): TPromise<void>; | ||
export declare function buffer(zipPath: string, filePath: string): TPromise<Buffer>; |
{ | ||
"name": "@vscode/base-node", | ||
"private": false, | ||
"version": "0.1.15-6", | ||
"version": "0.1.15-7", | ||
"description": "", | ||
@@ -6,0 +6,0 @@ "main": "''", |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 11); | ||
/******/ return __webpack_require__(__webpack_require__.s = 13); | ||
/******/ }) | ||
@@ -74,9 +71,6 @@ /************************************************************************/ | ||
/***/ 11: | ||
/***/ 13: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -87,8 +81,9 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* Returns the last element of an array. | ||
* @param array The array. | ||
* @param n Which element from the end (default ist zero). | ||
* @param n Which element from the end (default is zero). | ||
*/ | ||
function tail(array, n) { | ||
@@ -103,3 +98,3 @@ if (n === void 0) { | ||
if (itemEquals === void 0) { | ||
itemEquals = function itemEquals(a, b) { | ||
itemEquals = function (a, b) { | ||
return a === b; | ||
@@ -159,2 +154,97 @@ }; | ||
/** | ||
* Like `Array#sort` but always stable. Usually runs a little slower `than Array#sort` | ||
* so only use this when actually needing stable sort. | ||
*/ | ||
function mergeSort(data, compare) { | ||
_divideAndMerge(data, compare); | ||
return data; | ||
} | ||
exports.mergeSort = mergeSort; | ||
function _divideAndMerge(data, compare) { | ||
if (data.length <= 1) { | ||
// sorted | ||
return; | ||
} | ||
var p = data.length / 2 | 0; | ||
var left = data.slice(0, p); | ||
var right = data.slice(p); | ||
_divideAndMerge(left, compare); | ||
_divideAndMerge(right, compare); | ||
var leftIdx = 0; | ||
var rightIdx = 0; | ||
var i = 0; | ||
while (leftIdx < left.length && rightIdx < right.length) { | ||
var ret = compare(left[leftIdx], right[rightIdx]); | ||
if (ret <= 0) { | ||
// smaller_equal -> take left to preserve order | ||
data[i++] = left[leftIdx++]; | ||
} else { | ||
// greater -> take right | ||
data[i++] = right[rightIdx++]; | ||
} | ||
} | ||
while (leftIdx < left.length) { | ||
data[i++] = left[leftIdx++]; | ||
} | ||
while (rightIdx < right.length) { | ||
data[i++] = right[rightIdx++]; | ||
} | ||
} | ||
function groupBy(data, compare) { | ||
var result = []; | ||
var currentGroup; | ||
for (var _i = 0, _a = data.slice(0).sort(compare); _i < _a.length; _i++) { | ||
var element = _a[_i]; | ||
if (!currentGroup || compare(currentGroup[0], element) !== 0) { | ||
currentGroup = [element]; | ||
result.push(currentGroup); | ||
} else { | ||
currentGroup.push(element); | ||
} | ||
} | ||
return result; | ||
} | ||
exports.groupBy = groupBy; | ||
/** | ||
* Takes two *sorted* arrays and computes their delta (removed, added elements). | ||
* Finishes in `Math.min(before.length, after.length)` steps. | ||
* @param before | ||
* @param after | ||
* @param compare | ||
*/ | ||
function delta(before, after, compare) { | ||
var removed = []; | ||
var added = []; | ||
var beforeIdx = 0; | ||
var afterIdx = 0; | ||
while (true) { | ||
if (beforeIdx === before.length) { | ||
added.push.apply(added, after.slice(afterIdx)); | ||
break; | ||
} | ||
if (afterIdx === after.length) { | ||
removed.push.apply(removed, before.slice(beforeIdx)); | ||
break; | ||
} | ||
var beforeElement = before[beforeIdx]; | ||
var afterElement = after[afterIdx]; | ||
var n = compare(beforeElement, afterElement); | ||
if (n === 0) { | ||
// equal | ||
beforeIdx += 1; | ||
afterIdx += 1; | ||
} else if (n < 0) { | ||
// beforeElement is smaller -> before element removed | ||
removed.push(beforeElement); | ||
beforeIdx += 1; | ||
} else if (n > 0) { | ||
// beforeElement is greater -> after element added | ||
added.push(afterElement); | ||
afterIdx += 1; | ||
} | ||
} | ||
return { removed: removed, added: added }; | ||
} | ||
exports.delta = delta; | ||
/** | ||
* Returns the top N elements from the array. | ||
@@ -174,3 +264,3 @@ * | ||
var result = array.slice(0, n).sort(compare); | ||
var _loop_1 = function _loop_1(i, m) { | ||
var _loop_1 = function (i, m) { | ||
var element = array[i]; | ||
@@ -271,3 +361,3 @@ if (compare(element, result[n - 1]) < 0) { | ||
if (equals === void 0) { | ||
equals = function equals(a, b) { | ||
equals = function (a, b) { | ||
return a === b; | ||
@@ -312,3 +402,3 @@ }; | ||
if (merger === void 0) { | ||
merger = function merger(t) { | ||
merger = function (t) { | ||
return t; | ||
@@ -338,2 +428,12 @@ }; | ||
exports.insert = insert; | ||
/** | ||
* Insert `insertArr` inside `target` at `insertIndex`. | ||
* Please don't touch unless you understand https://jsperf.com/inserting-an-array-within-an-array | ||
*/ | ||
function arrayInsert(target, insertIndex, insertArr) { | ||
var before = target.slice(0, insertIndex); | ||
var after = target.slice(insertIndex); | ||
return before.concat(insertArr, after); | ||
} | ||
exports.arrayInsert = arrayInsert; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
@@ -340,0 +440,0 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 62); | ||
/******/ return __webpack_require__(__webpack_require__.s = 53); | ||
/******/ }) | ||
@@ -74,9 +71,6 @@ /************************************************************************/ | ||
/***/ 62: | ||
/***/ 53: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -87,6 +81,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* Throws an error with the provided message if the provided value does not evaluate to a true Javascript value. | ||
*/ | ||
function ok(value, message) { | ||
@@ -93,0 +88,0 @@ if (!value || value === null) { |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 64); | ||
/******/ return __webpack_require__(__webpack_require__.s = 55); | ||
/******/ }) | ||
@@ -74,9 +71,6 @@ /************************************************************************/ | ||
/***/ 64: | ||
/***/ 55: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -87,2 +81,4 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// Names from https://blog.codinghorror.com/ascii-pronunciation-rules-for-programmers/ | ||
@@ -93,3 +89,2 @@ /** | ||
*/ | ||
var CharCode; | ||
@@ -96,0 +91,0 @@ (function (CharCode) { |
@@ -19,4 +19,4 @@ /** | ||
*/ | ||
export declare function values<T>(from: IStringDictionary<T>): T[]; | ||
export declare function values<T>(from: INumberDictionary<T>): T[]; | ||
export declare function values<T>(from: IStringDictionary<T> | INumberDictionary<T>): T[]; | ||
export declare function size<T>(from: IStringDictionary<T> | INumberDictionary<T>): number; | ||
/** | ||
@@ -26,10 +26,6 @@ * Iterates over each entry in the provided set. The iterator allows | ||
*/ | ||
export declare function forEach<T>(from: IStringDictionary<T>, callback: (entry: { | ||
key: string; | ||
export declare function forEach<T>(from: IStringDictionary<T> | INumberDictionary<T>, callback: (entry: { | ||
key: any; | ||
value: T; | ||
}, remove: Function) => any): void; | ||
export declare function forEach<T>(from: INumberDictionary<T>, callback: (entry: { | ||
key: number; | ||
value: T; | ||
}, remove: Function) => any): void; | ||
/** | ||
@@ -39,4 +35,3 @@ * Removes an element from the dictionary. Returns {{false}} if the property | ||
*/ | ||
export declare function remove<T>(from: IStringDictionary<T>, key: string): boolean; | ||
export declare function remove<T>(from: INumberDictionary<T>, key: string): boolean; | ||
export declare function remove<T>(from: IStringDictionary<T> | INumberDictionary<T>, key: string): boolean; | ||
/** | ||
@@ -43,0 +38,0 @@ * Groups the collection into a dictionary based on the provided |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 36); | ||
/******/ return __webpack_require__(__webpack_require__.s = 37); | ||
/******/ }) | ||
@@ -74,9 +71,6 @@ /************************************************************************/ | ||
/***/ 36: | ||
/***/ 37: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -88,3 +82,8 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
/** | ||
* Returns an array which contains all values that reside | ||
* in the given set. | ||
*/ | ||
function values(from) { | ||
@@ -100,5 +99,19 @@ var result = []; | ||
exports.values = values; | ||
function forEach(from, callback) { | ||
function size(from) { | ||
var count = 0; | ||
for (var key in from) { | ||
if (hasOwnProperty.call(from, key)) { | ||
count += 1; | ||
} | ||
} | ||
return count; | ||
} | ||
exports.size = size; | ||
/** | ||
* Iterates over each entry in the provided set. The iterator allows | ||
* to remove elements and will stop when the callback returns {{false}}. | ||
*/ | ||
function forEach(from, callback) { | ||
var _loop_1 = function (key) { | ||
if (hasOwnProperty.call(from, key)) { | ||
var result = callback({ key: key, value: from[key] }, function () { | ||
@@ -108,8 +121,16 @@ delete from[key]; | ||
if (result === false) { | ||
return; | ||
return { value: void 0 }; | ||
} | ||
} | ||
}; | ||
for (var key in from) { | ||
var state_1 = _loop_1(key); | ||
if (typeof state_1 === "object") return state_1.value; | ||
} | ||
} | ||
exports.forEach = forEach; | ||
/** | ||
* Removes an element from the dictionary. Returns {{false}} if the property | ||
* does not exists. | ||
*/ | ||
function remove(from, key) { | ||
@@ -116,0 +137,0 @@ if (!hasOwnProperty.call(from, key)) { |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 65); | ||
/******/ return __webpack_require__(__webpack_require__.s = 56); | ||
/******/ }) | ||
@@ -74,9 +71,6 @@ /************************************************************************/ | ||
/***/ 65: | ||
/***/ 56: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
/*--------------------------------------------------------------------------------------------- | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
@@ -88,8 +82,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. | ||
var RGBA = function () { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function roundFloat(number, decimalPoints) { | ||
var decimal = Math.pow(10, decimalPoints); | ||
return Math.round(number * decimal) / decimal; | ||
} | ||
var RGBA = /** @class */function () { | ||
function RGBA(r, g, b, a) { | ||
this.r = RGBA._clampInt_0_255(r); | ||
this.g = RGBA._clampInt_0_255(g); | ||
this.b = RGBA._clampInt_0_255(b); | ||
this.a = RGBA._clampInt_0_255(a); | ||
if (a === void 0) { | ||
a = 1; | ||
} | ||
this.r = Math.min(255, Math.max(0, r)) | 0; | ||
this.g = Math.min(255, Math.max(0, g)) | 0; | ||
this.b = Math.min(255, Math.max(0, b)) | 0; | ||
this.a = roundFloat(Math.max(Math.min(1, a), 0), 3); | ||
} | ||
@@ -99,224 +101,207 @@ RGBA.equals = function (a, b) { | ||
}; | ||
RGBA._clampInt_0_255 = function (c) { | ||
if (c < 0) { | ||
return 0; | ||
} | ||
if (c > 255) { | ||
return 255; | ||
} | ||
return c | 0; | ||
}; | ||
return RGBA; | ||
}(); | ||
exports.RGBA = RGBA; | ||
/** | ||
* http://en.wikipedia.org/wiki/HSL_color_space | ||
*/ | ||
var HSLA = function () { | ||
var HSLA = /** @class */function () { | ||
function HSLA(h, s, l, a) { | ||
this.h = HSLA._clampFloat_0_360(h); | ||
this.s = HSLA._clampFloat_0_1(s); | ||
this.l = HSLA._clampFloat_0_1(l); | ||
this.a = HSLA._clampFloat_0_1(a); | ||
this.h = Math.max(Math.min(360, h), 0) | 0; | ||
this.s = roundFloat(Math.max(Math.min(1, s), 0), 3); | ||
this.l = roundFloat(Math.max(Math.min(1, l), 0), 3); | ||
this.a = roundFloat(Math.max(Math.min(1, a), 0), 3); | ||
} | ||
HSLA._clampFloat_0_360 = function (hue) { | ||
if (hue < 0) { | ||
return 0.0; | ||
HSLA.equals = function (a, b) { | ||
return a.h === b.h && a.s === b.s && a.l === b.l && a.a === b.a; | ||
}; | ||
/** | ||
* Converts an RGB color value to HSL. Conversion formula | ||
* adapted from http://en.wikipedia.org/wiki/HSL_color_space. | ||
* Assumes r, g, and b are contained in the set [0, 255] and | ||
* returns h in the set [0, 360], s, and l in the set [0, 1]. | ||
*/ | ||
HSLA.fromRGBA = function (rgba) { | ||
var r = rgba.r / 255; | ||
var g = rgba.g / 255; | ||
var b = rgba.b / 255; | ||
var a = rgba.a; | ||
var max = Math.max(r, g, b); | ||
var min = Math.min(r, g, b); | ||
var h = 0; | ||
var s = 0; | ||
var l = (min + max) / 2; | ||
var chroma = max - min; | ||
if (chroma > 0) { | ||
s = Math.min(l <= 0.5 ? chroma / (2 * l) : chroma / (2 - 2 * l), 1); | ||
switch (max) { | ||
case r: | ||
h = (g - b) / chroma + (g < b ? 6 : 0); | ||
break; | ||
case g: | ||
h = (b - r) / chroma + 2; | ||
break; | ||
case b: | ||
h = (r - g) / chroma + 4; | ||
break; | ||
} | ||
h *= 60; | ||
h = Math.round(h); | ||
} | ||
if (hue > 360) { | ||
return 360.0; | ||
} | ||
return hue; | ||
return new HSLA(h, s, l, a); | ||
}; | ||
HSLA._clampFloat_0_1 = function (n) { | ||
if (n < 0) { | ||
return 0.0; | ||
HSLA._hue2rgb = function (p, q, t) { | ||
if (t < 0) { | ||
t += 1; | ||
} | ||
if (n > 1) { | ||
return 1.0; | ||
if (t > 1) { | ||
t -= 1; | ||
} | ||
return n; | ||
if (t < 1 / 6) { | ||
return p + (q - p) * 6 * t; | ||
} | ||
if (t < 1 / 2) { | ||
return q; | ||
} | ||
if (t < 2 / 3) { | ||
return p + (q - p) * (2 / 3 - t) * 6; | ||
} | ||
return p; | ||
}; | ||
/** | ||
* Converts an HSL color value to RGB. Conversion formula | ||
* adapted from http://en.wikipedia.org/wiki/HSL_color_space. | ||
* Assumes h in the set [0, 360] s, and l are contained in the set [0, 1] and | ||
* returns r, g, and b in the set [0, 255]. | ||
*/ | ||
HSLA.toRGBA = function (hsla) { | ||
var h = hsla.h / 360; | ||
var s = hsla.s, | ||
l = hsla.l, | ||
a = hsla.a; | ||
var r, g, b; | ||
if (s === 0) { | ||
r = g = b = l; // achromatic | ||
} else { | ||
var q = l < 0.5 ? l * (1 + s) : l + s - l * s; | ||
var p = 2 * l - q; | ||
r = HSLA._hue2rgb(p, q, h + 1 / 3); | ||
g = HSLA._hue2rgb(p, q, h); | ||
b = HSLA._hue2rgb(p, q, h - 1 / 3); | ||
} | ||
return new RGBA(Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), a); | ||
}; | ||
return HSLA; | ||
}(); | ||
exports.HSLA = HSLA; | ||
/** | ||
* Converts an Hex color value to RGB. | ||
* returns r, g, and b are contained in the set [0, 255] | ||
* @param hex string (#RRGGBB or #RRGGBBAA). | ||
*/ | ||
function hex2rgba(hex) { | ||
if (!hex) { | ||
// Invalid color | ||
return new RGBA(255, 0, 0, 255); | ||
var HSVA = /** @class */function () { | ||
function HSVA(h, s, v, a) { | ||
this.h = Math.max(Math.min(360, h), 0) | 0; | ||
this.s = roundFloat(Math.max(Math.min(1, s), 0), 3); | ||
this.v = roundFloat(Math.max(Math.min(1, v), 0), 3); | ||
this.a = roundFloat(Math.max(Math.min(1, a), 0), 3); | ||
} | ||
if (hex.length === 7 && hex.charCodeAt(0) === 35 /* Hash */) { | ||
// #RRGGBB format | ||
var r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2)); | ||
var g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4)); | ||
var b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6)); | ||
return new RGBA(r, g, b, 255); | ||
HSVA.equals = function (a, b) { | ||
return a.h === b.h && a.s === b.s && a.v === b.v && a.a === b.a; | ||
}; | ||
// from http://www.rapidtables.com/convert/color/rgb-to-hsv.htm | ||
HSVA.fromRGBA = function (rgba) { | ||
var r = rgba.r / 255; | ||
var g = rgba.g / 255; | ||
var b = rgba.b / 255; | ||
var cmax = Math.max(r, g, b); | ||
var cmin = Math.min(r, g, b); | ||
var delta = cmax - cmin; | ||
var s = cmax === 0 ? 0 : delta / cmax; | ||
var m; | ||
if (delta === 0) { | ||
m = 0; | ||
} else if (cmax === r) { | ||
m = ((g - b) / delta % 6 + 6) % 6; | ||
} else if (cmax === g) { | ||
m = (b - r) / delta + 2; | ||
} else { | ||
m = (r - g) / delta + 4; | ||
} | ||
if (hex.length === 9 && hex.charCodeAt(0) === 35 /* Hash */) { | ||
// #RRGGBBAA format | ||
var r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2)); | ||
var g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4)); | ||
var b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6)); | ||
var a = 16 * _parseHexDigit(hex.charCodeAt(7)) + _parseHexDigit(hex.charCodeAt(8)); | ||
return new RGBA(r, g, b, a); | ||
return new HSVA(m * 60, s, cmax, rgba.a); | ||
}; | ||
// from http://www.rapidtables.com/convert/color/hsv-to-rgb.htm | ||
HSVA.toRGBA = function (hsva) { | ||
var h = hsva.h, | ||
s = hsva.s, | ||
v = hsva.v, | ||
a = hsva.a; | ||
var c = v * s; | ||
var x = c * (1 - Math.abs(h / 60 % 2 - 1)); | ||
var m = v - c; | ||
var _a = [0, 0, 0], | ||
r = _a[0], | ||
g = _a[1], | ||
b = _a[2]; | ||
if (h < 60) { | ||
r = c; | ||
g = x; | ||
} else if (h < 120) { | ||
r = x; | ||
g = c; | ||
} else if (h < 180) { | ||
g = c; | ||
b = x; | ||
} else if (h < 240) { | ||
g = x; | ||
b = c; | ||
} else if (h < 300) { | ||
r = x; | ||
b = c; | ||
} else if (h < 360) { | ||
r = c; | ||
b = x; | ||
} | ||
// Invalid color | ||
return new RGBA(255, 0, 0, 255); | ||
} | ||
function _parseHexDigit(charCode) { | ||
switch (charCode) { | ||
case 48 /* Digit0 */: | ||
return 0; | ||
case 49 /* Digit1 */: | ||
return 1; | ||
case 50 /* Digit2 */: | ||
return 2; | ||
case 51 /* Digit3 */: | ||
return 3; | ||
case 52 /* Digit4 */: | ||
return 4; | ||
case 53 /* Digit5 */: | ||
return 5; | ||
case 54 /* Digit6 */: | ||
return 6; | ||
case 55 /* Digit7 */: | ||
return 7; | ||
case 56 /* Digit8 */: | ||
return 8; | ||
case 57 /* Digit9 */: | ||
return 9; | ||
case 97 /* a */: | ||
return 10; | ||
case 65 /* A */: | ||
return 10; | ||
case 98 /* b */: | ||
return 11; | ||
case 66 /* B */: | ||
return 11; | ||
case 99 /* c */: | ||
return 12; | ||
case 67 /* C */: | ||
return 12; | ||
case 100 /* d */: | ||
return 13; | ||
case 68 /* D */: | ||
return 13; | ||
case 101 /* e */: | ||
return 14; | ||
case 69 /* E */: | ||
return 14; | ||
case 102 /* f */: | ||
return 15; | ||
case 70 /* F */: | ||
return 15; | ||
} | ||
return 0; | ||
} | ||
/** | ||
* Converts an RGB color value to HSL. Conversion formula | ||
* adapted from http://en.wikipedia.org/wiki/HSL_color_space. | ||
* Assumes r, g, and b are contained in the set [0, 255] and | ||
* returns h in the set [0, 360], s, and l in the set [0, 1]. | ||
*/ | ||
function rgba2hsla(rgba) { | ||
var r = rgba.r / 255; | ||
var g = rgba.g / 255; | ||
var b = rgba.b / 255; | ||
var a = rgba.a / 255; | ||
var max = Math.max(r, g, b); | ||
var min = Math.min(r, g, b); | ||
var h = 0; | ||
var s = 0; | ||
var l = Math.round((min + max) / 2 * 1000) / 1000; | ||
var chroma = max - min; | ||
if (chroma > 0) { | ||
s = Math.min(Math.round((l <= 0.5 ? chroma / (2 * l) : chroma / (2 - 2 * l)) * 1000) / 1000, 1); | ||
switch (max) { | ||
case r: | ||
h = (g - b) / chroma + (g < b ? 6 : 0); | ||
break; | ||
case g: | ||
h = (b - r) / chroma + 2; | ||
break; | ||
case b: | ||
h = (r - g) / chroma + 4; | ||
break; | ||
} | ||
h *= 60; | ||
h = Math.round(h); | ||
} | ||
return new HSLA(h, s, l, a); | ||
} | ||
/** | ||
* Converts an HSL color value to RGB. Conversion formula | ||
* adapted from http://en.wikipedia.org/wiki/HSL_color_space. | ||
* Assumes h in the set [0, 360] s, and l are contained in the set [0, 1] and | ||
* returns r, g, and b in the set [0, 255]. | ||
*/ | ||
function hsla2rgba(hsla) { | ||
var h = hsla.h / 360; | ||
var s = Math.min(hsla.s, 1); | ||
var l = Math.min(hsla.l, 1); | ||
var a = hsla.a; | ||
var r, g, b; | ||
if (s === 0) { | ||
r = g = b = l; // achromatic | ||
} else { | ||
var q = l < 0.5 ? l * (1 + s) : l + s - l * s; | ||
var p = 2 * l - q; | ||
r = _hue2rgb(p, q, h + 1 / 3); | ||
g = _hue2rgb(p, q, h); | ||
b = _hue2rgb(p, q, h - 1 / 3); | ||
} | ||
return new RGBA(Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), Math.round(a * 255)); | ||
} | ||
function _hue2rgb(p, q, t) { | ||
if (t < 0) { | ||
t += 1; | ||
} | ||
if (t > 1) { | ||
t -= 1; | ||
} | ||
if (t < 1 / 6) { | ||
return p + (q - p) * 6 * t; | ||
} | ||
if (t < 1 / 2) { | ||
return q; | ||
} | ||
if (t < 2 / 3) { | ||
return p + (q - p) * (2 / 3 - t) * 6; | ||
} | ||
return p; | ||
} | ||
var Color = function () { | ||
r = Math.round((r + m) * 255); | ||
g = Math.round((g + m) * 255); | ||
b = Math.round((b + m) * 255); | ||
return new RGBA(r, g, b, a); | ||
}; | ||
return HSVA; | ||
}(); | ||
exports.HSVA = HSVA; | ||
var Color = /** @class */function () { | ||
function Color(arg) { | ||
if (arg instanceof RGBA) { | ||
if (!arg) { | ||
throw new Error('Color needs a value'); | ||
} else if (arg instanceof RGBA) { | ||
this.rgba = arg; | ||
} else if (arg instanceof HSLA) { | ||
this._hsla = arg; | ||
this.rgba = HSLA.toRGBA(arg); | ||
} else if (arg instanceof HSVA) { | ||
this._hsva = arg; | ||
this.rgba = HSVA.toRGBA(arg); | ||
} else { | ||
this.rgba = hex2rgba(arg); | ||
throw new Error('Invalid color ctor argument'); | ||
} | ||
this.hsla = null; | ||
} | ||
Color.fromRGBA = function (rgba) { | ||
return new Color(rgba); | ||
}; | ||
/** | ||
* Creates a color from a hex string (#RRGGBB or #RRGGBBAA). | ||
*/ | ||
Color.fromHex = function (hex) { | ||
return new Color(hex); | ||
return Color.Format.CSS.parseHex(hex) || Color.red; | ||
}; | ||
Color.fromHSLA = function (hsla) { | ||
return new Color(hsla2rgba(hsla)); | ||
}; | ||
Object.defineProperty(Color.prototype, "hsla", { | ||
get: function () { | ||
if (this._hsla) { | ||
return this._hsla; | ||
} else { | ||
return HSLA.fromRGBA(this.rgba); | ||
} | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Color.prototype, "hsva", { | ||
get: function () { | ||
if (this._hsva) { | ||
return this._hsva; | ||
} | ||
return HSVA.fromRGBA(this.rgba); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Color.prototype.equals = function (other) { | ||
if (!other) { | ||
return false; | ||
} | ||
return RGBA.equals(this.rgba, other.rgba); | ||
return !!other && RGBA.equals(this.rgba, other.rgba) && HSLA.equals(this.hsla, other.hsla) && HSVA.equals(this.hsva, other.hsva); | ||
}; | ||
@@ -327,10 +312,10 @@ /** | ||
*/ | ||
Color.prototype.getLuminosity = function () { | ||
var R = Color._luminosityFor(this.rgba.r); | ||
var G = Color._luminosityFor(this.rgba.g); | ||
var B = Color._luminosityFor(this.rgba.b); | ||
var luminosity = 0.2126 * R + 0.7152 * G + 0.0722 * B; | ||
return Math.round(luminosity * 10000) / 10000; | ||
Color.prototype.getRelativeLuminance = function () { | ||
var R = Color._relativeLuminanceForComponent(this.rgba.r); | ||
var G = Color._relativeLuminanceForComponent(this.rgba.g); | ||
var B = Color._relativeLuminanceForComponent(this.rgba.b); | ||
var luminance = 0.2126 * R + 0.7152 * G + 0.0722 * B; | ||
return roundFloat(luminance, 4); | ||
}; | ||
Color._luminosityFor = function (color) { | ||
Color._relativeLuminanceForComponent = function (color) { | ||
var c = color / 255; | ||
@@ -343,5 +328,5 @@ return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4); | ||
*/ | ||
Color.prototype.getContrast = function (another) { | ||
var lum1 = this.getLuminosity(); | ||
var lum2 = another.getLuminosity(); | ||
Color.prototype.getContrastRatio = function (another) { | ||
var lum1 = this.getRelativeLuminance(); | ||
var lum2 = another.getRelativeLuminance(); | ||
return lum1 > lum2 ? (lum1 + 0.05) / (lum2 + 0.05) : (lum2 + 0.05) / (lum1 + 0.05); | ||
@@ -366,62 +351,51 @@ }; | ||
Color.prototype.isLighterThan = function (another) { | ||
var lum1 = this.getLuminosity(); | ||
var lum2 = another.getLuminosity(); | ||
var lum1 = this.getRelativeLuminance(); | ||
var lum2 = another.getRelativeLuminance(); | ||
return lum1 > lum2; | ||
}; | ||
Color.prototype.isDarkerThan = function (another) { | ||
var lum1 = this.getLuminosity(); | ||
var lum2 = another.getLuminosity(); | ||
var lum1 = this.getRelativeLuminance(); | ||
var lum2 = another.getRelativeLuminance(); | ||
return lum1 < lum2; | ||
}; | ||
Color.prototype.lighten = function (factor) { | ||
var hsl = this.toHSLA(); | ||
var result = new HSLA(hsl.h, hsl.s, hsl.l + hsl.l * factor, hsl.a); | ||
return new Color(hsla2rgba(result)); | ||
return new Color(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l + this.hsla.l * factor, this.hsla.a)); | ||
}; | ||
Color.prototype.darken = function (factor) { | ||
var hsl = this.toHSLA(); | ||
var result = new HSLA(hsl.h, hsl.s, hsl.l - hsl.l * factor, hsl.a); | ||
return new Color(hsla2rgba(result)); | ||
return new Color(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l - this.hsla.l * factor, this.hsla.a)); | ||
}; | ||
Color.prototype.transparent = function (factor) { | ||
var p = this.rgba; | ||
return new Color(new RGBA(p.r, p.g, p.b, Math.round(p.a * factor))); | ||
var _a = this.rgba, | ||
r = _a.r, | ||
g = _a.g, | ||
b = _a.b, | ||
a = _a.a; | ||
return new Color(new RGBA(r, g, b, a * factor)); | ||
}; | ||
Color.prototype.isTransparent = function () { | ||
return this.rgba.a === 0; | ||
}; | ||
Color.prototype.isOpaque = function () { | ||
return this.rgba.a === 1; | ||
}; | ||
Color.prototype.opposite = function () { | ||
return new Color(new RGBA(255 - this.rgba.r, 255 - this.rgba.g, 255 - this.rgba.b, this.rgba.a)); | ||
}; | ||
Color.prototype.toString = function () { | ||
var rgba = this.rgba; | ||
return "rgba(" + rgba.r + ", " + rgba.g + ", " + rgba.b + ", " + +(rgba.a / 255).toFixed(2) + ")"; | ||
}; | ||
/** | ||
* Prins the color as #RRGGBB | ||
*/ | ||
Color.prototype.toRGBHex = function () { | ||
var rgba = this.rgba; | ||
return "#" + Color._toTwoDigitHex(rgba.r) + Color._toTwoDigitHex(rgba.g) + Color._toTwoDigitHex(rgba.b); | ||
}; | ||
/** | ||
* Prins the color as #RRGGBBAA | ||
*/ | ||
Color.prototype.toRGBAHex = function () { | ||
var rgba = this.rgba; | ||
return "#" + Color._toTwoDigitHex(rgba.r) + Color._toTwoDigitHex(rgba.g) + Color._toTwoDigitHex(rgba.b) + Color._toTwoDigitHex(rgba.a); | ||
}; | ||
Color._toTwoDigitHex = function (n) { | ||
var r = n.toString(16); | ||
if (r.length !== 2) { | ||
return '0' + r; | ||
Color.prototype.blend = function (c) { | ||
var rgba = c.rgba; | ||
// Convert to 0..1 opacity | ||
var thisA = this.rgba.a; | ||
var colorA = rgba.a; | ||
var a = thisA + colorA * (1 - thisA); | ||
if (a < 1.0e-6) { | ||
return Color.transparent; | ||
} | ||
return r; | ||
var r = this.rgba.r * thisA / a + rgba.r * colorA * (1 - thisA) / a; | ||
var g = this.rgba.g * thisA / a + rgba.g * colorA * (1 - thisA) / a; | ||
var b = this.rgba.b * thisA / a + rgba.b * colorA * (1 - thisA) / a; | ||
return new Color(new RGBA(r, g, b, a)); | ||
}; | ||
Color.prototype.toHSLA = function () { | ||
if (this.hsla === null) { | ||
this.hsla = rgba2hsla(this.rgba); | ||
} | ||
return this.hsla; | ||
Color.prototype.toString = function () { | ||
return Color.Format.CSS.format(this); | ||
}; | ||
Color.prototype.toRGBA = function () { | ||
return this.rgba; | ||
}; | ||
Color.getLighterColor = function (of, relative, factor) { | ||
@@ -432,4 +406,4 @@ if (of.isLighterThan(relative)) { | ||
factor = factor ? factor : 0.5; | ||
var lum1 = of.getLuminosity(); | ||
var lum2 = relative.getLuminosity(); | ||
var lum1 = of.getRelativeLuminance(); | ||
var lum2 = relative.getRelativeLuminance(); | ||
factor = factor * (lum2 - lum1) / lum2; | ||
@@ -443,10 +417,189 @@ return of.lighten(factor); | ||
factor = factor ? factor : 0.5; | ||
var lum1 = of.getLuminosity(); | ||
var lum2 = relative.getLuminosity(); | ||
var lum1 = of.getRelativeLuminance(); | ||
var lum2 = relative.getRelativeLuminance(); | ||
factor = factor * (lum1 - lum2) / lum1; | ||
return of.darken(factor); | ||
}; | ||
Color.white = new Color(new RGBA(255, 255, 255, 1)); | ||
Color.black = new Color(new RGBA(0, 0, 0, 1)); | ||
Color.red = new Color(new RGBA(255, 0, 0, 1)); | ||
Color.blue = new Color(new RGBA(0, 0, 255, 1)); | ||
Color.green = new Color(new RGBA(0, 255, 0, 1)); | ||
Color.cyan = new Color(new RGBA(0, 255, 255, 1)); | ||
Color.lightgrey = new Color(new RGBA(211, 211, 211, 1)); | ||
Color.transparent = new Color(new RGBA(0, 0, 0, 0)); | ||
return Color; | ||
}(); | ||
exports.Color = Color; | ||
(function (Color) { | ||
var Format; | ||
(function (Format) { | ||
var CSS; | ||
(function (CSS) { | ||
function formatRGB(color) { | ||
if (color.rgba.a === 1) { | ||
return "rgb(" + color.rgba.r + ", " + color.rgba.g + ", " + color.rgba.b + ")"; | ||
} | ||
return Color.Format.CSS.formatRGBA(color); | ||
} | ||
CSS.formatRGB = formatRGB; | ||
function formatRGBA(color) { | ||
return "rgba(" + color.rgba.r + ", " + color.rgba.g + ", " + color.rgba.b + ", " + +color.rgba.a.toFixed(2) + ")"; | ||
} | ||
CSS.formatRGBA = formatRGBA; | ||
function formatHSL(color) { | ||
if (color.hsla.a === 1) { | ||
return "hsl(" + color.hsla.h + ", " + (color.hsla.s * 100).toFixed(2) + "%, " + (color.hsla.l * 100).toFixed(2) + "%)"; | ||
} | ||
return Color.Format.CSS.formatHSLA(color); | ||
} | ||
CSS.formatHSL = formatHSL; | ||
function formatHSLA(color) { | ||
return "hsla(" + color.hsla.h + ", " + (color.hsla.s * 100).toFixed(2) + "%, " + (color.hsla.l * 100).toFixed(2) + "%, " + color.hsla.a.toFixed(2) + ")"; | ||
} | ||
CSS.formatHSLA = formatHSLA; | ||
function _toTwoDigitHex(n) { | ||
var r = n.toString(16); | ||
return r.length !== 2 ? '0' + r : r; | ||
} | ||
/** | ||
* Formats the color as #RRGGBB | ||
*/ | ||
function formatHex(color) { | ||
return "#" + _toTwoDigitHex(color.rgba.r) + _toTwoDigitHex(color.rgba.g) + _toTwoDigitHex(color.rgba.b); | ||
} | ||
CSS.formatHex = formatHex; | ||
/** | ||
* Formats the color as #RRGGBBAA | ||
* If 'compact' is set, colors without transparancy will be printed as #RRGGBB | ||
*/ | ||
function formatHexA(color, compact) { | ||
if (compact === void 0) { | ||
compact = false; | ||
} | ||
if (compact && color.rgba.a === 1) { | ||
return Color.Format.CSS.formatHex(color); | ||
} | ||
return "#" + _toTwoDigitHex(color.rgba.r) + _toTwoDigitHex(color.rgba.g) + _toTwoDigitHex(color.rgba.b) + _toTwoDigitHex(Math.round(color.rgba.a * 255)); | ||
} | ||
CSS.formatHexA = formatHexA; | ||
/** | ||
* The default format will use HEX if opaque and RGBA otherwise. | ||
*/ | ||
function format(color) { | ||
if (!color) { | ||
return null; | ||
} | ||
if (color.isOpaque()) { | ||
return Color.Format.CSS.formatHex(color); | ||
} | ||
return Color.Format.CSS.formatRGBA(color); | ||
} | ||
CSS.format = format; | ||
/** | ||
* Converts an Hex color value to a Color. | ||
* returns r, g, and b are contained in the set [0, 255] | ||
* @param hex string (#RGB, #RGBA, #RRGGBB or #RRGGBBAA). | ||
*/ | ||
function parseHex(hex) { | ||
if (!hex) { | ||
// Invalid color | ||
return null; | ||
} | ||
var length = hex.length; | ||
if (length === 0) { | ||
// Invalid color | ||
return null; | ||
} | ||
if (hex.charCodeAt(0) !== 35 /* Hash */) { | ||
// Does not begin with a # | ||
return null; | ||
} | ||
if (length === 7) { | ||
// #RRGGBB format | ||
var r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2)); | ||
var g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4)); | ||
var b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6)); | ||
return new Color(new RGBA(r, g, b, 1)); | ||
} | ||
if (length === 9) { | ||
// #RRGGBBAA format | ||
var r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2)); | ||
var g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4)); | ||
var b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6)); | ||
var a = 16 * _parseHexDigit(hex.charCodeAt(7)) + _parseHexDigit(hex.charCodeAt(8)); | ||
return new Color(new RGBA(r, g, b, a / 255)); | ||
} | ||
if (length === 4) { | ||
// #RGB format | ||
var r = _parseHexDigit(hex.charCodeAt(1)); | ||
var g = _parseHexDigit(hex.charCodeAt(2)); | ||
var b = _parseHexDigit(hex.charCodeAt(3)); | ||
return new Color(new RGBA(16 * r + r, 16 * g + g, 16 * b + b)); | ||
} | ||
if (length === 5) { | ||
// #RGBA format | ||
var r = _parseHexDigit(hex.charCodeAt(1)); | ||
var g = _parseHexDigit(hex.charCodeAt(2)); | ||
var b = _parseHexDigit(hex.charCodeAt(3)); | ||
var a = _parseHexDigit(hex.charCodeAt(4)); | ||
return new Color(new RGBA(16 * r + r, 16 * g + g, 16 * b + b, (16 * a + a) / 255)); | ||
} | ||
// Invalid color | ||
return null; | ||
} | ||
CSS.parseHex = parseHex; | ||
function _parseHexDigit(charCode) { | ||
switch (charCode) { | ||
case 48 /* Digit0 */: | ||
return 0; | ||
case 49 /* Digit1 */: | ||
return 1; | ||
case 50 /* Digit2 */: | ||
return 2; | ||
case 51 /* Digit3 */: | ||
return 3; | ||
case 52 /* Digit4 */: | ||
return 4; | ||
case 53 /* Digit5 */: | ||
return 5; | ||
case 54 /* Digit6 */: | ||
return 6; | ||
case 55 /* Digit7 */: | ||
return 7; | ||
case 56 /* Digit8 */: | ||
return 8; | ||
case 57 /* Digit9 */: | ||
return 9; | ||
case 97 /* a */: | ||
return 10; | ||
case 65 /* A */: | ||
return 10; | ||
case 98 /* b */: | ||
return 11; | ||
case 66 /* B */: | ||
return 11; | ||
case 99 /* c */: | ||
return 12; | ||
case 67 /* C */: | ||
return 12; | ||
case 100 /* d */: | ||
return 13; | ||
case 68 /* D */: | ||
return 13; | ||
case 101 /* e */: | ||
return 14; | ||
case 69 /* E */: | ||
return 14; | ||
case 102 /* f */: | ||
return 15; | ||
case 70 /* F */: | ||
return 15; | ||
} | ||
return 0; | ||
} | ||
})(CSS = Format.CSS || (Format.CSS = {})); | ||
})(Format = Color.Format || (Color.Format = {})); | ||
})(Color = exports.Color || (exports.Color = {})); | ||
exports.Color = Color; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
@@ -453,0 +606,0 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 67); | ||
/******/ return __webpack_require__(__webpack_require__.s = 58); | ||
/******/ }) | ||
@@ -74,9 +71,6 @@ /************************************************************************/ | ||
/***/ 67: | ||
/***/ 58: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
/*--------------------------------------------------------------------------------------------- | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
@@ -88,2 +82,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function createDecorator(mapFn) { | ||
return function (target, key, descriptor) { | ||
var fnKey = null; | ||
var fn = null; | ||
if (typeof descriptor.value === 'function') { | ||
fnKey = 'value'; | ||
fn = descriptor.value; | ||
} else if (typeof descriptor.get === 'function') { | ||
fnKey = 'get'; | ||
fn = descriptor.get; | ||
} | ||
if (!fn) { | ||
throw new Error('not supported'); | ||
} | ||
descriptor[fnKey] = mapFn(fn); | ||
}; | ||
} | ||
exports.createDecorator = createDecorator; | ||
function memoize(target, key, descriptor) { | ||
@@ -90,0 +103,0 @@ var fnKey = null; |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 68); | ||
/******/ return __webpack_require__(__webpack_require__.s = 59); | ||
/******/ }) | ||
@@ -77,8 +74,3 @@ /************************************************************************/ | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -89,4 +81,5 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// --- THIS FILE IS TEMPORARY UNTIL ENV.TS IS CLEANED UP. IT CAN SAFELY BE USED IN ALL TARGET EXECUTION ENVIRONMENTS (node & dom) --- | ||
var _isWindows = false; | ||
@@ -98,3 +91,2 @@ var _isMacintosh = false; | ||
var _isWeb = false; | ||
var _isQunit = false; | ||
var _locale = undefined; | ||
@@ -104,3 +96,3 @@ var _language = undefined; | ||
// OS detection | ||
if ((typeof process === "undefined" ? "undefined" : _typeof(process)) === 'object') { | ||
if (typeof process === 'object') { | ||
_isWindows = process.platform === 'win32'; | ||
@@ -121,3 +113,3 @@ _isMacintosh = process.platform === 'darwin'; | ||
_isNative = true; | ||
} else if ((typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) === 'object') { | ||
} else if (typeof navigator === 'object') { | ||
var userAgent = navigator.userAgent; | ||
@@ -130,3 +122,2 @@ _isWindows = userAgent.indexOf('Windows') >= 0; | ||
_language = _locale; | ||
_isQunit = !!self.QUnit; | ||
} | ||
@@ -140,10 +131,10 @@ var Platform; | ||
})(Platform = exports.Platform || (exports.Platform = {})); | ||
exports._platform = Platform.Web; | ||
var _platform = Platform.Web; | ||
if (_isNative) { | ||
if (_isMacintosh) { | ||
exports._platform = Platform.Mac; | ||
_platform = Platform.Mac; | ||
} else if (_isWindows) { | ||
exports._platform = Platform.Windows; | ||
_platform = Platform.Windows; | ||
} else if (_isLinux) { | ||
exports._platform = Platform.Linux; | ||
_platform = Platform.Linux; | ||
} | ||
@@ -157,4 +148,3 @@ } | ||
exports.isWeb = _isWeb; | ||
exports.isQunit = _isQunit; | ||
exports.platform = exports._platform; | ||
exports.platform = _platform; | ||
/** | ||
@@ -172,3 +162,3 @@ * The language used for the user interface. The format of | ||
exports.locale = _locale; | ||
var _globals = (typeof self === "undefined" ? "undefined" : _typeof(self)) === 'object' ? self : global; | ||
var _globals = typeof self === 'object' ? self : global; | ||
exports.globals = _globals; | ||
@@ -183,2 +173,18 @@ function hasWebWorkerSupport() { | ||
exports.clearInterval = _globals.clearInterval.bind(_globals); | ||
var OperatingSystem; | ||
(function (OperatingSystem) { | ||
OperatingSystem[OperatingSystem["Windows"] = 1] = "Windows"; | ||
OperatingSystem[OperatingSystem["Macintosh"] = 2] = "Macintosh"; | ||
OperatingSystem[OperatingSystem["Linux"] = 3] = "Linux"; | ||
})(OperatingSystem = exports.OperatingSystem || (exports.OperatingSystem = {})); | ||
exports.OS = _isMacintosh ? 2 /* Macintosh */ : _isWindows ? 1 /* Windows */ : 3 /* Linux */; | ||
var AccessibilitySupport; | ||
(function (AccessibilitySupport) { | ||
/** | ||
* This should be the browser case where it is not known if a screen reader is attached or no. | ||
*/ | ||
AccessibilitySupport[AccessibilitySupport["Unknown"] = 0] = "Unknown"; | ||
AccessibilitySupport[AccessibilitySupport["Disabled"] = 1] = "Disabled"; | ||
AccessibilitySupport[AccessibilitySupport["Enabled"] = 2] = "Enabled"; | ||
})(AccessibilitySupport = exports.AccessibilitySupport || (exports.AccessibilitySupport = {})); | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
@@ -190,9 +196,6 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
/***/ 68: | ||
/***/ 59: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(0)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, Platform) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(0)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, Platform) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -203,2 +206,4 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
@@ -208,3 +213,2 @@ * To enable diagnostics, open a browser console and type: window.Monaco.Diagnostics.<diagnostics name> = true. | ||
*/ | ||
var globals = Platform.globals; | ||
@@ -216,3 +220,3 @@ if (!globals.Monaco) { | ||
var switches = globals.Monaco.Diagnostics; | ||
var map = {}; | ||
var map = new Map(); | ||
var data = []; | ||
@@ -235,6 +239,6 @@ function fifo(array, size) { | ||
// register function | ||
var tracers = map[what] || []; | ||
var tracers = map.get(what) || []; | ||
tracers.push(fn); | ||
map[what] = tracers; | ||
var result = function result() { | ||
map.set(what, tracers); | ||
var result = function () { | ||
var args = []; | ||
@@ -247,16 +251,16 @@ for (var _i = 0; _i < arguments.length; _i++) { | ||
// replay back-in-time functions | ||
var allArgs = [arguments]; | ||
var allArgs_1 = [arguments]; | ||
idx = data.indexOf(fn); | ||
if (idx !== -1) { | ||
allArgs.unshift.apply(allArgs, data[idx + 1] || []); | ||
allArgs_1.unshift.apply(allArgs_1, data[idx + 1] || []); | ||
data[idx + 1] = []; | ||
} | ||
var doIt = function doIt() { | ||
var thisArguments = allArgs.shift(); | ||
var doIt_1 = function () { | ||
var thisArguments = allArgs_1.shift(); | ||
fn.apply(fn, thisArguments); | ||
if (allArgs.length > 0) { | ||
Platform.setTimeout(doIt, 500); | ||
if (allArgs_1.length > 0) { | ||
Platform.setTimeout(doIt_1, 500); | ||
} | ||
}; | ||
doIt(); | ||
doIt_1(); | ||
} else { | ||
@@ -263,0 +267,0 @@ // know where to store |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 69); | ||
/******/ return __webpack_require__(__webpack_require__.s = 60); | ||
/******/ }) | ||
@@ -74,9 +71,6 @@ /************************************************************************/ | ||
/***/ 27: | ||
/***/ 29: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -88,2 +82,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DifferenceType = { | ||
@@ -97,3 +92,3 @@ Add: 0, | ||
*/ | ||
var DiffChange = function () { | ||
var DiffChange = /** @class */function () { | ||
/** | ||
@@ -143,9 +138,6 @@ * Constructs a new DiffChange with the given sequence information | ||
/***/ 69: | ||
/***/ 60: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(27)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, diffChange_1) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(29)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, diffChange_1) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -157,8 +149,9 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function createStringSequence(a) { | ||
return { | ||
getLength: function getLength() { | ||
getLength: function () { | ||
return a.length; | ||
}, | ||
getElementHash: function getElementHash(pos) { | ||
getElementHash: function (pos) { | ||
return a[pos]; | ||
@@ -168,4 +161,4 @@ } | ||
} | ||
function stringDiff(original, modified) { | ||
return new LcsDiff(createStringSequence(original), createStringSequence(modified)).ComputeDiff(); | ||
function stringDiff(original, modified, pretty) { | ||
return new LcsDiff(createStringSequence(original), createStringSequence(modified)).ComputeDiff(pretty); | ||
} | ||
@@ -176,3 +169,3 @@ exports.stringDiff = stringDiff; | ||
// | ||
var Debug = function () { | ||
var Debug = /** @class */function () { | ||
function Debug() {} | ||
@@ -187,3 +180,3 @@ Debug.Assert = function (condition, message) { | ||
exports.Debug = Debug; | ||
var MyArray = function () { | ||
var MyArray = /** @class */function () { | ||
function MyArray() {} | ||
@@ -234,3 +227,3 @@ /** | ||
*/ | ||
var DiffChangeHelper = function () { | ||
var DiffChangeHelper = /** @class */function () { | ||
/** | ||
@@ -315,3 +308,3 @@ * Constructs a new DiffChangeHelper for the given DiffSequences. | ||
*/ | ||
var LcsDiff = function () { | ||
var LcsDiff = /** @class */function () { | ||
/** | ||
@@ -370,5 +363,11 @@ * Constructs the DiffFinder | ||
}; | ||
LcsDiff.prototype.ComputeDiff = function () { | ||
return this._ComputeDiff(0, this.OriginalSequence.getLength() - 1, 0, this.ModifiedSequence.getLength() - 1); | ||
LcsDiff.prototype.OriginalElementsAreEqual = function (index1, index2) { | ||
return this.m_originalIds[index1] === this.m_originalIds[index2]; | ||
}; | ||
LcsDiff.prototype.ModifiedElementsAreEqual = function (index1, index2) { | ||
return this.m_modifiedIds[index1] === this.m_modifiedIds[index2]; | ||
}; | ||
LcsDiff.prototype.ComputeDiff = function (pretty) { | ||
return this._ComputeDiff(0, this.OriginalSequence.getLength() - 1, 0, this.ModifiedSequence.getLength() - 1, pretty); | ||
}; | ||
/** | ||
@@ -379,5 +378,12 @@ * Computes the differences between the original and modified input | ||
*/ | ||
LcsDiff.prototype._ComputeDiff = function (originalStart, originalEnd, modifiedStart, modifiedEnd) { | ||
LcsDiff.prototype._ComputeDiff = function (originalStart, originalEnd, modifiedStart, modifiedEnd, pretty) { | ||
var quitEarlyArr = [false]; | ||
return this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr); | ||
var changes = this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr); | ||
if (pretty) { | ||
// We have to clean up the computed diff to be more intuitive | ||
// but it turns out this cannot be done correctly until the entire set | ||
// of diffs have been computed | ||
return this.ShiftChanges(changes); | ||
} | ||
return changes; | ||
}; | ||
@@ -750,2 +756,125 @@ /** | ||
/** | ||
* Shifts the given changes to provide a more intuitive diff. | ||
* While the first element in a diff matches the first element after the diff, | ||
* we shift the diff down. | ||
* | ||
* @param changes The list of changes to shift | ||
* @returns The shifted changes | ||
*/ | ||
LcsDiff.prototype.ShiftChanges = function (changes) { | ||
var mergedDiffs; | ||
do { | ||
mergedDiffs = false; | ||
// Shift all the changes down first | ||
for (var i = 0; i < changes.length; i++) { | ||
var change = changes[i]; | ||
var originalStop = i < changes.length - 1 ? changes[i + 1].originalStart : this.OriginalSequence.getLength(); | ||
var modifiedStop = i < changes.length - 1 ? changes[i + 1].modifiedStart : this.ModifiedSequence.getLength(); | ||
var checkOriginal = change.originalLength > 0; | ||
var checkModified = change.modifiedLength > 0; | ||
while (change.originalStart + change.originalLength < originalStop && change.modifiedStart + change.modifiedLength < modifiedStop && (!checkOriginal || this.OriginalElementsAreEqual(change.originalStart, change.originalStart + change.originalLength)) && (!checkModified || this.ModifiedElementsAreEqual(change.modifiedStart, change.modifiedStart + change.modifiedLength))) { | ||
change.originalStart++; | ||
change.modifiedStart++; | ||
} | ||
} | ||
// Build up the new list (we have to build a new list because we | ||
// might have changes we can merge together now) | ||
var result = new Array(); | ||
var mergedChangeArr = [null]; | ||
for (var i = 0; i < changes.length; i++) { | ||
if (i < changes.length - 1 && this.ChangesOverlap(changes[i], changes[i + 1], mergedChangeArr)) { | ||
mergedDiffs = true; | ||
result.push(mergedChangeArr[0]); | ||
i++; | ||
} else { | ||
result.push(changes[i]); | ||
} | ||
} | ||
changes = result; | ||
} while (mergedDiffs); | ||
// Shift changes back up until we hit empty or whitespace-only lines | ||
for (var i = changes.length - 1; i >= 0; i--) { | ||
var change = changes[i]; | ||
var originalStop = 0; | ||
var modifiedStop = 0; | ||
if (i > 0) { | ||
var prevChange = changes[i - 1]; | ||
if (prevChange.originalLength > 0) { | ||
originalStop = prevChange.originalStart + prevChange.originalLength; | ||
} | ||
if (prevChange.modifiedLength > 0) { | ||
modifiedStop = prevChange.modifiedStart + prevChange.modifiedLength; | ||
} | ||
} | ||
var checkOriginal = change.originalLength > 0; | ||
var checkModified = change.modifiedLength > 0; | ||
var bestDelta = 0; | ||
var bestScore = this._boundaryScore(change.originalStart, change.originalLength, change.modifiedStart, change.modifiedLength); | ||
for (var delta = 1;; delta++) { | ||
var originalStart = change.originalStart - delta; | ||
var modifiedStart = change.modifiedStart - delta; | ||
if (originalStart < originalStop || modifiedStart < modifiedStop) { | ||
break; | ||
} | ||
if (checkOriginal && !this.OriginalElementsAreEqual(originalStart, originalStart + change.originalLength)) { | ||
break; | ||
} | ||
if (checkModified && !this.ModifiedElementsAreEqual(modifiedStart, modifiedStart + change.modifiedLength)) { | ||
break; | ||
} | ||
var score = this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength); | ||
if (score > bestScore) { | ||
bestScore = score; | ||
bestDelta = delta; | ||
} | ||
} | ||
change.originalStart -= bestDelta; | ||
change.modifiedStart -= bestDelta; | ||
} | ||
return changes; | ||
}; | ||
LcsDiff.prototype._OriginalIsBoundary = function (index) { | ||
if (index <= 0 || index >= this.OriginalSequence.getLength() - 1) { | ||
return true; | ||
} | ||
return (/^\s*$/.test(this.OriginalSequence.getElementHash(index)) | ||
); | ||
}; | ||
LcsDiff.prototype._OriginalRegionIsBoundary = function (originalStart, originalLength) { | ||
if (this._OriginalIsBoundary(originalStart) || this._OriginalIsBoundary(originalStart - 1)) { | ||
return true; | ||
} | ||
if (originalLength > 0) { | ||
var originalEnd = originalStart + originalLength; | ||
if (this._OriginalIsBoundary(originalEnd - 1) || this._OriginalIsBoundary(originalEnd)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
LcsDiff.prototype._ModifiedIsBoundary = function (index) { | ||
if (index <= 0 || index >= this.ModifiedSequence.getLength() - 1) { | ||
return true; | ||
} | ||
return (/^\s*$/.test(this.ModifiedSequence.getElementHash(index)) | ||
); | ||
}; | ||
LcsDiff.prototype._ModifiedRegionIsBoundary = function (modifiedStart, modifiedLength) { | ||
if (this._ModifiedIsBoundary(modifiedStart) || this._ModifiedIsBoundary(modifiedStart - 1)) { | ||
return true; | ||
} | ||
if (modifiedLength > 0) { | ||
var modifiedEnd = modifiedStart + modifiedLength; | ||
if (this._ModifiedIsBoundary(modifiedEnd - 1) || this._ModifiedIsBoundary(modifiedEnd)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
LcsDiff.prototype._boundaryScore = function (originalStart, originalLength, modifiedStart, modifiedLength) { | ||
var originalScore = this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0; | ||
var modifiedScore = this._ModifiedRegionIsBoundary(modifiedStart, modifiedLength) ? 1 : 0; | ||
return originalScore + modifiedScore; | ||
}; | ||
/** | ||
* Concatenates the two input DiffChange lists and returns the resulting | ||
@@ -752,0 +881,0 @@ * list. |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 70); | ||
/******/ return __webpack_require__(__webpack_require__.s = 61); | ||
/******/ }) | ||
@@ -74,9 +71,6 @@ /************************************************************************/ | ||
/***/ 27: | ||
/***/ 29: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -88,2 +82,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DifferenceType = { | ||
@@ -97,3 +92,3 @@ Add: 0, | ||
*/ | ||
var DiffChange = function () { | ||
var DiffChange = /** @class */function () { | ||
/** | ||
@@ -143,9 +138,6 @@ * Constructs a new DiffChange with the given sequence information | ||
/***/ 70: | ||
/***/ 61: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(27)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, diffChange_1) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(29)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, diffChange_1) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -156,7 +148,8 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* An implementation of the difference algorithm described by Hirschberg | ||
*/ | ||
var LcsDiff2 = function () { | ||
var LcsDiff2 = /** @class */function () { | ||
function LcsDiff2(originalSequence, newSequence, continueProcessingPredicate, hashFunc) { | ||
@@ -163,0 +156,0 @@ this.x = originalSequence; |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 27); | ||
/******/ return __webpack_require__(__webpack_require__.s = 29); | ||
/******/ }) | ||
@@ -74,9 +71,6 @@ /************************************************************************/ | ||
/***/ 27: | ||
/***/ 29: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -88,2 +82,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DifferenceType = { | ||
@@ -97,3 +92,3 @@ Add: 0, | ||
*/ | ||
var DiffChange = function () { | ||
var DiffChange = /** @class */function () { | ||
/** | ||
@@ -100,0 +95,0 @@ * Constructs a new DiffChange with the given sequence information |
@@ -18,2 +18,3 @@ import { IDisposable } from './lifecycle'; | ||
onFirstListenerDidAdd?: Function; | ||
onListenerDidAdd?: Function; | ||
onLastListenerRemove?: Function; | ||
@@ -99,2 +100,3 @@ } | ||
export declare function fromPromise(promise: TPromise<any>): Event<void>; | ||
export declare function toPromise<T>(event: Event<T>): TPromise<T>; | ||
export declare function delayed<T>(promise: TPromise<Event<T>>): Event<T>; | ||
@@ -163,1 +165,6 @@ export declare function once<T>(event: Event<T>): Event<T>; | ||
export declare function buffer<T>(event: Event<T>, nextTick?: boolean, buffer?: T[]): Event<T>; | ||
/** | ||
* Similar to `buffer` but it buffers indefinitely and repeats | ||
* the buffered events to every new listener. | ||
*/ | ||
export declare function echo<T>(event: Event<T>, nextTick?: boolean, buffer?: T[]): Event<T>; |
import { IDisposable } from './lifecycle'; | ||
export declare class EmitterEvent { | ||
private _type; | ||
private _data; | ||
readonly type: string; | ||
readonly data: any; | ||
constructor(eventType?: string, data?: any); | ||
getType(): string; | ||
getData(): any; | ||
} | ||
@@ -15,8 +13,10 @@ export interface ListenerCallback { | ||
} | ||
export interface IEventEmitter extends IDisposable { | ||
addListener2(eventType: string, listener: ListenerCallback): IDisposable; | ||
addOneTimeDisposableListener(eventType: string, listener: ListenerCallback): IDisposable; | ||
addBulkListener2(listener: BulkListenerCallback): IDisposable; | ||
addEmitter2(eventEmitter: IEventEmitter): IDisposable; | ||
export interface IBaseEventEmitter { | ||
addBulkListener(listener: BulkListenerCallback): IDisposable; | ||
} | ||
export interface IEventEmitter extends IBaseEventEmitter, IDisposable { | ||
addListener(eventType: string, listener: ListenerCallback): IDisposable; | ||
addOneTimeListener(eventType: string, listener: ListenerCallback): IDisposable; | ||
addEmitter(eventEmitter: IEventEmitter): IDisposable; | ||
} | ||
export interface IListenersMap { | ||
@@ -33,9 +33,6 @@ [key: string]: ListenerCallback[]; | ||
dispose(): void; | ||
private addListener(eventType, listener); | ||
addListener2(eventType: string, listener: ListenerCallback): IDisposable; | ||
addOneTimeDisposableListener(eventType: string, listener: ListenerCallback): IDisposable; | ||
protected addBulkListener(listener: BulkListenerCallback): IDisposable; | ||
addBulkListener2(listener: BulkListenerCallback): IDisposable; | ||
private addEmitter(eventEmitter); | ||
addEmitter2(eventEmitter: IEventEmitter): IDisposable; | ||
addListener(eventType: string, listener: ListenerCallback): IDisposable; | ||
addOneTimeListener(eventType: string, listener: ListenerCallback): IDisposable; | ||
addBulkListener(listener: BulkListenerCallback): IDisposable; | ||
addEmitter(eventEmitter: IBaseEventEmitter): IDisposable; | ||
private _removeListener(eventType, listener); | ||
@@ -47,4 +44,4 @@ private _removeBulkListener(listener); | ||
emit(eventType: string, data?: any): void; | ||
protected _beginDeferredEmit(): void; | ||
protected _endDeferredEmit(): void; | ||
beginDeferredEmit(): void; | ||
endDeferredEmit(): void; | ||
deferredEmit<T>(callback: () => T): T; | ||
@@ -58,3 +55,3 @@ private _emitCollected(); | ||
private _emitQueue; | ||
constructor(allowedEventTypes?: string[]); | ||
constructor(); | ||
protected _emitToSpecificTypeListeners(eventType: string, data: any): void; | ||
@@ -61,0 +58,0 @@ protected _emitToBulkListeners(events: EmitterEvent[]): void; |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 38); | ||
/******/ return __webpack_require__(__webpack_require__.s = 36); | ||
/******/ }) | ||
@@ -74,16 +71,19 @@ /************************************************************************/ | ||
/***/ 38: | ||
/***/ 36: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var __extends = undefined && undefined.__extends || function (d, b) { | ||
for (var p in b) { | ||
if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
}function __() { | ||
this.constructor = d; | ||
} | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = this && this.__extends || function () { | ||
var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { | ||
d.__proto__ = b; | ||
} || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { | ||
this.constructor = d; | ||
} | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
}(); | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
@@ -96,3 +96,4 @@ /*--------------------------------------------------------------------------------------------- | ||
var Event = function () { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var Event = /** @class */function () { | ||
function Event(originalEvent) { | ||
@@ -106,3 +107,3 @@ this.time = new Date().getTime(); | ||
exports.Event = Event; | ||
var PropertyChangeEvent = function (_super) { | ||
var PropertyChangeEvent = /** @class */function (_super) { | ||
__extends(PropertyChangeEvent, _super); | ||
@@ -119,3 +120,3 @@ function PropertyChangeEvent(key, oldValue, newValue, originalEvent) { | ||
exports.PropertyChangeEvent = PropertyChangeEvent; | ||
var ViewerEvent = function (_super) { | ||
var ViewerEvent = /** @class */function (_super) { | ||
__extends(ViewerEvent, _super); | ||
@@ -122,0 +123,0 @@ function ViewerEvent(element, originalEvent) { |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 10); | ||
/******/ return __webpack_require__(__webpack_require__.s = 5); | ||
/******/ }) | ||
@@ -74,9 +71,6 @@ /************************************************************************/ | ||
/***/ 10: | ||
/***/ 5: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
/*--------------------------------------------------------------------------------------------- | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
@@ -88,2 +82,3 @@ * Licensed under the MIT License. See License.txt in the project root for license information. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function not(fn) { | ||
@@ -90,0 +85,0 @@ return function () { |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 75); | ||
/******/ return __webpack_require__(__webpack_require__.s = 64); | ||
/******/ }) | ||
@@ -74,11 +71,6 @@ /************************************************************************/ | ||
/***/ 1: | ||
/***/ 2: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -90,2 +82,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var _typeof = { | ||
@@ -105,3 +98,3 @@ number: 'number', | ||
} | ||
if (array && _typeof2(array.length) === _typeof.number && array.constructor === Array) { | ||
if (array && typeof array.length === _typeof.number && array.constructor === Array) { | ||
return true; | ||
@@ -116,3 +109,3 @@ } | ||
function isString(str) { | ||
if ((typeof str === "undefined" ? "undefined" : _typeof2(str)) === _typeof.string || str instanceof String) { | ||
if (typeof str === _typeof.string || str instanceof String) { | ||
return true; | ||
@@ -141,3 +134,3 @@ } | ||
// narrowing results in wrong results. | ||
return (typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.object && obj !== null && !Array.isArray(obj) && !(obj instanceof RegExp) && !(obj instanceof Date); | ||
return typeof obj === _typeof.object && obj !== null && !Array.isArray(obj) && !(obj instanceof RegExp) && !(obj instanceof Date); | ||
} | ||
@@ -150,3 +143,3 @@ exports.isObject = isObject; | ||
function isNumber(obj) { | ||
if (((typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.number || obj instanceof Number) && !isNaN(obj)) { | ||
if ((typeof obj === _typeof.number || obj instanceof Number) && !isNaN(obj)) { | ||
return true; | ||
@@ -168,3 +161,3 @@ } | ||
function isUndefined(obj) { | ||
return (typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.undefined; | ||
return typeof obj === _typeof.undefined; | ||
} | ||
@@ -199,3 +192,3 @@ exports.isUndefined = isUndefined; | ||
function isFunction(obj) { | ||
return (typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.function; | ||
return typeof obj === _typeof.function; | ||
} | ||
@@ -223,3 +216,3 @@ exports.isFunction = isFunction; | ||
if (isString(constraint)) { | ||
if ((typeof arg === "undefined" ? "undefined" : _typeof2(arg)) !== constraint) { | ||
if (typeof arg !== constraint) { | ||
throw new Error("argument does not match constraint: typeof " + constraint); | ||
@@ -261,9 +254,6 @@ } | ||
/***/ 36: | ||
/***/ 37: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -275,3 +265,8 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
/** | ||
* Returns an array which contains all values that reside | ||
* in the given set. | ||
*/ | ||
function values(from) { | ||
@@ -287,5 +282,19 @@ var result = []; | ||
exports.values = values; | ||
function forEach(from, callback) { | ||
function size(from) { | ||
var count = 0; | ||
for (var key in from) { | ||
if (hasOwnProperty.call(from, key)) { | ||
count += 1; | ||
} | ||
} | ||
return count; | ||
} | ||
exports.size = size; | ||
/** | ||
* Iterates over each entry in the provided set. The iterator allows | ||
* to remove elements and will stop when the callback returns {{false}}. | ||
*/ | ||
function forEach(from, callback) { | ||
var _loop_1 = function (key) { | ||
if (hasOwnProperty.call(from, key)) { | ||
var result = callback({ key: key, value: from[key] }, function () { | ||
@@ -295,8 +304,16 @@ delete from[key]; | ||
if (result === false) { | ||
return; | ||
return { value: void 0 }; | ||
} | ||
} | ||
}; | ||
for (var key in from) { | ||
var state_1 = _loop_1(key); | ||
if (typeof state_1 === "object") return state_1.value; | ||
} | ||
} | ||
exports.forEach = forEach; | ||
/** | ||
* Removes an element from the dictionary. Returns {{false}} if the property | ||
* does not exists. | ||
*/ | ||
function remove(from, key) { | ||
@@ -334,9 +351,6 @@ if (!hasOwnProperty.call(from, key)) { | ||
/***/ 75: | ||
/***/ 64: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(1), __webpack_require__(36)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, types_1, collections_1) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(2), __webpack_require__(37)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, types_1, collections_1) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -348,2 +362,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function newNode(data) { | ||
@@ -356,3 +371,3 @@ return { | ||
} | ||
var Graph = function () { | ||
var Graph = /** @class */function () { | ||
function Graph(_hashFn) { | ||
@@ -419,3 +434,3 @@ this._hashFn = _hashFn; | ||
Object.defineProperty(Graph.prototype, "length", { | ||
get: function get() { | ||
get: function () { | ||
return Object.keys(this._nodes).length; | ||
@@ -422,0 +437,0 @@ }, |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 76); | ||
/******/ return __webpack_require__(__webpack_require__.s = 65); | ||
/******/ }) | ||
@@ -74,11 +71,6 @@ /************************************************************************/ | ||
/***/ 76: | ||
/***/ 65: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -89,6 +81,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* Return a hash value for an object. | ||
*/ | ||
function hash(obj, hashVal) { | ||
@@ -98,3 +91,3 @@ if (hashVal === void 0) { | ||
} | ||
switch (typeof obj === "undefined" ? "undefined" : _typeof(obj)) { | ||
switch (typeof obj) { | ||
case 'object': | ||
@@ -101,0 +94,0 @@ if (obj === null) { |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 77); | ||
/******/ return __webpack_require__(__webpack_require__.s = 66); | ||
/******/ }) | ||
@@ -74,80 +71,28 @@ /************************************************************************/ | ||
/***/ 28: | ||
/***/ 39: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
/*--------------------------------------------------------------------------------------------- | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
"use strict"; | ||
var ArraySet = function () { | ||
function ArraySet(elements) { | ||
if (elements === void 0) { | ||
elements = []; | ||
} | ||
this._elements = elements.slice(); | ||
var __extends = this && this.__extends || function () { | ||
var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { | ||
d.__proto__ = b; | ||
} || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { | ||
this.constructor = d; | ||
} | ||
Object.defineProperty(ArraySet.prototype, "size", { | ||
get: function get() { | ||
return this._elements.length; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
ArraySet.prototype.set = function (element) { | ||
this.unset(element); | ||
this._elements.push(element); | ||
}; | ||
ArraySet.prototype.contains = function (element) { | ||
return this._elements.indexOf(element) > -1; | ||
}; | ||
ArraySet.prototype.unset = function (element) { | ||
var index = this._elements.indexOf(element); | ||
if (index > -1) { | ||
this._elements.splice(index, 1); | ||
} | ||
}; | ||
Object.defineProperty(ArraySet.prototype, "elements", { | ||
get: function get() { | ||
return this._elements.slice(); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
return ArraySet; | ||
}(); | ||
exports.ArraySet = ArraySet; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
//# sourceMappingURL=set.js.map | ||
/***/ }), | ||
/***/ 39: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
var __extends = undefined && undefined.__extends || function (d, b) { | ||
for (var p in b) { | ||
if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
}function __() { | ||
this.constructor = d; | ||
} | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
}(); | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
'use strict'; | ||
var ArrayIterator = function () { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ArrayIterator = /** @class */function () { | ||
function ArrayIterator(items, start, end) { | ||
@@ -182,3 +127,3 @@ if (start === void 0) { | ||
exports.ArrayIterator = ArrayIterator; | ||
var ArrayNavigator = function (_super) { | ||
var ArrayNavigator = /** @class */function (_super) { | ||
__extends(ArrayNavigator, _super); | ||
@@ -215,3 +160,3 @@ function ArrayNavigator(items, start, end) { | ||
exports.ArrayNavigator = ArrayNavigator; | ||
var MappedIterator = function () { | ||
var MappedIterator = /** @class */function () { | ||
function MappedIterator(iterator, fn) { | ||
@@ -228,3 +173,3 @@ this.iterator = iterator; | ||
exports.MappedIterator = MappedIterator; | ||
var MappedNavigator = function (_super) { | ||
var MappedNavigator = /** @class */function (_super) { | ||
__extends(MappedNavigator, _super); | ||
@@ -263,16 +208,14 @@ function MappedNavigator(navigator, fn) { | ||
/***/ 77: | ||
/***/ 66: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
/*--------------------------------------------------------------------------------------------- | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(28), __webpack_require__(39)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, set_1, iterator_1) { | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(39)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, iterator_1) { | ||
"use strict"; | ||
var HistoryNavigator = function () { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var HistoryNavigator = /** @class */function () { | ||
function HistoryNavigator(history, limit) { | ||
@@ -285,10 +228,19 @@ if (history === void 0) { | ||
} | ||
this._history = new set_1.ArraySet(history); | ||
this._initialize(history); | ||
this._limit = limit; | ||
this._onChange(); | ||
} | ||
HistoryNavigator.prototype.getHistory = function () { | ||
return this._elements; | ||
}; | ||
HistoryNavigator.prototype.add = function (t) { | ||
this._history.set(t); | ||
this._history.delete(t); | ||
this._history.add(t); | ||
this._onChange(); | ||
}; | ||
HistoryNavigator.prototype.addIfNotPresent = function (t) { | ||
if (!this._history.has(t)) { | ||
this.add(t); | ||
} | ||
}; | ||
HistoryNavigator.prototype.next = function () { | ||
@@ -322,11 +274,29 @@ if (this._navigator.next()) { | ||
this._reduceToLimit(); | ||
this._navigator = new iterator_1.ArrayNavigator(this._history.elements); | ||
this._navigator = new iterator_1.ArrayNavigator(this._elements); | ||
this._navigator.last(); | ||
}; | ||
HistoryNavigator.prototype._reduceToLimit = function () { | ||
var data = this._history.elements; | ||
var data = this._elements; | ||
if (data.length > this._limit) { | ||
this._history = new set_1.ArraySet(data.slice(data.length - this._limit)); | ||
this._initialize(data.slice(data.length - this._limit)); | ||
} | ||
}; | ||
HistoryNavigator.prototype._initialize = function (history) { | ||
this._history = new Set(); | ||
for (var _i = 0, history_1 = history; _i < history_1.length; _i++) { | ||
var entry = history_1[_i]; | ||
this._history.add(entry); | ||
} | ||
}; | ||
Object.defineProperty(HistoryNavigator.prototype, "_elements", { | ||
get: function () { | ||
var elements = []; | ||
this._history.forEach(function (e) { | ||
return elements.push(e); | ||
}); | ||
return elements; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
return HistoryNavigator; | ||
@@ -333,0 +303,0 @@ }(); |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 78); | ||
/******/ return __webpack_require__(__webpack_require__.s = 67); | ||
/******/ }) | ||
@@ -74,99 +71,1678 @@ /************************************************************************/ | ||
/***/ 78: | ||
/***/ 13: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
'use strict'; | ||
function markedStringsEquals(a, b) { | ||
if (!a && !b) { | ||
return true; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* Returns the last element of an array. | ||
* @param array The array. | ||
* @param n Which element from the end (default is zero). | ||
*/ | ||
function tail(array, n) { | ||
if (n === void 0) { | ||
n = 0; | ||
} | ||
if (!a || !b) { | ||
return array[array.length - (1 + n)]; | ||
} | ||
exports.tail = tail; | ||
function equals(one, other, itemEquals) { | ||
if (itemEquals === void 0) { | ||
itemEquals = function (a, b) { | ||
return a === b; | ||
}; | ||
} | ||
if (one.length !== other.length) { | ||
return false; | ||
} | ||
if (Array.isArray(a)) { | ||
if (!Array.isArray(b)) { | ||
for (var i = 0, len = one.length; i < len; i++) { | ||
if (!itemEquals(one[i], other[i])) { | ||
return false; | ||
} | ||
return markedStringArrEquals(a, b); | ||
} | ||
return markedStringEqual(a, b); | ||
return true; | ||
} | ||
exports.markedStringsEquals = markedStringsEquals; | ||
function markedStringArrEquals(a, b) { | ||
var aLen = a.length, | ||
bLen = b.length; | ||
if (aLen !== bLen) { | ||
return false; | ||
exports.equals = equals; | ||
function binarySearch(array, key, comparator) { | ||
var low = 0, | ||
high = array.length - 1; | ||
while (low <= high) { | ||
var mid = (low + high) / 2 | 0; | ||
var comp = comparator(array[mid], key); | ||
if (comp < 0) { | ||
low = mid + 1; | ||
} else if (comp > 0) { | ||
high = mid - 1; | ||
} else { | ||
return mid; | ||
} | ||
} | ||
for (var i = 0; i < aLen; i++) { | ||
if (!markedStringEqual(a[i], b[i])) { | ||
return false; | ||
return -(low + 1); | ||
} | ||
exports.binarySearch = binarySearch; | ||
/** | ||
* Takes a sorted array and a function p. The array is sorted in such a way that all elements where p(x) is false | ||
* are located before all elements where p(x) is true. | ||
* @returns the least x for which p(x) is true or array.length if no element fullfills the given function. | ||
*/ | ||
function findFirst(array, p) { | ||
var low = 0, | ||
high = array.length; | ||
if (high === 0) { | ||
return 0; // no children | ||
} | ||
while (low < high) { | ||
var mid = Math.floor((low + high) / 2); | ||
if (p(array[mid])) { | ||
high = mid; | ||
} else { | ||
low = mid + 1; | ||
} | ||
} | ||
return true; | ||
return low; | ||
} | ||
function markedStringEqual(a, b) { | ||
if (!a && !b) { | ||
exports.findFirst = findFirst; | ||
/** | ||
* Like `Array#sort` but always stable. Usually runs a little slower `than Array#sort` | ||
* so only use this when actually needing stable sort. | ||
*/ | ||
function mergeSort(data, compare) { | ||
_divideAndMerge(data, compare); | ||
return data; | ||
} | ||
exports.mergeSort = mergeSort; | ||
function _divideAndMerge(data, compare) { | ||
if (data.length <= 1) { | ||
// sorted | ||
return; | ||
} | ||
var p = data.length / 2 | 0; | ||
var left = data.slice(0, p); | ||
var right = data.slice(p); | ||
_divideAndMerge(left, compare); | ||
_divideAndMerge(right, compare); | ||
var leftIdx = 0; | ||
var rightIdx = 0; | ||
var i = 0; | ||
while (leftIdx < left.length && rightIdx < right.length) { | ||
var ret = compare(left[leftIdx], right[rightIdx]); | ||
if (ret <= 0) { | ||
// smaller_equal -> take left to preserve order | ||
data[i++] = left[leftIdx++]; | ||
} else { | ||
// greater -> take right | ||
data[i++] = right[rightIdx++]; | ||
} | ||
} | ||
while (leftIdx < left.length) { | ||
data[i++] = left[leftIdx++]; | ||
} | ||
while (rightIdx < right.length) { | ||
data[i++] = right[rightIdx++]; | ||
} | ||
} | ||
function groupBy(data, compare) { | ||
var result = []; | ||
var currentGroup; | ||
for (var _i = 0, _a = data.slice(0).sort(compare); _i < _a.length; _i++) { | ||
var element = _a[_i]; | ||
if (!currentGroup || compare(currentGroup[0], element) !== 0) { | ||
currentGroup = [element]; | ||
result.push(currentGroup); | ||
} else { | ||
currentGroup.push(element); | ||
} | ||
} | ||
return result; | ||
} | ||
exports.groupBy = groupBy; | ||
/** | ||
* Takes two *sorted* arrays and computes their delta (removed, added elements). | ||
* Finishes in `Math.min(before.length, after.length)` steps. | ||
* @param before | ||
* @param after | ||
* @param compare | ||
*/ | ||
function delta(before, after, compare) { | ||
var removed = []; | ||
var added = []; | ||
var beforeIdx = 0; | ||
var afterIdx = 0; | ||
while (true) { | ||
if (beforeIdx === before.length) { | ||
added.push.apply(added, after.slice(afterIdx)); | ||
break; | ||
} | ||
if (afterIdx === after.length) { | ||
removed.push.apply(removed, before.slice(beforeIdx)); | ||
break; | ||
} | ||
var beforeElement = before[beforeIdx]; | ||
var afterElement = after[afterIdx]; | ||
var n = compare(beforeElement, afterElement); | ||
if (n === 0) { | ||
// equal | ||
beforeIdx += 1; | ||
afterIdx += 1; | ||
} else if (n < 0) { | ||
// beforeElement is smaller -> before element removed | ||
removed.push(beforeElement); | ||
beforeIdx += 1; | ||
} else if (n > 0) { | ||
// beforeElement is greater -> after element added | ||
added.push(afterElement); | ||
afterIdx += 1; | ||
} | ||
} | ||
return { removed: removed, added: added }; | ||
} | ||
exports.delta = delta; | ||
/** | ||
* Returns the top N elements from the array. | ||
* | ||
* Faster than sorting the entire array when the array is a lot larger than N. | ||
* | ||
* @param array The unsorted array. | ||
* @param compare A sort function for the elements. | ||
* @param n The number of elements to return. | ||
* @return The first n elemnts from array when sorted with compare. | ||
*/ | ||
function top(array, compare, n) { | ||
if (n === 0) { | ||
return []; | ||
} | ||
var result = array.slice(0, n).sort(compare); | ||
var _loop_1 = function (i, m) { | ||
var element = array[i]; | ||
if (compare(element, result[n - 1]) < 0) { | ||
result.pop(); | ||
var j = findFirst(result, function (e) { | ||
return compare(element, e) < 0; | ||
}); | ||
result.splice(j, 0, element); | ||
} | ||
}; | ||
for (var i = n, m = array.length; i < m; i++) { | ||
_loop_1(i, m); | ||
} | ||
return result; | ||
} | ||
exports.top = top; | ||
/** | ||
* @returns a new array with all undefined or null values removed. The original array is not modified at all. | ||
*/ | ||
function coalesce(array) { | ||
if (!array) { | ||
return array; | ||
} | ||
return array.filter(function (e) { | ||
return !!e; | ||
}); | ||
} | ||
exports.coalesce = coalesce; | ||
/** | ||
* Moves the element in the array for the provided positions. | ||
*/ | ||
function move(array, from, to) { | ||
array.splice(to, 0, array.splice(from, 1)[0]); | ||
} | ||
exports.move = move; | ||
/** | ||
* @returns {{false}} if the provided object is an array | ||
* and not empty. | ||
*/ | ||
function isFalsyOrEmpty(obj) { | ||
return !Array.isArray(obj) || obj.length === 0; | ||
} | ||
exports.isFalsyOrEmpty = isFalsyOrEmpty; | ||
/** | ||
* Removes duplicates from the given array. The optional keyFn allows to specify | ||
* how elements are checked for equalness by returning a unique string for each. | ||
*/ | ||
function distinct(array, keyFn) { | ||
if (!keyFn) { | ||
return array.filter(function (element, position) { | ||
return array.indexOf(element) === position; | ||
}); | ||
} | ||
var seen = Object.create(null); | ||
return array.filter(function (elem) { | ||
var key = keyFn(elem); | ||
if (seen[key]) { | ||
return false; | ||
} | ||
seen[key] = true; | ||
return true; | ||
}); | ||
} | ||
exports.distinct = distinct; | ||
function uniqueFilter(keyFn) { | ||
var seen = Object.create(null); | ||
return function (element) { | ||
var key = keyFn(element); | ||
if (seen[key]) { | ||
return false; | ||
} | ||
seen[key] = true; | ||
return true; | ||
}; | ||
} | ||
exports.uniqueFilter = uniqueFilter; | ||
function firstIndex(array, fn) { | ||
for (var i = 0; i < array.length; i++) { | ||
var element = array[i]; | ||
if (fn(element)) { | ||
return i; | ||
} | ||
} | ||
if (!a || !b) { | ||
return false; | ||
return -1; | ||
} | ||
exports.firstIndex = firstIndex; | ||
function first(array, fn, notFoundValue) { | ||
if (notFoundValue === void 0) { | ||
notFoundValue = null; | ||
} | ||
if (typeof a === 'string') { | ||
return typeof b === 'string' && a === b; | ||
var index = firstIndex(array, fn); | ||
return index < 0 ? notFoundValue : array[index]; | ||
} | ||
exports.first = first; | ||
function commonPrefixLength(one, other, equals) { | ||
if (equals === void 0) { | ||
equals = function (a, b) { | ||
return a === b; | ||
}; | ||
} | ||
return a['language'] === b['language'] && a['value'] === b['value']; | ||
var result = 0; | ||
for (var i = 0, len = Math.min(one.length, other.length); i < len && equals(one[i], other[i]); i++) { | ||
result++; | ||
} | ||
return result; | ||
} | ||
function textToMarkedString(text) { | ||
return text.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash | ||
exports.commonPrefixLength = commonPrefixLength; | ||
function flatten(arr) { | ||
return arr.reduce(function (r, v) { | ||
return r.concat(v); | ||
}, []); | ||
} | ||
exports.textToMarkedString = textToMarkedString; | ||
function removeMarkdownEscapes(text) { | ||
if (!text) { | ||
return text; | ||
exports.flatten = flatten; | ||
function range(to, from) { | ||
if (from === void 0) { | ||
from = 0; | ||
} | ||
return text.replace(/\\([\\`*_{}[\]()#+\-.!])/g, '$1'); | ||
var result = []; | ||
for (var i = from; i < to; i++) { | ||
result.push(i); | ||
} | ||
return result; | ||
} | ||
exports.removeMarkdownEscapes = removeMarkdownEscapes; | ||
function htmlContentElementCodeEqual(a, b) { | ||
if (!a && !b) { | ||
exports.range = range; | ||
function fill(num, valueFn, arr) { | ||
if (arr === void 0) { | ||
arr = []; | ||
} | ||
for (var i = 0; i < num; i++) { | ||
arr[i] = valueFn(); | ||
} | ||
return arr; | ||
} | ||
exports.fill = fill; | ||
function index(array, indexer, merger) { | ||
if (merger === void 0) { | ||
merger = function (t) { | ||
return t; | ||
}; | ||
} | ||
return array.reduce(function (r, t) { | ||
var key = indexer(t); | ||
r[key] = merger(t, r[key]); | ||
return r; | ||
}, Object.create(null)); | ||
} | ||
exports.index = index; | ||
/** | ||
* Inserts an element into an array. Returns a function which, when | ||
* called, will remove that element from the array. | ||
*/ | ||
function insert(array, element) { | ||
array.push(element); | ||
return function () { | ||
var index = array.indexOf(element); | ||
if (index > -1) { | ||
array.splice(index, 1); | ||
} | ||
}; | ||
} | ||
exports.insert = insert; | ||
/** | ||
* Insert `insertArr` inside `target` at `insertIndex`. | ||
* Please don't touch unless you understand https://jsperf.com/inserting-an-array-within-an-array | ||
*/ | ||
function arrayInsert(target, insertIndex, insertArr) { | ||
var before = target.slice(0, insertIndex); | ||
var after = target.slice(insertIndex); | ||
return before.concat(insertArr, after); | ||
} | ||
exports.arrayInsert = arrayInsert; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
//# sourceMappingURL=arrays.js.map | ||
/***/ }), | ||
/***/ 31: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** | ||
* marked - a markdown parser | ||
* Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) | ||
* https://github.com/chjj/marked | ||
*/ | ||
// TODO MonacoChange: we have our own way of defining modules | ||
// ;(function() { | ||
// END MonacoChange | ||
/** | ||
* Block-Level Grammar | ||
*/ | ||
var block = { | ||
newline: /^\n+/, | ||
code: /^( {4}[^\n]+\n*)+/, | ||
fences: noop, | ||
hr: /^( *[-*_]){3,} *(?:\n+|$)/, | ||
heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, | ||
nptable: noop, | ||
lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, | ||
blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/, | ||
list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, | ||
html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, | ||
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, | ||
table: noop, | ||
paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, | ||
text: /^[^\n]+/ | ||
}; | ||
block.bullet = /(?:[*+-]|\d+\.)/; | ||
block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; | ||
block.item = replace(block.item, 'gm')(/bull/g, block.bullet)(); | ||
block.list = replace(block.list)(/bull/g, block.bullet)('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')('def', '\\n+(?=' + block.def.source + ')')(); | ||
block.blockquote = replace(block.blockquote)('def', block.def)(); | ||
block._tag = '(?!(?:' + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b'; | ||
block.html = replace(block.html)('comment', /<!--[\s\S]*?-->/)('closed', /<(tag)[\s\S]+?<\/\1>/)('closing', /<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g, block._tag)(); | ||
block.paragraph = replace(block.paragraph)('hr', block.hr)('heading', block.heading)('lheading', block.lheading)('blockquote', block.blockquote)('tag', '<' + block._tag)('def', block.def)(); | ||
/** | ||
* Normal Block Grammar | ||
*/ | ||
block.normal = merge({}, block); | ||
/** | ||
* GFM Block Grammar | ||
*/ | ||
block.gfm = merge({}, block.normal, { | ||
fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/, | ||
paragraph: /^/, | ||
heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ | ||
}); | ||
block.gfm.paragraph = replace(block.paragraph)('(?!', '(?!' + block.gfm.fences.source.replace('\\1', '\\2') + '|' + block.list.source.replace('\\1', '\\3') + '|')(); | ||
/** | ||
* GFM + Tables Block Grammar | ||
*/ | ||
block.tables = merge({}, block.gfm, { | ||
nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/, | ||
table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/ | ||
}); | ||
/** | ||
* Block Lexer | ||
*/ | ||
function Lexer(options) { | ||
this.tokens = []; | ||
this.tokens.links = {}; | ||
this.options = options || marked.defaults; | ||
this.rules = block.normal; | ||
if (this.options.gfm) { | ||
if (this.options.tables) { | ||
this.rules = block.tables; | ||
} else { | ||
this.rules = block.gfm; | ||
} | ||
} | ||
} | ||
/** | ||
* Expose Block Rules | ||
*/ | ||
Lexer.rules = block; | ||
/** | ||
* Static Lex Method | ||
*/ | ||
Lexer.lex = function (src, options) { | ||
var lexer = new Lexer(options); | ||
return lexer.lex(src); | ||
}; | ||
/** | ||
* Preprocessing | ||
*/ | ||
Lexer.prototype.lex = function (src) { | ||
src = src.replace(/\r\n|\r/g, '\n').replace(/\t/g, ' ').replace(/\u00a0/g, ' ').replace(/\u2424/g, '\n'); | ||
return this.token(src, true); | ||
}; | ||
/** | ||
* Lexing | ||
*/ | ||
Lexer.prototype.token = function (src, top, bq) { | ||
var src = src.replace(/^ +$/gm, ''), | ||
next, | ||
loose, | ||
cap, | ||
bull, | ||
b, | ||
item, | ||
space, | ||
i, | ||
l; | ||
while (src) { | ||
// newline | ||
if (cap = this.rules.newline.exec(src)) { | ||
src = src.substring(cap[0].length); | ||
if (cap[0].length > 1) { | ||
this.tokens.push({ | ||
type: 'space' | ||
}); | ||
} | ||
} | ||
// code | ||
if (cap = this.rules.code.exec(src)) { | ||
src = src.substring(cap[0].length); | ||
cap = cap[0].replace(/^ {4}/gm, ''); | ||
this.tokens.push({ | ||
type: 'code', | ||
text: !this.options.pedantic ? cap.replace(/\n+$/, '') : cap | ||
}); | ||
continue; | ||
} | ||
// fences (gfm) | ||
if (cap = this.rules.fences.exec(src)) { | ||
src = src.substring(cap[0].length); | ||
this.tokens.push({ | ||
type: 'code', | ||
lang: cap[2], | ||
text: cap[3] || '' | ||
}); | ||
continue; | ||
} | ||
// heading | ||
if (cap = this.rules.heading.exec(src)) { | ||
src = src.substring(cap[0].length); | ||
this.tokens.push({ | ||
type: 'heading', | ||
depth: cap[1].length, | ||
text: cap[2] | ||
}); | ||
continue; | ||
} | ||
// table no leading pipe (gfm) | ||
if (top && (cap = this.rules.nptable.exec(src))) { | ||
src = src.substring(cap[0].length); | ||
item = { | ||
type: 'table', | ||
header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), | ||
align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), | ||
cells: cap[3].replace(/\n$/, '').split('\n') | ||
}; | ||
for (i = 0; i < item.align.length; i++) { | ||
if (/^ *-+: *$/.test(item.align[i])) { | ||
item.align[i] = 'right'; | ||
} else if (/^ *:-+: *$/.test(item.align[i])) { | ||
item.align[i] = 'center'; | ||
} else if (/^ *:-+ *$/.test(item.align[i])) { | ||
item.align[i] = 'left'; | ||
} else { | ||
item.align[i] = null; | ||
} | ||
} | ||
for (i = 0; i < item.cells.length; i++) { | ||
item.cells[i] = item.cells[i].split(/ *\| */); | ||
} | ||
this.tokens.push(item); | ||
continue; | ||
} | ||
// lheading | ||
if (cap = this.rules.lheading.exec(src)) { | ||
src = src.substring(cap[0].length); | ||
this.tokens.push({ | ||
type: 'heading', | ||
depth: cap[2] === '=' ? 1 : 2, | ||
text: cap[1] | ||
}); | ||
continue; | ||
} | ||
// hr | ||
if (cap = this.rules.hr.exec(src)) { | ||
src = src.substring(cap[0].length); | ||
this.tokens.push({ | ||
type: 'hr' | ||
}); | ||
continue; | ||
} | ||
// blockquote | ||
if (cap = this.rules.blockquote.exec(src)) { | ||
src = src.substring(cap[0].length); | ||
this.tokens.push({ | ||
type: 'blockquote_start' | ||
}); | ||
cap = cap[0].replace(/^ *> ?/gm, ''); | ||
// Pass `top` to keep the current | ||
// "toplevel" state. This is exactly | ||
// how markdown.pl works. | ||
this.token(cap, top, true); | ||
this.tokens.push({ | ||
type: 'blockquote_end' | ||
}); | ||
continue; | ||
} | ||
// list | ||
if (cap = this.rules.list.exec(src)) { | ||
src = src.substring(cap[0].length); | ||
bull = cap[2]; | ||
this.tokens.push({ | ||
type: 'list_start', | ||
ordered: bull.length > 1 | ||
}); | ||
// Get each top-level item. | ||
cap = cap[0].match(this.rules.item); | ||
next = false; | ||
l = cap.length; | ||
i = 0; | ||
for (; i < l; i++) { | ||
item = cap[i]; | ||
// Remove the list item's bullet | ||
// so it is seen as the next token. | ||
space = item.length; | ||
item = item.replace(/^ *([*+-]|\d+\.) +/, ''); | ||
// Outdent whatever the | ||
// list item contains. Hacky. | ||
if (~item.indexOf('\n ')) { | ||
space -= item.length; | ||
item = !this.options.pedantic ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') : item.replace(/^ {1,4}/gm, ''); | ||
} | ||
// Determine whether the next list item belongs here. | ||
// Backpedal if it does not belong in this list. | ||
if (this.options.smartLists && i !== l - 1) { | ||
b = block.bullet.exec(cap[i + 1])[0]; | ||
if (bull !== b && !(bull.length > 1 && b.length > 1)) { | ||
src = cap.slice(i + 1).join('\n') + src; | ||
i = l - 1; | ||
} | ||
} | ||
// Determine whether item is loose or not. | ||
// Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ | ||
// for discount behavior. | ||
loose = next || /\n\n(?!\s*$)/.test(item); | ||
if (i !== l - 1) { | ||
next = item.charAt(item.length - 1) === '\n'; | ||
if (!loose) loose = next; | ||
} | ||
this.tokens.push({ | ||
type: loose ? 'loose_item_start' : 'list_item_start' | ||
}); | ||
// Recurse. | ||
this.token(item, false, bq); | ||
this.tokens.push({ | ||
type: 'list_item_end' | ||
}); | ||
} | ||
this.tokens.push({ | ||
type: 'list_end' | ||
}); | ||
continue; | ||
} | ||
// html | ||
if (cap = this.rules.html.exec(src)) { | ||
src = src.substring(cap[0].length); | ||
this.tokens.push({ | ||
type: this.options.sanitize ? 'paragraph' : 'html', | ||
pre: !this.options.sanitizer && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), | ||
text: cap[0] | ||
}); | ||
continue; | ||
} | ||
// def | ||
if (!bq && top && (cap = this.rules.def.exec(src))) { | ||
src = src.substring(cap[0].length); | ||
this.tokens.links[cap[1].toLowerCase()] = { | ||
href: cap[2], | ||
title: cap[3] | ||
}; | ||
continue; | ||
} | ||
// table (gfm) | ||
if (top && (cap = this.rules.table.exec(src))) { | ||
src = src.substring(cap[0].length); | ||
item = { | ||
type: 'table', | ||
header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), | ||
align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), | ||
cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') | ||
}; | ||
for (i = 0; i < item.align.length; i++) { | ||
if (/^ *-+: *$/.test(item.align[i])) { | ||
item.align[i] = 'right'; | ||
} else if (/^ *:-+: *$/.test(item.align[i])) { | ||
item.align[i] = 'center'; | ||
} else if (/^ *:-+ *$/.test(item.align[i])) { | ||
item.align[i] = 'left'; | ||
} else { | ||
item.align[i] = null; | ||
} | ||
} | ||
for (i = 0; i < item.cells.length; i++) { | ||
item.cells[i] = item.cells[i].replace(/^ *\| *| *\| *$/g, '').split(/ *\| */); | ||
} | ||
this.tokens.push(item); | ||
continue; | ||
} | ||
// top-level paragraph | ||
if (top && (cap = this.rules.paragraph.exec(src))) { | ||
src = src.substring(cap[0].length); | ||
this.tokens.push({ | ||
type: 'paragraph', | ||
text: cap[1].charAt(cap[1].length - 1) === '\n' ? cap[1].slice(0, -1) : cap[1] | ||
}); | ||
continue; | ||
} | ||
// text | ||
if (cap = this.rules.text.exec(src)) { | ||
// Top-level should never reach here. | ||
src = src.substring(cap[0].length); | ||
this.tokens.push({ | ||
type: 'text', | ||
text: cap[0] | ||
}); | ||
continue; | ||
} | ||
if (src) { | ||
throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); | ||
} | ||
} | ||
return this.tokens; | ||
}; | ||
/** | ||
* Inline-Level Grammar | ||
*/ | ||
var inline = { | ||
escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, | ||
autolink: /^<([^ >]+(@|:\/)[^ >]+)>/, | ||
url: noop, | ||
tag: /^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/, | ||
link: /^!?\[(inside)\]\(href\)/, | ||
reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, | ||
nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, | ||
strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, | ||
em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, | ||
code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, | ||
br: /^ {2,}\n(?!\s*$)/, | ||
del: noop, | ||
text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/ | ||
}; | ||
inline._inside = /(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/; | ||
inline._href = /\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/; | ||
inline.link = replace(inline.link)('inside', inline._inside)('href', inline._href)(); | ||
inline.reflink = replace(inline.reflink)('inside', inline._inside)(); | ||
/** | ||
* Normal Inline Grammar | ||
*/ | ||
inline.normal = merge({}, inline); | ||
/** | ||
* Pedantic Inline Grammar | ||
*/ | ||
inline.pedantic = merge({}, inline.normal, { | ||
strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, | ||
em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/ | ||
}); | ||
/** | ||
* GFM Inline Grammar | ||
*/ | ||
inline.gfm = merge({}, inline.normal, { | ||
escape: replace(inline.escape)('])', '~|])')(), | ||
url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, | ||
del: /^~~(?=\S)([\s\S]*?\S)~~/, | ||
text: replace(inline.text)(']|', '~]|')('|', '|https?://|')() | ||
}); | ||
/** | ||
* GFM + Line Breaks Inline Grammar | ||
*/ | ||
inline.breaks = merge({}, inline.gfm, { | ||
br: replace(inline.br)('{2,}', '*')(), | ||
text: replace(inline.gfm.text)('{2,}', '*')() | ||
}); | ||
/** | ||
* Inline Lexer & Compiler | ||
*/ | ||
function InlineLexer(links, options) { | ||
this.options = options || marked.defaults; | ||
this.links = links; | ||
this.rules = inline.normal; | ||
this.renderer = this.options.renderer || new Renderer(); | ||
this.renderer.options = this.options; | ||
if (!this.links) { | ||
throw new Error('Tokens array requires a `links` property.'); | ||
} | ||
if (this.options.gfm) { | ||
if (this.options.breaks) { | ||
this.rules = inline.breaks; | ||
} else { | ||
this.rules = inline.gfm; | ||
} | ||
} else if (this.options.pedantic) { | ||
this.rules = inline.pedantic; | ||
} | ||
} | ||
/** | ||
* Expose Inline Rules | ||
*/ | ||
InlineLexer.rules = inline; | ||
/** | ||
* Static Lexing/Compiling Method | ||
*/ | ||
InlineLexer.output = function (src, links, options) { | ||
var inline = new InlineLexer(links, options); | ||
return inline.output(src); | ||
}; | ||
/** | ||
* Lexing/Compiling | ||
*/ | ||
InlineLexer.prototype.output = function (src) { | ||
var out = '', | ||
link, | ||
text, | ||
href, | ||
cap; | ||
while (src) { | ||
// escape | ||
if (cap = this.rules.escape.exec(src)) { | ||
src = src.substring(cap[0].length); | ||
out += cap[1]; | ||
continue; | ||
} | ||
// autolink | ||
if (cap = this.rules.autolink.exec(src)) { | ||
src = src.substring(cap[0].length); | ||
if (cap[2] === '@') { | ||
text = cap[1].charAt(6) === ':' ? this.mangle(cap[1].substring(7)) : this.mangle(cap[1]); | ||
href = this.mangle('mailto:') + text; | ||
} else { | ||
text = escape(cap[1]); | ||
href = text; | ||
} | ||
out += this.renderer.link(href, null, text); | ||
continue; | ||
} | ||
// url (gfm) | ||
if (!this.inLink && (cap = this.rules.url.exec(src))) { | ||
src = src.substring(cap[0].length); | ||
text = escape(cap[1]); | ||
href = text; | ||
out += this.renderer.link(href, null, text); | ||
continue; | ||
} | ||
// tag | ||
if (cap = this.rules.tag.exec(src)) { | ||
if (!this.inLink && /^<a /i.test(cap[0])) { | ||
this.inLink = true; | ||
} else if (this.inLink && /^<\/a>/i.test(cap[0])) { | ||
this.inLink = false; | ||
} | ||
src = src.substring(cap[0].length); | ||
out += this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0]; | ||
continue; | ||
} | ||
// link | ||
if (cap = this.rules.link.exec(src)) { | ||
src = src.substring(cap[0].length); | ||
this.inLink = true; | ||
out += this.outputLink(cap, { | ||
href: cap[2], | ||
title: cap[3] | ||
}); | ||
this.inLink = false; | ||
continue; | ||
} | ||
// reflink, nolink | ||
if ((cap = this.rules.reflink.exec(src)) || (cap = this.rules.nolink.exec(src))) { | ||
src = src.substring(cap[0].length); | ||
link = (cap[2] || cap[1]).replace(/\s+/g, ' '); | ||
link = this.links[link.toLowerCase()]; | ||
if (!link || !link.href) { | ||
out += cap[0].charAt(0); | ||
src = cap[0].substring(1) + src; | ||
continue; | ||
} | ||
this.inLink = true; | ||
out += this.outputLink(cap, link); | ||
this.inLink = false; | ||
continue; | ||
} | ||
// strong | ||
if (cap = this.rules.strong.exec(src)) { | ||
src = src.substring(cap[0].length); | ||
out += this.renderer.strong(this.output(cap[2] || cap[1])); | ||
continue; | ||
} | ||
// em | ||
if (cap = this.rules.em.exec(src)) { | ||
src = src.substring(cap[0].length); | ||
out += this.renderer.em(this.output(cap[2] || cap[1])); | ||
continue; | ||
} | ||
// code | ||
if (cap = this.rules.code.exec(src)) { | ||
src = src.substring(cap[0].length); | ||
out += this.renderer.codespan(escape(cap[2], true)); | ||
continue; | ||
} | ||
// br | ||
if (cap = this.rules.br.exec(src)) { | ||
src = src.substring(cap[0].length); | ||
out += this.renderer.br(); | ||
continue; | ||
} | ||
// del (gfm) | ||
if (cap = this.rules.del.exec(src)) { | ||
src = src.substring(cap[0].length); | ||
out += this.renderer.del(this.output(cap[1])); | ||
continue; | ||
} | ||
// text | ||
if (cap = this.rules.text.exec(src)) { | ||
src = src.substring(cap[0].length); | ||
out += this.renderer.text(escape(this.smartypants(cap[0]))); | ||
continue; | ||
} | ||
if (src) { | ||
throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); | ||
} | ||
} | ||
return out; | ||
}; | ||
/** | ||
* Compile Link | ||
*/ | ||
InlineLexer.prototype.outputLink = function (cap, link) { | ||
var href = escape(link.href), | ||
title = link.title ? escape(link.title) : null; | ||
return cap[0].charAt(0) !== '!' ? this.renderer.link(href, title, this.output(cap[1])) : this.renderer.image(href, title, escape(cap[1])); | ||
}; | ||
/** | ||
* Smartypants Transformations | ||
*/ | ||
InlineLexer.prototype.smartypants = function (text) { | ||
if (!this.options.smartypants) return text; | ||
return text | ||
// em-dashes | ||
.replace(/---/g, '\u2014') | ||
// en-dashes | ||
.replace(/--/g, '\u2013') | ||
// opening singles | ||
.replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') | ||
// closing singles & apostrophes | ||
.replace(/'/g, '\u2019') | ||
// opening doubles | ||
.replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') | ||
// closing doubles | ||
.replace(/"/g, '\u201d') | ||
// ellipses | ||
.replace(/\.{3}/g, '\u2026'); | ||
}; | ||
/** | ||
* Mangle Links | ||
*/ | ||
InlineLexer.prototype.mangle = function (text) { | ||
if (!this.options.mangle) return text; | ||
var out = '', | ||
l = text.length, | ||
i = 0, | ||
ch; | ||
for (; i < l; i++) { | ||
ch = text.charCodeAt(i); | ||
if (Math.random() > 0.5) { | ||
ch = 'x' + ch.toString(16); | ||
} | ||
out += '&#' + ch + ';'; | ||
} | ||
return out; | ||
}; | ||
/** | ||
* Renderer | ||
*/ | ||
function Renderer(options) { | ||
this.options = options || {}; | ||
} | ||
Renderer.prototype.code = function (code, lang, escaped) { | ||
if (this.options.highlight) { | ||
var out = this.options.highlight(code, lang); | ||
if (out != null && out !== code) { | ||
escaped = true; | ||
code = out; | ||
} | ||
} | ||
if (!lang) { | ||
return '<pre><code>' + (escaped ? code : escape(code, true)) + '\n</code></pre>'; | ||
} | ||
return '<pre><code class="' + this.options.langPrefix + escape(lang, true) + '">' + (escaped ? code : escape(code, true)) + '\n</code></pre>\n'; | ||
}; | ||
Renderer.prototype.blockquote = function (quote) { | ||
return '<blockquote>\n' + quote + '</blockquote>\n'; | ||
}; | ||
Renderer.prototype.html = function (html) { | ||
return html; | ||
}; | ||
Renderer.prototype.heading = function (text, level, raw) { | ||
return '<h' + level + ' id="' + this.options.headerPrefix + raw.toLowerCase().replace(/[^\w]+/g, '-') + '">' + text + '</h' + level + '>\n'; | ||
}; | ||
Renderer.prototype.hr = function () { | ||
return this.options.xhtml ? '<hr/>\n' : '<hr>\n'; | ||
}; | ||
Renderer.prototype.list = function (body, ordered) { | ||
var type = ordered ? 'ol' : 'ul'; | ||
return '<' + type + '>\n' + body + '</' + type + '>\n'; | ||
}; | ||
Renderer.prototype.listitem = function (text) { | ||
return '<li>' + text + '</li>\n'; | ||
}; | ||
Renderer.prototype.paragraph = function (text) { | ||
return '<p>' + text + '</p>\n'; | ||
}; | ||
Renderer.prototype.table = function (header, body) { | ||
return '<table>\n' + '<thead>\n' + header + '</thead>\n' + '<tbody>\n' + body + '</tbody>\n' + '</table>\n'; | ||
}; | ||
Renderer.prototype.tablerow = function (content) { | ||
return '<tr>\n' + content + '</tr>\n'; | ||
}; | ||
Renderer.prototype.tablecell = function (content, flags) { | ||
var type = flags.header ? 'th' : 'td'; | ||
var tag = flags.align ? '<' + type + ' style="text-align:' + flags.align + '">' : '<' + type + '>'; | ||
return tag + content + '</' + type + '>\n'; | ||
}; | ||
// span level renderer | ||
Renderer.prototype.strong = function (text) { | ||
return '<strong>' + text + '</strong>'; | ||
}; | ||
Renderer.prototype.em = function (text) { | ||
return '<em>' + text + '</em>'; | ||
}; | ||
Renderer.prototype.codespan = function (text) { | ||
return '<code>' + text + '</code>'; | ||
}; | ||
Renderer.prototype.br = function () { | ||
return this.options.xhtml ? '<br/>' : '<br>'; | ||
}; | ||
Renderer.prototype.del = function (text) { | ||
return '<del>' + text + '</del>'; | ||
}; | ||
Renderer.prototype.link = function (href, title, text) { | ||
if (this.options.sanitize) { | ||
try { | ||
var prot = decodeURIComponent(unescape(href)).replace(/[^\w:]/g, '').toLowerCase(); | ||
} catch (e) { | ||
return ''; | ||
} | ||
if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { | ||
return ''; | ||
} | ||
} | ||
var out = '<a href="' + href + '"'; | ||
if (title) { | ||
out += ' title="' + title + '"'; | ||
} | ||
out += '>' + text + '</a>'; | ||
return out; | ||
}; | ||
Renderer.prototype.image = function (href, title, text) { | ||
var out = '<img src="' + href + '" alt="' + text + '"'; | ||
if (title) { | ||
out += ' title="' + title + '"'; | ||
} | ||
out += this.options.xhtml ? '/>' : '>'; | ||
return out; | ||
}; | ||
Renderer.prototype.text = function (text) { | ||
return text; | ||
}; | ||
/** | ||
* Parsing & Compiling | ||
*/ | ||
function Parser(options) { | ||
this.tokens = []; | ||
this.token = null; | ||
this.options = options || marked.defaults; | ||
this.options.renderer = this.options.renderer || new Renderer(); | ||
this.renderer = this.options.renderer; | ||
this.renderer.options = this.options; | ||
} | ||
/** | ||
* Static Parse Method | ||
*/ | ||
Parser.parse = function (src, options, renderer) { | ||
var parser = new Parser(options, renderer); | ||
return parser.parse(src); | ||
}; | ||
/** | ||
* Parse Loop | ||
*/ | ||
Parser.prototype.parse = function (src) { | ||
this.inline = new InlineLexer(src.links, this.options, this.renderer); | ||
this.tokens = src.reverse(); | ||
var out = ''; | ||
while (this.next()) { | ||
out += this.tok(); | ||
} | ||
return out; | ||
}; | ||
/** | ||
* Next Token | ||
*/ | ||
Parser.prototype.next = function () { | ||
return this.token = this.tokens.pop(); | ||
}; | ||
/** | ||
* Preview Next Token | ||
*/ | ||
Parser.prototype.peek = function () { | ||
return this.tokens[this.tokens.length - 1] || 0; | ||
}; | ||
/** | ||
* Parse Text Tokens | ||
*/ | ||
Parser.prototype.parseText = function () { | ||
var body = this.token.text; | ||
while (this.peek().type === 'text') { | ||
body += '\n' + this.next().text; | ||
} | ||
return this.inline.output(body); | ||
}; | ||
/** | ||
* Parse Current Token | ||
*/ | ||
Parser.prototype.tok = function () { | ||
switch (this.token.type) { | ||
case 'space': | ||
{ | ||
return ''; | ||
} | ||
case 'hr': | ||
{ | ||
return this.renderer.hr(); | ||
} | ||
case 'heading': | ||
{ | ||
return this.renderer.heading(this.inline.output(this.token.text), this.token.depth, this.token.text); | ||
} | ||
case 'code': | ||
{ | ||
return this.renderer.code(this.token.text, this.token.lang, this.token.escaped); | ||
} | ||
case 'table': | ||
{ | ||
var header = '', | ||
body = '', | ||
i, | ||
row, | ||
cell, | ||
flags, | ||
j; | ||
// header | ||
cell = ''; | ||
for (i = 0; i < this.token.header.length; i++) { | ||
flags = { header: true, align: this.token.align[i] }; | ||
cell += this.renderer.tablecell(this.inline.output(this.token.header[i]), { header: true, align: this.token.align[i] }); | ||
} | ||
header += this.renderer.tablerow(cell); | ||
for (i = 0; i < this.token.cells.length; i++) { | ||
row = this.token.cells[i]; | ||
cell = ''; | ||
for (j = 0; j < row.length; j++) { | ||
cell += this.renderer.tablecell(this.inline.output(row[j]), { header: false, align: this.token.align[j] }); | ||
} | ||
body += this.renderer.tablerow(cell); | ||
} | ||
return this.renderer.table(header, body); | ||
} | ||
case 'blockquote_start': | ||
{ | ||
var body = ''; | ||
while (this.next().type !== 'blockquote_end') { | ||
body += this.tok(); | ||
} | ||
return this.renderer.blockquote(body); | ||
} | ||
case 'list_start': | ||
{ | ||
var body = '', | ||
ordered = this.token.ordered; | ||
while (this.next().type !== 'list_end') { | ||
body += this.tok(); | ||
} | ||
return this.renderer.list(body, ordered); | ||
} | ||
case 'list_item_start': | ||
{ | ||
var body = ''; | ||
while (this.next().type !== 'list_item_end') { | ||
body += this.token.type === 'text' ? this.parseText() : this.tok(); | ||
} | ||
return this.renderer.listitem(body); | ||
} | ||
case 'loose_item_start': | ||
{ | ||
var body = ''; | ||
while (this.next().type !== 'list_item_end') { | ||
body += this.tok(); | ||
} | ||
return this.renderer.listitem(body); | ||
} | ||
case 'html': | ||
{ | ||
var html = !this.token.pre && !this.options.pedantic ? this.inline.output(this.token.text) : this.token.text; | ||
return this.renderer.html(html); | ||
} | ||
case 'paragraph': | ||
{ | ||
return this.renderer.paragraph(this.inline.output(this.token.text)); | ||
} | ||
case 'text': | ||
{ | ||
return this.renderer.paragraph(this.parseText()); | ||
} | ||
} | ||
}; | ||
/** | ||
* Helpers | ||
*/ | ||
function escape(html, encode) { | ||
return html.replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, '''); | ||
} | ||
function unescape(html) { | ||
// explicitly match decimal, hex, and named HTML entities | ||
return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, function (_, n) { | ||
n = n.toLowerCase(); | ||
if (n === 'colon') return ':'; | ||
if (n.charAt(0) === '#') { | ||
return n.charAt(1) === 'x' ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1)); | ||
} | ||
return ''; | ||
}); | ||
} | ||
function replace(regex, opt) { | ||
regex = regex.source; | ||
opt = opt || ''; | ||
return function self(name, val) { | ||
if (!name) return new RegExp(regex, opt); | ||
val = val.source || val; | ||
val = val.replace(/(^|[^\[])\^/g, '$1'); | ||
regex = regex.replace(name, val); | ||
return self; | ||
}; | ||
} | ||
function noop() {} | ||
noop.exec = noop; | ||
function merge(obj) { | ||
var i = 1, | ||
target, | ||
key; | ||
for (; i < arguments.length; i++) { | ||
target = arguments[i]; | ||
for (key in target) { | ||
if (Object.prototype.hasOwnProperty.call(target, key)) { | ||
obj[key] = target[key]; | ||
} | ||
} | ||
} | ||
return obj; | ||
} | ||
/** | ||
* Marked | ||
*/ | ||
function marked(src, opt, callback) { | ||
if (callback || typeof opt === 'function') { | ||
if (!callback) { | ||
callback = opt; | ||
opt = null; | ||
} | ||
opt = merge({}, marked.defaults, opt || {}); | ||
var highlight = opt.highlight, | ||
tokens, | ||
pending, | ||
i = 0; | ||
try { | ||
tokens = Lexer.lex(src, opt); | ||
} catch (e) { | ||
return callback(e); | ||
} | ||
pending = tokens.length; | ||
var done = function (err) { | ||
if (err) { | ||
opt.highlight = highlight; | ||
return callback(err); | ||
} | ||
var out; | ||
try { | ||
out = Parser.parse(tokens, opt); | ||
} catch (e) { | ||
err = e; | ||
} | ||
opt.highlight = highlight; | ||
return err ? callback(err) : callback(null, out); | ||
}; | ||
if (!highlight || highlight.length < 3) { | ||
return done(); | ||
} | ||
delete opt.highlight; | ||
if (!pending) return done(); | ||
for (; i < tokens.length; i++) { | ||
(function (token) { | ||
if (token.type !== 'code') { | ||
return --pending || done(); | ||
} | ||
return highlight(token.text, token.lang, function (err, code) { | ||
if (err) return done(err); | ||
if (code == null || code === token.text) { | ||
return --pending || done(); | ||
} | ||
token.text = code; | ||
token.escaped = true; | ||
--pending || done(); | ||
}); | ||
})(tokens[i]); | ||
} | ||
return; | ||
} | ||
try { | ||
if (opt) opt = merge({}, marked.defaults, opt); | ||
return Parser.parse(Lexer.lex(src, opt), opt); | ||
} catch (e) { | ||
e.message += '\nPlease report this to https://github.com/chjj/marked.'; | ||
if ((opt || marked.defaults).silent) { | ||
return '<p>An error occurred:</p><pre>' + escape(e.message + '', true) + '</pre>'; | ||
} | ||
throw e; | ||
} | ||
} | ||
/** | ||
* Options | ||
*/ | ||
marked.options = marked.setOptions = function (opt) { | ||
merge(marked.defaults, opt); | ||
return marked; | ||
}; | ||
marked.defaults = { | ||
gfm: true, | ||
tables: true, | ||
breaks: false, | ||
pedantic: false, | ||
sanitize: false, | ||
sanitizer: null, | ||
mangle: true, | ||
smartLists: false, | ||
silent: false, | ||
highlight: null, | ||
langPrefix: 'lang-', | ||
smartypants: false, | ||
headerPrefix: '', | ||
renderer: new Renderer(), | ||
xhtml: false | ||
}; | ||
/** | ||
* Expose | ||
*/ | ||
marked.Parser = Parser; | ||
marked.parser = Parser.parse; | ||
marked.Renderer = Renderer; | ||
marked.Lexer = Lexer; | ||
marked.lexer = Lexer.lex; | ||
marked.InlineLexer = InlineLexer; | ||
marked.inlineLexer = InlineLexer.output; | ||
marked.parse = marked; | ||
// TODO MonacoChange: we have our own way of defining modules | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () { | ||
return marked; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
//if (typeof module !== 'undefined' && typeof exports === 'object') { | ||
// module.exports = marked; | ||
//} else if (typeof define === 'function' && define.amd) { | ||
// define(function() { return marked; }); | ||
//} else { | ||
// this.marked = marked; | ||
//} | ||
// | ||
//}).call(function() { | ||
// return this || (typeof window !== 'undefined' ? window : global); | ||
//}()); | ||
// END MonacoChange | ||
/***/ }), | ||
/***/ 40: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(31)], __WEBPACK_AMD_DEFINE_RESULT__ = function (marked) { | ||
return { | ||
marked: marked | ||
}; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
/***/ }), | ||
/***/ 67: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(13), __webpack_require__(40)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, arrays_1, marked_1) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MarkdownString = /** @class */function () { | ||
function MarkdownString(value) { | ||
if (value === void 0) { | ||
value = ''; | ||
} | ||
this.value = value; | ||
} | ||
MarkdownString.prototype.appendText = function (value) { | ||
// escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash | ||
this.value += value.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); | ||
return this; | ||
}; | ||
MarkdownString.prototype.appendMarkdown = function (value) { | ||
this.value += value; | ||
return this; | ||
}; | ||
MarkdownString.prototype.appendCodeblock = function (langId, code) { | ||
this.value += '\n```'; | ||
this.value += langId; | ||
this.value += '\n'; | ||
this.value += code; | ||
this.value += '\n```\n'; | ||
return this; | ||
}; | ||
return MarkdownString; | ||
}(); | ||
exports.MarkdownString = MarkdownString; | ||
function isEmptyMarkdownString(oneOrMany) { | ||
if (isMarkdownString(oneOrMany)) { | ||
return !oneOrMany.value; | ||
} else if (Array.isArray(oneOrMany)) { | ||
return oneOrMany.every(isEmptyMarkdownString); | ||
} else { | ||
return true; | ||
} | ||
if (!a || !b) { | ||
return false; | ||
} | ||
exports.isEmptyMarkdownString = isEmptyMarkdownString; | ||
function isMarkdownString(thing) { | ||
if (thing instanceof MarkdownString) { | ||
return true; | ||
} else if (typeof thing === 'object') { | ||
return typeof thing.value === 'string' && (typeof thing.isTrusted === 'boolean' || thing.isTrusted === void 0); | ||
} | ||
return a.language === b.language && a.value === b.value; | ||
return false; | ||
} | ||
function htmlContentElementEqual(a, b) { | ||
return a.formattedText === b.formattedText && a.text === b.text && a.className === b.className && a.style === b.style && a.customStyle === b.customStyle && a.tagName === b.tagName && a.isText === b.isText && a.role === b.role && a.markdown === b.markdown && htmlContentElementCodeEqual(a.code, b.code) && htmlContentElementArrEquals(a.children, b.children); | ||
} | ||
function htmlContentElementArrEquals(a, b) { | ||
exports.isMarkdownString = isMarkdownString; | ||
function markedStringsEquals(a, b) { | ||
if (!a && !b) { | ||
return true; | ||
} | ||
if (!a || !b) { | ||
} else if (!a || !b) { | ||
return false; | ||
} else if (Array.isArray(a) && Array.isArray(b)) { | ||
return arrays_1.equals(a, b, markdownStringEqual); | ||
} else if (isMarkdownString(a) && isMarkdownString(b)) { | ||
return markdownStringEqual(a, b); | ||
} else { | ||
return false; | ||
} | ||
var aLen = a.length, | ||
bLen = b.length; | ||
if (aLen !== bLen) { | ||
} | ||
exports.markedStringsEquals = markedStringsEquals; | ||
function markdownStringEqual(a, b) { | ||
if (a === b) { | ||
return true; | ||
} else if (!a || !b) { | ||
return false; | ||
} else { | ||
return a.value === b.value && a.isTrusted === b.isTrusted; | ||
} | ||
for (var i = 0; i < aLen; i++) { | ||
if (!htmlContentElementEqual(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
function removeMarkdownEscapes(text) { | ||
if (!text) { | ||
return text; | ||
} | ||
return true; | ||
return text.replace(/\\([\\`*_{}[\]()#+\-.!])/g, '$1'); | ||
} | ||
exports.htmlContentElementArrEquals = htmlContentElementArrEquals; | ||
exports.removeMarkdownEscapes = removeMarkdownEscapes; | ||
function containsCommandLink(value) { | ||
var uses = false; | ||
var renderer = new marked_1.marked.Renderer(); | ||
renderer.link = function (href, title, text) { | ||
if (href.match(/^command:/i)) { | ||
uses = true; | ||
} | ||
return 'link'; | ||
}; | ||
marked_1.marked(value, { renderer: renderer }); | ||
return uses; | ||
} | ||
exports.containsCommandLink = containsCommandLink; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
@@ -173,0 +1749,0 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 82); | ||
/******/ return __webpack_require__(__webpack_require__.s = 68); | ||
/******/ }) | ||
@@ -74,9 +71,6 @@ /************************************************************************/ | ||
/***/ 82: | ||
/***/ 68: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -88,3 +82,4 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
var IdGenerator = function () { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var IdGenerator = /** @class */function () { | ||
function IdGenerator(prefix) { | ||
@@ -91,0 +86,0 @@ this._prefix = prefix; |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -76,21 +73,25 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
/*--------------------------------------------------------------------------------------------- | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
var __extends = undefined && undefined.__extends || function (d, b) { | ||
for (var p in b) { | ||
if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
}function __() { | ||
this.constructor = d; | ||
} | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = this && this.__extends || function () { | ||
var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { | ||
d.__proto__ = b; | ||
} || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { | ||
this.constructor = d; | ||
} | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
}(); | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
'use strict'; | ||
var ArrayIterator = function () { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ArrayIterator = /** @class */function () { | ||
function ArrayIterator(items, start, end) { | ||
@@ -125,3 +126,3 @@ if (start === void 0) { | ||
exports.ArrayIterator = ArrayIterator; | ||
var ArrayNavigator = function (_super) { | ||
var ArrayNavigator = /** @class */function (_super) { | ||
__extends(ArrayNavigator, _super); | ||
@@ -158,3 +159,3 @@ function ArrayNavigator(items, start, end) { | ||
exports.ArrayNavigator = ArrayNavigator; | ||
var MappedIterator = function () { | ||
var MappedIterator = /** @class */function () { | ||
function MappedIterator(iterator, fn) { | ||
@@ -171,3 +172,3 @@ this.iterator = iterator; | ||
exports.MappedIterator = MappedIterator; | ||
var MappedNavigator = function (_super) { | ||
var MappedNavigator = /** @class */function (_super) { | ||
__extends(MappedNavigator, _super); | ||
@@ -174,0 +175,0 @@ function MappedNavigator(navigator, fn) { |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 21); | ||
/******/ return __webpack_require__(__webpack_require__.s = 23); | ||
/******/ }) | ||
@@ -74,11 +71,6 @@ /************************************************************************/ | ||
/***/ 21: | ||
/***/ 23: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, !(function webpackMissingModule() { var e = new Error("Cannot find module \"vs/nls!vs/base/common/json\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, nls_1) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -90,2 +82,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ScanError; | ||
@@ -99,2 +92,3 @@ (function (ScanError) { | ||
ScanError[ScanError["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter"; | ||
ScanError[ScanError["InvalidCharacter"] = 6] = "InvalidCharacter"; | ||
})(ScanError = exports.ScanError || (exports.ScanError = {})); | ||
@@ -266,6 +260,11 @@ var SyntaxKind; | ||
} | ||
if (isLineBreak(ch)) { | ||
result += text.substring(start, pos); | ||
scanError = ScanError.UnexpectedEndOfString; | ||
break; | ||
if (ch >= 0 && ch <= 0x1f) { | ||
if (isLineBreak(ch)) { | ||
result += text.substring(start, pos); | ||
scanError = ScanError.UnexpectedEndOfString; | ||
break; | ||
} else { | ||
scanError = ScanError.InvalidCharacter; | ||
// mark as error but continue with string | ||
} | ||
} | ||
@@ -443,19 +442,19 @@ pos++; | ||
setPosition: setPosition, | ||
getPosition: function getPosition() { | ||
getPosition: function () { | ||
return pos; | ||
}, | ||
scan: ignoreTrivia ? scanNextNonTrivia : scanNext, | ||
getToken: function getToken() { | ||
getToken: function () { | ||
return token; | ||
}, | ||
getTokenValue: function getTokenValue() { | ||
getTokenValue: function () { | ||
return value; | ||
}, | ||
getTokenOffset: function getTokenOffset() { | ||
getTokenOffset: function () { | ||
return tokenOffset; | ||
}, | ||
getTokenLength: function getTokenLength() { | ||
getTokenLength: function () { | ||
return pos - tokenOffset; | ||
}, | ||
getTokenError: function getTokenError() { | ||
getTokenError: function () { | ||
return scanError; | ||
@@ -646,29 +645,4 @@ } | ||
})(ParseErrorCode = exports.ParseErrorCode || (exports.ParseErrorCode = {})); | ||
function getParseErrorMessage(errorCode) { | ||
switch (errorCode) { | ||
case ParseErrorCode.InvalidSymbol: | ||
return nls_1.localize(0, null); | ||
case ParseErrorCode.InvalidNumberFormat: | ||
return nls_1.localize(1, null); | ||
case ParseErrorCode.PropertyNameExpected: | ||
return nls_1.localize(2, null); | ||
case ParseErrorCode.ValueExpected: | ||
return nls_1.localize(3, null); | ||
case ParseErrorCode.ColonExpected: | ||
return nls_1.localize(4, null); | ||
case ParseErrorCode.CommaExpected: | ||
return nls_1.localize(5, null); | ||
case ParseErrorCode.CloseBraceExpected: | ||
return nls_1.localize(6, null); | ||
case ParseErrorCode.CloseBracketExpected: | ||
return nls_1.localize(7, null); | ||
case ParseErrorCode.EndOfFileExpected: | ||
return nls_1.localize(8, null); | ||
default: | ||
return ''; | ||
} | ||
} | ||
exports.getParseErrorMessage = getParseErrorMessage; | ||
function getLiteralNodeType(value) { | ||
switch (typeof value === "undefined" ? "undefined" : _typeof(value)) { | ||
switch (typeof value) { | ||
case 'boolean': | ||
@@ -708,3 +682,3 @@ return 'boolean'; | ||
visit(text, { | ||
onObjectBegin: function onObjectBegin(offset, length) { | ||
onObjectBegin: function (offset, length) { | ||
if (position <= offset) { | ||
@@ -715,5 +689,5 @@ throw earlyReturnException; | ||
isAtPropertyKey = position > offset; | ||
segments.push(''); // push a placeholder (will be replaced or removed) | ||
segments.push(''); // push a placeholder (will be replaced) | ||
}, | ||
onObjectProperty: function onObjectProperty(name, offset, length) { | ||
onObjectProperty: function (name, offset, length) { | ||
if (position < offset) { | ||
@@ -728,3 +702,3 @@ throw earlyReturnException; | ||
}, | ||
onObjectEnd: function onObjectEnd(offset, length) { | ||
onObjectEnd: function (offset, length) { | ||
if (position <= offset) { | ||
@@ -736,3 +710,3 @@ throw earlyReturnException; | ||
}, | ||
onArrayBegin: function onArrayBegin(offset, length) { | ||
onArrayBegin: function (offset, length) { | ||
if (position <= offset) { | ||
@@ -744,3 +718,3 @@ throw earlyReturnException; | ||
}, | ||
onArrayEnd: function onArrayEnd(offset, length) { | ||
onArrayEnd: function (offset, length) { | ||
if (position <= offset) { | ||
@@ -752,3 +726,3 @@ throw earlyReturnException; | ||
}, | ||
onLiteralValue: function onLiteralValue(value, offset, length) { | ||
onLiteralValue: function (value, offset, length) { | ||
if (position < offset) { | ||
@@ -762,3 +736,3 @@ throw earlyReturnException; | ||
}, | ||
onSeparator: function onSeparator(sep, offset, length) { | ||
onSeparator: function (sep, offset, length) { | ||
if (position <= offset) { | ||
@@ -788,5 +762,2 @@ throw earlyReturnException; | ||
} | ||
if (segments[segments.length - 1] === '') { | ||
segments.pop(); | ||
} | ||
return { | ||
@@ -796,3 +767,3 @@ path: segments, | ||
isAtPropertyKey: isAtPropertyKey, | ||
matches: function matches(pattern) { | ||
matches: function (pattern) { | ||
var k = 0; | ||
@@ -830,3 +801,3 @@ for (var i = 0; k < pattern.length && i < segments.length; i++) { | ||
var visitor = { | ||
onObjectBegin: function onObjectBegin() { | ||
onObjectBegin: function () { | ||
var object = {}; | ||
@@ -838,9 +809,9 @@ onValue(object); | ||
}, | ||
onObjectProperty: function onObjectProperty(name) { | ||
onObjectProperty: function (name) { | ||
currentProperty = name; | ||
}, | ||
onObjectEnd: function onObjectEnd() { | ||
onObjectEnd: function () { | ||
currentParent = previousParents.pop(); | ||
}, | ||
onArrayBegin: function onArrayBegin() { | ||
onArrayBegin: function () { | ||
var array = []; | ||
@@ -852,7 +823,7 @@ onValue(array); | ||
}, | ||
onArrayEnd: function onArrayEnd() { | ||
onArrayEnd: function () { | ||
currentParent = previousParents.pop(); | ||
}, | ||
onLiteralValue: onValue, | ||
onError: function onError(error) { | ||
onError: function (error) { | ||
errors.push({ error: error }); | ||
@@ -884,10 +855,10 @@ } | ||
var visitor = { | ||
onObjectBegin: function onObjectBegin(offset) { | ||
onObjectBegin: function (offset) { | ||
currentParent = onValue({ type: 'object', offset: offset, length: -1, parent: currentParent, children: [] }); | ||
}, | ||
onObjectProperty: function onObjectProperty(name, offset, length) { | ||
onObjectProperty: function (name, offset, length) { | ||
currentParent = onValue({ type: 'property', offset: offset, length: -1, parent: currentParent, children: [] }); | ||
currentParent.children.push({ type: 'string', value: name, offset: offset, length: length, parent: currentParent }); | ||
}, | ||
onObjectEnd: function onObjectEnd(offset, length) { | ||
onObjectEnd: function (offset, length) { | ||
currentParent.length = offset + length - currentParent.offset; | ||
@@ -897,6 +868,6 @@ currentParent = currentParent.parent; | ||
}, | ||
onArrayBegin: function onArrayBegin(offset, length) { | ||
onArrayBegin: function (offset, length) { | ||
currentParent = onValue({ type: 'array', offset: offset, length: -1, parent: currentParent, children: [] }); | ||
}, | ||
onArrayEnd: function onArrayEnd(offset, length) { | ||
onArrayEnd: function (offset, length) { | ||
currentParent.length = offset + length - currentParent.offset; | ||
@@ -906,7 +877,7 @@ currentParent = currentParent.parent; | ||
}, | ||
onLiteralValue: function onLiteralValue(value, offset, length) { | ||
onLiteralValue: function (value, offset, length) { | ||
onValue({ type: getLiteralNodeType(value), offset: offset, length: length, parent: currentParent, value: value }); | ||
ensurePropertyComplete(offset + length); | ||
}, | ||
onSeparator: function onSeparator(sep, offset, length) { | ||
onSeparator: function (sep, offset, length) { | ||
if (currentParent.type === 'property') { | ||
@@ -920,3 +891,3 @@ if (sep === ':') { | ||
}, | ||
onError: function onError(error) { | ||
onError: function (error) { | ||
errors.push({ error: error }); | ||
@@ -923,0 +894,0 @@ } |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 40); | ||
/******/ return __webpack_require__(__webpack_require__.s = 41); | ||
/******/ }) | ||
@@ -74,11 +71,6 @@ /************************************************************************/ | ||
/***/ 21: | ||
/***/ 23: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, !(function webpackMissingModule() { var e = new Error("Cannot find module \"vs/nls!vs/base/common/json\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, nls_1) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -90,2 +82,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ScanError; | ||
@@ -99,2 +92,3 @@ (function (ScanError) { | ||
ScanError[ScanError["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter"; | ||
ScanError[ScanError["InvalidCharacter"] = 6] = "InvalidCharacter"; | ||
})(ScanError = exports.ScanError || (exports.ScanError = {})); | ||
@@ -266,6 +260,11 @@ var SyntaxKind; | ||
} | ||
if (isLineBreak(ch)) { | ||
result += text.substring(start, pos); | ||
scanError = ScanError.UnexpectedEndOfString; | ||
break; | ||
if (ch >= 0 && ch <= 0x1f) { | ||
if (isLineBreak(ch)) { | ||
result += text.substring(start, pos); | ||
scanError = ScanError.UnexpectedEndOfString; | ||
break; | ||
} else { | ||
scanError = ScanError.InvalidCharacter; | ||
// mark as error but continue with string | ||
} | ||
} | ||
@@ -443,19 +442,19 @@ pos++; | ||
setPosition: setPosition, | ||
getPosition: function getPosition() { | ||
getPosition: function () { | ||
return pos; | ||
}, | ||
scan: ignoreTrivia ? scanNextNonTrivia : scanNext, | ||
getToken: function getToken() { | ||
getToken: function () { | ||
return token; | ||
}, | ||
getTokenValue: function getTokenValue() { | ||
getTokenValue: function () { | ||
return value; | ||
}, | ||
getTokenOffset: function getTokenOffset() { | ||
getTokenOffset: function () { | ||
return tokenOffset; | ||
}, | ||
getTokenLength: function getTokenLength() { | ||
getTokenLength: function () { | ||
return pos - tokenOffset; | ||
}, | ||
getTokenError: function getTokenError() { | ||
getTokenError: function () { | ||
return scanError; | ||
@@ -646,29 +645,4 @@ } | ||
})(ParseErrorCode = exports.ParseErrorCode || (exports.ParseErrorCode = {})); | ||
function getParseErrorMessage(errorCode) { | ||
switch (errorCode) { | ||
case ParseErrorCode.InvalidSymbol: | ||
return nls_1.localize(0, null); | ||
case ParseErrorCode.InvalidNumberFormat: | ||
return nls_1.localize(1, null); | ||
case ParseErrorCode.PropertyNameExpected: | ||
return nls_1.localize(2, null); | ||
case ParseErrorCode.ValueExpected: | ||
return nls_1.localize(3, null); | ||
case ParseErrorCode.ColonExpected: | ||
return nls_1.localize(4, null); | ||
case ParseErrorCode.CommaExpected: | ||
return nls_1.localize(5, null); | ||
case ParseErrorCode.CloseBraceExpected: | ||
return nls_1.localize(6, null); | ||
case ParseErrorCode.CloseBracketExpected: | ||
return nls_1.localize(7, null); | ||
case ParseErrorCode.EndOfFileExpected: | ||
return nls_1.localize(8, null); | ||
default: | ||
return ''; | ||
} | ||
} | ||
exports.getParseErrorMessage = getParseErrorMessage; | ||
function getLiteralNodeType(value) { | ||
switch (typeof value === "undefined" ? "undefined" : _typeof(value)) { | ||
switch (typeof value) { | ||
case 'boolean': | ||
@@ -708,3 +682,3 @@ return 'boolean'; | ||
visit(text, { | ||
onObjectBegin: function onObjectBegin(offset, length) { | ||
onObjectBegin: function (offset, length) { | ||
if (position <= offset) { | ||
@@ -715,5 +689,5 @@ throw earlyReturnException; | ||
isAtPropertyKey = position > offset; | ||
segments.push(''); // push a placeholder (will be replaced or removed) | ||
segments.push(''); // push a placeholder (will be replaced) | ||
}, | ||
onObjectProperty: function onObjectProperty(name, offset, length) { | ||
onObjectProperty: function (name, offset, length) { | ||
if (position < offset) { | ||
@@ -728,3 +702,3 @@ throw earlyReturnException; | ||
}, | ||
onObjectEnd: function onObjectEnd(offset, length) { | ||
onObjectEnd: function (offset, length) { | ||
if (position <= offset) { | ||
@@ -736,3 +710,3 @@ throw earlyReturnException; | ||
}, | ||
onArrayBegin: function onArrayBegin(offset, length) { | ||
onArrayBegin: function (offset, length) { | ||
if (position <= offset) { | ||
@@ -744,3 +718,3 @@ throw earlyReturnException; | ||
}, | ||
onArrayEnd: function onArrayEnd(offset, length) { | ||
onArrayEnd: function (offset, length) { | ||
if (position <= offset) { | ||
@@ -752,3 +726,3 @@ throw earlyReturnException; | ||
}, | ||
onLiteralValue: function onLiteralValue(value, offset, length) { | ||
onLiteralValue: function (value, offset, length) { | ||
if (position < offset) { | ||
@@ -762,3 +736,3 @@ throw earlyReturnException; | ||
}, | ||
onSeparator: function onSeparator(sep, offset, length) { | ||
onSeparator: function (sep, offset, length) { | ||
if (position <= offset) { | ||
@@ -788,5 +762,2 @@ throw earlyReturnException; | ||
} | ||
if (segments[segments.length - 1] === '') { | ||
segments.pop(); | ||
} | ||
return { | ||
@@ -796,3 +767,3 @@ path: segments, | ||
isAtPropertyKey: isAtPropertyKey, | ||
matches: function matches(pattern) { | ||
matches: function (pattern) { | ||
var k = 0; | ||
@@ -830,3 +801,3 @@ for (var i = 0; k < pattern.length && i < segments.length; i++) { | ||
var visitor = { | ||
onObjectBegin: function onObjectBegin() { | ||
onObjectBegin: function () { | ||
var object = {}; | ||
@@ -838,9 +809,9 @@ onValue(object); | ||
}, | ||
onObjectProperty: function onObjectProperty(name) { | ||
onObjectProperty: function (name) { | ||
currentProperty = name; | ||
}, | ||
onObjectEnd: function onObjectEnd() { | ||
onObjectEnd: function () { | ||
currentParent = previousParents.pop(); | ||
}, | ||
onArrayBegin: function onArrayBegin() { | ||
onArrayBegin: function () { | ||
var array = []; | ||
@@ -852,7 +823,7 @@ onValue(array); | ||
}, | ||
onArrayEnd: function onArrayEnd() { | ||
onArrayEnd: function () { | ||
currentParent = previousParents.pop(); | ||
}, | ||
onLiteralValue: onValue, | ||
onError: function onError(error) { | ||
onError: function (error) { | ||
errors.push({ error: error }); | ||
@@ -884,10 +855,10 @@ } | ||
var visitor = { | ||
onObjectBegin: function onObjectBegin(offset) { | ||
onObjectBegin: function (offset) { | ||
currentParent = onValue({ type: 'object', offset: offset, length: -1, parent: currentParent, children: [] }); | ||
}, | ||
onObjectProperty: function onObjectProperty(name, offset, length) { | ||
onObjectProperty: function (name, offset, length) { | ||
currentParent = onValue({ type: 'property', offset: offset, length: -1, parent: currentParent, children: [] }); | ||
currentParent.children.push({ type: 'string', value: name, offset: offset, length: length, parent: currentParent }); | ||
}, | ||
onObjectEnd: function onObjectEnd(offset, length) { | ||
onObjectEnd: function (offset, length) { | ||
currentParent.length = offset + length - currentParent.offset; | ||
@@ -897,6 +868,6 @@ currentParent = currentParent.parent; | ||
}, | ||
onArrayBegin: function onArrayBegin(offset, length) { | ||
onArrayBegin: function (offset, length) { | ||
currentParent = onValue({ type: 'array', offset: offset, length: -1, parent: currentParent, children: [] }); | ||
}, | ||
onArrayEnd: function onArrayEnd(offset, length) { | ||
onArrayEnd: function (offset, length) { | ||
currentParent.length = offset + length - currentParent.offset; | ||
@@ -906,7 +877,7 @@ currentParent = currentParent.parent; | ||
}, | ||
onLiteralValue: function onLiteralValue(value, offset, length) { | ||
onLiteralValue: function (value, offset, length) { | ||
onValue({ type: getLiteralNodeType(value), offset: offset, length: length, parent: currentParent, value: value }); | ||
ensurePropertyComplete(offset + length); | ||
}, | ||
onSeparator: function onSeparator(sep, offset, length) { | ||
onSeparator: function (sep, offset, length) { | ||
if (currentParent.type === 'property') { | ||
@@ -920,3 +891,3 @@ if (sep === ':') { | ||
}, | ||
onError: function onError(error) { | ||
onError: function (error) { | ||
errors.push({ error: error }); | ||
@@ -1198,9 +1169,6 @@ } | ||
/***/ 40: | ||
/***/ 41: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(21)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, Json) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(23)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, Json) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -1212,2 +1180,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function applyEdit(text, edit) { | ||
@@ -1214,0 +1183,0 @@ return text.substring(0, edit.offset) + edit.content + text.substring(edit.offset + edit.length); |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 86); | ||
/******/ return __webpack_require__(__webpack_require__.s = 71); | ||
/******/ }) | ||
@@ -74,9 +71,6 @@ /************************************************************************/ | ||
/***/ 86: | ||
/***/ 71: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -87,2 +81,4 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
@@ -89,0 +85,0 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 41); | ||
/******/ return __webpack_require__(__webpack_require__.s = 73); | ||
/******/ }) | ||
@@ -74,9 +71,6 @@ /************************************************************************/ | ||
/***/ 41: | ||
/***/ 73: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
/*--------------------------------------------------------------------------------------------- | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
@@ -87,2 +81,4 @@ * Licensed under the MIT License. See License.txt in the project root for license information. | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
@@ -93,3 +89,2 @@ * Virtual Key Codes, the value does not hold any inherent meaning. | ||
*/ | ||
var KeyCode; | ||
@@ -260,194 +255,179 @@ (function (KeyCode) { | ||
/** | ||
* Cover all key codes when IME is processing input. | ||
*/ | ||
KeyCode[KeyCode["KEY_IN_COMPOSITION"] = 109] = "KEY_IN_COMPOSITION"; | ||
KeyCode[KeyCode["ABNT_C1"] = 110] = "ABNT_C1"; | ||
KeyCode[KeyCode["ABNT_C2"] = 111] = "ABNT_C2"; | ||
/** | ||
* Placed last to cover the length of the enum. | ||
* Please do not depend on this value! | ||
*/ | ||
KeyCode[KeyCode["MAX_VALUE"] = 109] = "MAX_VALUE"; | ||
KeyCode[KeyCode["MAX_VALUE"] = 112] = "MAX_VALUE"; | ||
})(KeyCode = exports.KeyCode || (exports.KeyCode = {})); | ||
var Mapping = function () { | ||
function Mapping(fromKeyCode, toKeyCode) { | ||
this._fromKeyCode = fromKeyCode; | ||
this._toKeyCode = toKeyCode; | ||
var KeyCodeStrMap = /** @class */function () { | ||
function KeyCodeStrMap() { | ||
this._keyCodeToStr = []; | ||
this._strToKeyCode = Object.create(null); | ||
} | ||
Mapping.prototype.fromKeyCode = function (keyCode) { | ||
return this._fromKeyCode[keyCode]; | ||
KeyCodeStrMap.prototype.define = function (keyCode, str) { | ||
this._keyCodeToStr[keyCode] = str; | ||
this._strToKeyCode[str.toLowerCase()] = keyCode; | ||
}; | ||
Mapping.prototype.toKeyCode = function (str) { | ||
if (this._toKeyCode.hasOwnProperty(str)) { | ||
return this._toKeyCode[str]; | ||
} | ||
return 0 /* Unknown */; | ||
KeyCodeStrMap.prototype.keyCodeToStr = function (keyCode) { | ||
return this._keyCodeToStr[keyCode]; | ||
}; | ||
return Mapping; | ||
KeyCodeStrMap.prototype.strToKeyCode = function (str) { | ||
return this._strToKeyCode[str.toLowerCase()] || 0 /* Unknown */; | ||
}; | ||
return KeyCodeStrMap; | ||
}(); | ||
exports.Mapping = Mapping; | ||
function createMapping(fill1, fill2) { | ||
var MAP = []; | ||
fill1(MAP); | ||
var REVERSE_MAP = {}; | ||
for (var i = 0, len = MAP.length; i < len; i++) { | ||
if (!MAP[i]) { | ||
continue; | ||
var uiMap = new KeyCodeStrMap(); | ||
var userSettingsUSMap = new KeyCodeStrMap(); | ||
var userSettingsGeneralMap = new KeyCodeStrMap(); | ||
(function () { | ||
function define(keyCode, uiLabel, usUserSettingsLabel, generalUserSettingsLabel) { | ||
if (usUserSettingsLabel === void 0) { | ||
usUserSettingsLabel = uiLabel; | ||
} | ||
REVERSE_MAP[MAP[i]] = i; | ||
} | ||
fill2(REVERSE_MAP); | ||
var FINAL_REVERSE_MAP = {}; | ||
for (var entry in REVERSE_MAP) { | ||
if (REVERSE_MAP.hasOwnProperty(entry)) { | ||
FINAL_REVERSE_MAP[entry] = REVERSE_MAP[entry]; | ||
FINAL_REVERSE_MAP[entry.toLowerCase()] = REVERSE_MAP[entry]; | ||
if (generalUserSettingsLabel === void 0) { | ||
generalUserSettingsLabel = usUserSettingsLabel; | ||
} | ||
uiMap.define(keyCode, uiLabel); | ||
userSettingsUSMap.define(keyCode, usUserSettingsLabel); | ||
userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel); | ||
} | ||
return new Mapping(MAP, FINAL_REVERSE_MAP); | ||
} | ||
var STRING = createMapping(function (TO_STRING_MAP) { | ||
TO_STRING_MAP[0 /* Unknown */] = 'unknown'; | ||
TO_STRING_MAP[1 /* Backspace */] = 'Backspace'; | ||
TO_STRING_MAP[2 /* Tab */] = 'Tab'; | ||
TO_STRING_MAP[3 /* Enter */] = 'Enter'; | ||
TO_STRING_MAP[4 /* Shift */] = 'Shift'; | ||
TO_STRING_MAP[5 /* Ctrl */] = 'Ctrl'; | ||
TO_STRING_MAP[6 /* Alt */] = 'Alt'; | ||
TO_STRING_MAP[7 /* PauseBreak */] = 'PauseBreak'; | ||
TO_STRING_MAP[8 /* CapsLock */] = 'CapsLock'; | ||
TO_STRING_MAP[9 /* Escape */] = 'Escape'; | ||
TO_STRING_MAP[10 /* Space */] = 'Space'; | ||
TO_STRING_MAP[11 /* PageUp */] = 'PageUp'; | ||
TO_STRING_MAP[12 /* PageDown */] = 'PageDown'; | ||
TO_STRING_MAP[13 /* End */] = 'End'; | ||
TO_STRING_MAP[14 /* Home */] = 'Home'; | ||
TO_STRING_MAP[15 /* LeftArrow */] = 'LeftArrow'; | ||
TO_STRING_MAP[16 /* UpArrow */] = 'UpArrow'; | ||
TO_STRING_MAP[17 /* RightArrow */] = 'RightArrow'; | ||
TO_STRING_MAP[18 /* DownArrow */] = 'DownArrow'; | ||
TO_STRING_MAP[19 /* Insert */] = 'Insert'; | ||
TO_STRING_MAP[20 /* Delete */] = 'Delete'; | ||
TO_STRING_MAP[21 /* KEY_0 */] = '0'; | ||
TO_STRING_MAP[22 /* KEY_1 */] = '1'; | ||
TO_STRING_MAP[23 /* KEY_2 */] = '2'; | ||
TO_STRING_MAP[24 /* KEY_3 */] = '3'; | ||
TO_STRING_MAP[25 /* KEY_4 */] = '4'; | ||
TO_STRING_MAP[26 /* KEY_5 */] = '5'; | ||
TO_STRING_MAP[27 /* KEY_6 */] = '6'; | ||
TO_STRING_MAP[28 /* KEY_7 */] = '7'; | ||
TO_STRING_MAP[29 /* KEY_8 */] = '8'; | ||
TO_STRING_MAP[30 /* KEY_9 */] = '9'; | ||
TO_STRING_MAP[31 /* KEY_A */] = 'A'; | ||
TO_STRING_MAP[32 /* KEY_B */] = 'B'; | ||
TO_STRING_MAP[33 /* KEY_C */] = 'C'; | ||
TO_STRING_MAP[34 /* KEY_D */] = 'D'; | ||
TO_STRING_MAP[35 /* KEY_E */] = 'E'; | ||
TO_STRING_MAP[36 /* KEY_F */] = 'F'; | ||
TO_STRING_MAP[37 /* KEY_G */] = 'G'; | ||
TO_STRING_MAP[38 /* KEY_H */] = 'H'; | ||
TO_STRING_MAP[39 /* KEY_I */] = 'I'; | ||
TO_STRING_MAP[40 /* KEY_J */] = 'J'; | ||
TO_STRING_MAP[41 /* KEY_K */] = 'K'; | ||
TO_STRING_MAP[42 /* KEY_L */] = 'L'; | ||
TO_STRING_MAP[43 /* KEY_M */] = 'M'; | ||
TO_STRING_MAP[44 /* KEY_N */] = 'N'; | ||
TO_STRING_MAP[45 /* KEY_O */] = 'O'; | ||
TO_STRING_MAP[46 /* KEY_P */] = 'P'; | ||
TO_STRING_MAP[47 /* KEY_Q */] = 'Q'; | ||
TO_STRING_MAP[48 /* KEY_R */] = 'R'; | ||
TO_STRING_MAP[49 /* KEY_S */] = 'S'; | ||
TO_STRING_MAP[50 /* KEY_T */] = 'T'; | ||
TO_STRING_MAP[51 /* KEY_U */] = 'U'; | ||
TO_STRING_MAP[52 /* KEY_V */] = 'V'; | ||
TO_STRING_MAP[53 /* KEY_W */] = 'W'; | ||
TO_STRING_MAP[54 /* KEY_X */] = 'X'; | ||
TO_STRING_MAP[55 /* KEY_Y */] = 'Y'; | ||
TO_STRING_MAP[56 /* KEY_Z */] = 'Z'; | ||
TO_STRING_MAP[58 /* ContextMenu */] = 'ContextMenu'; | ||
TO_STRING_MAP[59 /* F1 */] = 'F1'; | ||
TO_STRING_MAP[60 /* F2 */] = 'F2'; | ||
TO_STRING_MAP[61 /* F3 */] = 'F3'; | ||
TO_STRING_MAP[62 /* F4 */] = 'F4'; | ||
TO_STRING_MAP[63 /* F5 */] = 'F5'; | ||
TO_STRING_MAP[64 /* F6 */] = 'F6'; | ||
TO_STRING_MAP[65 /* F7 */] = 'F7'; | ||
TO_STRING_MAP[66 /* F8 */] = 'F8'; | ||
TO_STRING_MAP[67 /* F9 */] = 'F9'; | ||
TO_STRING_MAP[68 /* F10 */] = 'F10'; | ||
TO_STRING_MAP[69 /* F11 */] = 'F11'; | ||
TO_STRING_MAP[70 /* F12 */] = 'F12'; | ||
TO_STRING_MAP[71 /* F13 */] = 'F13'; | ||
TO_STRING_MAP[72 /* F14 */] = 'F14'; | ||
TO_STRING_MAP[73 /* F15 */] = 'F15'; | ||
TO_STRING_MAP[74 /* F16 */] = 'F16'; | ||
TO_STRING_MAP[75 /* F17 */] = 'F17'; | ||
TO_STRING_MAP[76 /* F18 */] = 'F18'; | ||
TO_STRING_MAP[77 /* F19 */] = 'F19'; | ||
TO_STRING_MAP[78 /* NumLock */] = 'NumLock'; | ||
TO_STRING_MAP[79 /* ScrollLock */] = 'ScrollLock'; | ||
TO_STRING_MAP[80 /* US_SEMICOLON */] = ';'; | ||
TO_STRING_MAP[81 /* US_EQUAL */] = '='; | ||
TO_STRING_MAP[82 /* US_COMMA */] = ','; | ||
TO_STRING_MAP[83 /* US_MINUS */] = '-'; | ||
TO_STRING_MAP[84 /* US_DOT */] = '.'; | ||
TO_STRING_MAP[85 /* US_SLASH */] = '/'; | ||
TO_STRING_MAP[86 /* US_BACKTICK */] = '`'; | ||
TO_STRING_MAP[87 /* US_OPEN_SQUARE_BRACKET */] = '['; | ||
TO_STRING_MAP[88 /* US_BACKSLASH */] = '\\'; | ||
TO_STRING_MAP[89 /* US_CLOSE_SQUARE_BRACKET */] = ']'; | ||
TO_STRING_MAP[90 /* US_QUOTE */] = '\''; | ||
TO_STRING_MAP[91 /* OEM_8 */] = 'OEM_8'; | ||
TO_STRING_MAP[92 /* OEM_102 */] = 'OEM_102'; | ||
TO_STRING_MAP[93 /* NUMPAD_0 */] = 'NumPad0'; | ||
TO_STRING_MAP[94 /* NUMPAD_1 */] = 'NumPad1'; | ||
TO_STRING_MAP[95 /* NUMPAD_2 */] = 'NumPad2'; | ||
TO_STRING_MAP[96 /* NUMPAD_3 */] = 'NumPad3'; | ||
TO_STRING_MAP[97 /* NUMPAD_4 */] = 'NumPad4'; | ||
TO_STRING_MAP[98 /* NUMPAD_5 */] = 'NumPad5'; | ||
TO_STRING_MAP[99 /* NUMPAD_6 */] = 'NumPad6'; | ||
TO_STRING_MAP[100 /* NUMPAD_7 */] = 'NumPad7'; | ||
TO_STRING_MAP[101 /* NUMPAD_8 */] = 'NumPad8'; | ||
TO_STRING_MAP[102 /* NUMPAD_9 */] = 'NumPad9'; | ||
TO_STRING_MAP[103 /* NUMPAD_MULTIPLY */] = 'NumPad_Multiply'; | ||
TO_STRING_MAP[104 /* NUMPAD_ADD */] = 'NumPad_Add'; | ||
TO_STRING_MAP[105 /* NUMPAD_SEPARATOR */] = 'NumPad_Separator'; | ||
TO_STRING_MAP[106 /* NUMPAD_SUBTRACT */] = 'NumPad_Subtract'; | ||
TO_STRING_MAP[107 /* NUMPAD_DECIMAL */] = 'NumPad_Decimal'; | ||
TO_STRING_MAP[108 /* NUMPAD_DIVIDE */] = 'NumPad_Divide'; | ||
// for (let i = 0; i < KeyCode.MAX_VALUE; i++) { | ||
// if (!TO_STRING_MAP[i]) { | ||
// console.warn('Missing string representation for ' + KeyCode[i]); | ||
// } | ||
// } | ||
}, function (FROM_STRING_MAP) { | ||
FROM_STRING_MAP['\r'] = 3 /* Enter */; | ||
}); | ||
exports.USER_SETTINGS = createMapping(function (TO_USER_SETTINGS_MAP) { | ||
for (var i = 0, len = STRING._fromKeyCode.length; i < len; i++) { | ||
TO_USER_SETTINGS_MAP[i] = STRING._fromKeyCode[i]; | ||
} | ||
TO_USER_SETTINGS_MAP[15 /* LeftArrow */] = 'Left'; | ||
TO_USER_SETTINGS_MAP[16 /* UpArrow */] = 'Up'; | ||
TO_USER_SETTINGS_MAP[17 /* RightArrow */] = 'Right'; | ||
TO_USER_SETTINGS_MAP[18 /* DownArrow */] = 'Down'; | ||
}, function (FROM_USER_SETTINGS_MAP) { | ||
FROM_USER_SETTINGS_MAP['OEM_1'] = 80 /* US_SEMICOLON */; | ||
FROM_USER_SETTINGS_MAP['OEM_PLUS'] = 81 /* US_EQUAL */; | ||
FROM_USER_SETTINGS_MAP['OEM_COMMA'] = 82 /* US_COMMA */; | ||
FROM_USER_SETTINGS_MAP['OEM_MINUS'] = 83 /* US_MINUS */; | ||
FROM_USER_SETTINGS_MAP['OEM_PERIOD'] = 84 /* US_DOT */; | ||
FROM_USER_SETTINGS_MAP['OEM_2'] = 85 /* US_SLASH */; | ||
FROM_USER_SETTINGS_MAP['OEM_3'] = 86 /* US_BACKTICK */; | ||
FROM_USER_SETTINGS_MAP['OEM_4'] = 87 /* US_OPEN_SQUARE_BRACKET */; | ||
FROM_USER_SETTINGS_MAP['OEM_5'] = 88 /* US_BACKSLASH */; | ||
FROM_USER_SETTINGS_MAP['OEM_6'] = 89 /* US_CLOSE_SQUARE_BRACKET */; | ||
FROM_USER_SETTINGS_MAP['OEM_7'] = 90 /* US_QUOTE */; | ||
FROM_USER_SETTINGS_MAP['OEM_8'] = 91 /* OEM_8 */; | ||
FROM_USER_SETTINGS_MAP['OEM_102'] = 92 /* OEM_102 */; | ||
}); | ||
define(0 /* Unknown */, 'unknown'); | ||
define(1 /* Backspace */, 'Backspace'); | ||
define(2 /* Tab */, 'Tab'); | ||
define(3 /* Enter */, 'Enter'); | ||
define(4 /* Shift */, 'Shift'); | ||
define(5 /* Ctrl */, 'Ctrl'); | ||
define(6 /* Alt */, 'Alt'); | ||
define(7 /* PauseBreak */, 'PauseBreak'); | ||
define(8 /* CapsLock */, 'CapsLock'); | ||
define(9 /* Escape */, 'Escape'); | ||
define(10 /* Space */, 'Space'); | ||
define(11 /* PageUp */, 'PageUp'); | ||
define(12 /* PageDown */, 'PageDown'); | ||
define(13 /* End */, 'End'); | ||
define(14 /* Home */, 'Home'); | ||
define(15 /* LeftArrow */, 'LeftArrow', 'Left'); | ||
define(16 /* UpArrow */, 'UpArrow', 'Up'); | ||
define(17 /* RightArrow */, 'RightArrow', 'Right'); | ||
define(18 /* DownArrow */, 'DownArrow', 'Down'); | ||
define(19 /* Insert */, 'Insert'); | ||
define(20 /* Delete */, 'Delete'); | ||
define(21 /* KEY_0 */, '0'); | ||
define(22 /* KEY_1 */, '1'); | ||
define(23 /* KEY_2 */, '2'); | ||
define(24 /* KEY_3 */, '3'); | ||
define(25 /* KEY_4 */, '4'); | ||
define(26 /* KEY_5 */, '5'); | ||
define(27 /* KEY_6 */, '6'); | ||
define(28 /* KEY_7 */, '7'); | ||
define(29 /* KEY_8 */, '8'); | ||
define(30 /* KEY_9 */, '9'); | ||
define(31 /* KEY_A */, 'A'); | ||
define(32 /* KEY_B */, 'B'); | ||
define(33 /* KEY_C */, 'C'); | ||
define(34 /* KEY_D */, 'D'); | ||
define(35 /* KEY_E */, 'E'); | ||
define(36 /* KEY_F */, 'F'); | ||
define(37 /* KEY_G */, 'G'); | ||
define(38 /* KEY_H */, 'H'); | ||
define(39 /* KEY_I */, 'I'); | ||
define(40 /* KEY_J */, 'J'); | ||
define(41 /* KEY_K */, 'K'); | ||
define(42 /* KEY_L */, 'L'); | ||
define(43 /* KEY_M */, 'M'); | ||
define(44 /* KEY_N */, 'N'); | ||
define(45 /* KEY_O */, 'O'); | ||
define(46 /* KEY_P */, 'P'); | ||
define(47 /* KEY_Q */, 'Q'); | ||
define(48 /* KEY_R */, 'R'); | ||
define(49 /* KEY_S */, 'S'); | ||
define(50 /* KEY_T */, 'T'); | ||
define(51 /* KEY_U */, 'U'); | ||
define(52 /* KEY_V */, 'V'); | ||
define(53 /* KEY_W */, 'W'); | ||
define(54 /* KEY_X */, 'X'); | ||
define(55 /* KEY_Y */, 'Y'); | ||
define(56 /* KEY_Z */, 'Z'); | ||
define(57 /* Meta */, 'Meta'); | ||
define(58 /* ContextMenu */, 'ContextMenu'); | ||
define(59 /* F1 */, 'F1'); | ||
define(60 /* F2 */, 'F2'); | ||
define(61 /* F3 */, 'F3'); | ||
define(62 /* F4 */, 'F4'); | ||
define(63 /* F5 */, 'F5'); | ||
define(64 /* F6 */, 'F6'); | ||
define(65 /* F7 */, 'F7'); | ||
define(66 /* F8 */, 'F8'); | ||
define(67 /* F9 */, 'F9'); | ||
define(68 /* F10 */, 'F10'); | ||
define(69 /* F11 */, 'F11'); | ||
define(70 /* F12 */, 'F12'); | ||
define(71 /* F13 */, 'F13'); | ||
define(72 /* F14 */, 'F14'); | ||
define(73 /* F15 */, 'F15'); | ||
define(74 /* F16 */, 'F16'); | ||
define(75 /* F17 */, 'F17'); | ||
define(76 /* F18 */, 'F18'); | ||
define(77 /* F19 */, 'F19'); | ||
define(78 /* NumLock */, 'NumLock'); | ||
define(79 /* ScrollLock */, 'ScrollLock'); | ||
define(80 /* US_SEMICOLON */, ';', ';', 'OEM_1'); | ||
define(81 /* US_EQUAL */, '=', '=', 'OEM_PLUS'); | ||
define(82 /* US_COMMA */, ',', ',', 'OEM_COMMA'); | ||
define(83 /* US_MINUS */, '-', '-', 'OEM_MINUS'); | ||
define(84 /* US_DOT */, '.', '.', 'OEM_PERIOD'); | ||
define(85 /* US_SLASH */, '/', '/', 'OEM_2'); | ||
define(86 /* US_BACKTICK */, '`', '`', 'OEM_3'); | ||
define(110 /* ABNT_C1 */, 'ABNT_C1'); | ||
define(111 /* ABNT_C2 */, 'ABNT_C2'); | ||
define(87 /* US_OPEN_SQUARE_BRACKET */, '[', '[', 'OEM_4'); | ||
define(88 /* US_BACKSLASH */, '\\', '\\', 'OEM_5'); | ||
define(89 /* US_CLOSE_SQUARE_BRACKET */, ']', ']', 'OEM_6'); | ||
define(90 /* US_QUOTE */, '\'', '\'', 'OEM_7'); | ||
define(91 /* OEM_8 */, 'OEM_8'); | ||
define(92 /* OEM_102 */, 'OEM_102'); | ||
define(93 /* NUMPAD_0 */, 'NumPad0'); | ||
define(94 /* NUMPAD_1 */, 'NumPad1'); | ||
define(95 /* NUMPAD_2 */, 'NumPad2'); | ||
define(96 /* NUMPAD_3 */, 'NumPad3'); | ||
define(97 /* NUMPAD_4 */, 'NumPad4'); | ||
define(98 /* NUMPAD_5 */, 'NumPad5'); | ||
define(99 /* NUMPAD_6 */, 'NumPad6'); | ||
define(100 /* NUMPAD_7 */, 'NumPad7'); | ||
define(101 /* NUMPAD_8 */, 'NumPad8'); | ||
define(102 /* NUMPAD_9 */, 'NumPad9'); | ||
define(103 /* NUMPAD_MULTIPLY */, 'NumPad_Multiply'); | ||
define(104 /* NUMPAD_ADD */, 'NumPad_Add'); | ||
define(105 /* NUMPAD_SEPARATOR */, 'NumPad_Separator'); | ||
define(106 /* NUMPAD_SUBTRACT */, 'NumPad_Subtract'); | ||
define(107 /* NUMPAD_DECIMAL */, 'NumPad_Decimal'); | ||
define(108 /* NUMPAD_DIVIDE */, 'NumPad_Divide'); | ||
})(); | ||
var KeyCodeUtils; | ||
(function (KeyCodeUtils) { | ||
function toString(key) { | ||
return STRING.fromKeyCode(key); | ||
function toString(keyCode) { | ||
return uiMap.keyCodeToStr(keyCode); | ||
} | ||
KeyCodeUtils.toString = toString; | ||
function fromString(key) { | ||
return STRING.toKeyCode(key); | ||
return uiMap.strToKeyCode(key); | ||
} | ||
KeyCodeUtils.fromString = fromString; | ||
function toUserSettingsUS(keyCode) { | ||
return userSettingsUSMap.keyCodeToStr(keyCode); | ||
} | ||
KeyCodeUtils.toUserSettingsUS = toUserSettingsUS; | ||
function toUserSettingsGeneral(keyCode) { | ||
return userSettingsGeneralMap.keyCodeToStr(keyCode); | ||
} | ||
KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral; | ||
function fromUserSettings(key) { | ||
return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); | ||
} | ||
KeyCodeUtils.fromUserSettings = fromUserSettings; | ||
})(KeyCodeUtils = exports.KeyCodeUtils || (exports.KeyCodeUtils = {})); | ||
@@ -474,3 +454,2 @@ /** | ||
BinaryKeybindingsMask[BinaryKeybindingsMask["KeyCode"] = 255] = "KeyCode"; | ||
BinaryKeybindingsMask[BinaryKeybindingsMask["ModifierMask"] = 3840] = "ModifierMask"; | ||
})(BinaryKeybindingsMask || (BinaryKeybindingsMask = {})); | ||
@@ -489,69 +468,90 @@ var KeyMod; | ||
exports.KeyChord = KeyChord; | ||
var BinaryKeybindings = function () { | ||
function BinaryKeybindings() {} | ||
BinaryKeybindings.extractFirstPart = function (keybinding) { | ||
return (keybinding & 0x0000ffff) >>> 0; | ||
function createKeybinding(keybinding, OS) { | ||
if (keybinding === 0) { | ||
return null; | ||
} | ||
var firstPart = (keybinding & 0x0000ffff) >>> 0; | ||
var chordPart = (keybinding & 0xffff0000) >>> 16; | ||
if (chordPart !== 0) { | ||
return new ChordKeybinding(createSimpleKeybinding(firstPart, OS), createSimpleKeybinding(chordPart, OS)); | ||
} | ||
return createSimpleKeybinding(firstPart, OS); | ||
} | ||
exports.createKeybinding = createKeybinding; | ||
function createSimpleKeybinding(keybinding, OS) { | ||
var ctrlCmd = keybinding & 2048 /* CtrlCmd */ ? true : false; | ||
var winCtrl = keybinding & 256 /* WinCtrl */ ? true : false; | ||
var ctrlKey = OS === 2 /* Macintosh */ ? winCtrl : ctrlCmd; | ||
var shiftKey = keybinding & 1024 /* Shift */ ? true : false; | ||
var altKey = keybinding & 512 /* Alt */ ? true : false; | ||
var metaKey = OS === 2 /* Macintosh */ ? ctrlCmd : winCtrl; | ||
var keyCode = keybinding & 255 /* KeyCode */; | ||
return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode); | ||
} | ||
exports.createSimpleKeybinding = createSimpleKeybinding; | ||
var KeybindingType; | ||
(function (KeybindingType) { | ||
KeybindingType[KeybindingType["Simple"] = 1] = "Simple"; | ||
KeybindingType[KeybindingType["Chord"] = 2] = "Chord"; | ||
})(KeybindingType = exports.KeybindingType || (exports.KeybindingType = {})); | ||
var SimpleKeybinding = /** @class */function () { | ||
function SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode) { | ||
this.type = 1 /* Simple */; | ||
this.ctrlKey = ctrlKey; | ||
this.shiftKey = shiftKey; | ||
this.altKey = altKey; | ||
this.metaKey = metaKey; | ||
this.keyCode = keyCode; | ||
} | ||
SimpleKeybinding.prototype.equals = function (other) { | ||
if (other.type !== 1 /* Simple */) { | ||
return false; | ||
} | ||
return this.ctrlKey === other.ctrlKey && this.shiftKey === other.shiftKey && this.altKey === other.altKey && this.metaKey === other.metaKey && this.keyCode === other.keyCode; | ||
}; | ||
BinaryKeybindings.extractChordPart = function (keybinding) { | ||
return (keybinding & 0xffff0000) >>> 16; | ||
SimpleKeybinding.prototype.isModifierKey = function () { | ||
return this.keyCode === 0 /* Unknown */ | ||
|| this.keyCode === 5 /* Ctrl */ | ||
|| this.keyCode === 57 /* Meta */ | ||
|| this.keyCode === 6 /* Alt */ | ||
|| this.keyCode === 4 /* Shift */; | ||
}; | ||
BinaryKeybindings.hasChord = function (keybinding) { | ||
return this.extractChordPart(keybinding) !== 0; | ||
/** | ||
* Does this keybinding refer to the key code of a modifier and it also has the modifier flag? | ||
*/ | ||
SimpleKeybinding.prototype.isDuplicateModifierCase = function () { | ||
return this.ctrlKey && this.keyCode === 5 /* Ctrl */ || this.shiftKey && this.keyCode === 4 /* Shift */ || this.altKey && this.keyCode === 6 /* Alt */ || this.metaKey && this.keyCode === 57 /* Meta */; | ||
}; | ||
BinaryKeybindings.hasCtrlCmd = function (keybinding) { | ||
return keybinding & 2048 /* CtrlCmd */ ? true : false; | ||
}; | ||
BinaryKeybindings.hasShift = function (keybinding) { | ||
return keybinding & 1024 /* Shift */ ? true : false; | ||
}; | ||
BinaryKeybindings.hasAlt = function (keybinding) { | ||
return keybinding & 512 /* Alt */ ? true : false; | ||
}; | ||
BinaryKeybindings.hasWinCtrl = function (keybinding) { | ||
return keybinding & 256 /* WinCtrl */ ? true : false; | ||
}; | ||
BinaryKeybindings.isModifierKey = function (keybinding) { | ||
if ((keybinding & 3840 /* ModifierMask */) === keybinding) { | ||
return true; | ||
} | ||
var keyCode = this.extractKeyCode(keybinding); | ||
return keyCode === 5 /* Ctrl */ | ||
|| keyCode === 57 /* Meta */ | ||
|| keyCode === 6 /* Alt */ | ||
|| keyCode === 4 /* Shift */; | ||
}; | ||
BinaryKeybindings.extractKeyCode = function (keybinding) { | ||
return keybinding & 255 /* KeyCode */; | ||
}; | ||
return BinaryKeybindings; | ||
return SimpleKeybinding; | ||
}(); | ||
exports.BinaryKeybindings = BinaryKeybindings; | ||
var Keybinding = function () { | ||
function Keybinding(keybinding) { | ||
this.value = keybinding; | ||
exports.SimpleKeybinding = SimpleKeybinding; | ||
var ChordKeybinding = /** @class */function () { | ||
function ChordKeybinding(firstPart, chordPart) { | ||
this.type = 2 /* Chord */; | ||
this.firstPart = firstPart; | ||
this.chordPart = chordPart; | ||
} | ||
Keybinding.prototype.equals = function (other) { | ||
return this.value === other.value; | ||
}; | ||
Keybinding.prototype.hasCtrlCmd = function () { | ||
return BinaryKeybindings.hasCtrlCmd(this.value); | ||
}; | ||
Keybinding.prototype.hasShift = function () { | ||
return BinaryKeybindings.hasShift(this.value); | ||
}; | ||
Keybinding.prototype.hasAlt = function () { | ||
return BinaryKeybindings.hasAlt(this.value); | ||
}; | ||
Keybinding.prototype.hasWinCtrl = function () { | ||
return BinaryKeybindings.hasWinCtrl(this.value); | ||
}; | ||
Keybinding.prototype.isModifierKey = function () { | ||
return BinaryKeybindings.isModifierKey(this.value); | ||
}; | ||
Keybinding.prototype.getKeyCode = function () { | ||
return BinaryKeybindings.extractKeyCode(this.value); | ||
}; | ||
return Keybinding; | ||
return ChordKeybinding; | ||
}(); | ||
exports.Keybinding = Keybinding; | ||
exports.ChordKeybinding = ChordKeybinding; | ||
var ResolvedKeybindingPart = /** @class */function () { | ||
function ResolvedKeybindingPart(ctrlKey, shiftKey, altKey, metaKey, kbLabel, kbAriaLabel) { | ||
this.ctrlKey = ctrlKey; | ||
this.shiftKey = shiftKey; | ||
this.altKey = altKey; | ||
this.metaKey = metaKey; | ||
this.keyLabel = kbLabel; | ||
this.keyAriaLabel = kbAriaLabel; | ||
} | ||
return ResolvedKeybindingPart; | ||
}(); | ||
exports.ResolvedKeybindingPart = ResolvedKeybindingPart; | ||
/** | ||
* A resolved keybinding. Can be a simple keybinding or a chord keybinding. | ||
*/ | ||
var ResolvedKeybinding = /** @class */function () { | ||
function ResolvedKeybinding() {} | ||
return ResolvedKeybinding; | ||
}(); | ||
exports.ResolvedKeybinding = ResolvedKeybinding; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
@@ -558,0 +558,0 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); |
@@ -5,2 +5,3 @@ export declare const empty: IDisposable; | ||
} | ||
export declare function isDisposable<E extends object>(thing: E): thing is E & IDisposable; | ||
export declare function dispose<T extends IDisposable>(disposable: T): T; | ||
@@ -17,11 +18,2 @@ export declare function dispose<T extends IDisposable>(...disposables: T[]): T[]; | ||
} | ||
export declare class Disposables extends Disposable { | ||
add<T extends IDisposable>(e: T): T; | ||
add(...elements: IDisposable[]): void; | ||
} | ||
export declare class OneDisposable implements IDisposable { | ||
private _value; | ||
value: IDisposable; | ||
dispose(): void; | ||
} | ||
export interface IReference<T> extends IDisposable { | ||
@@ -28,0 +20,0 @@ readonly object: T; |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 6); | ||
/******/ return __webpack_require__(__webpack_require__.s = 9); | ||
/******/ }) | ||
@@ -74,27 +71,62 @@ /************************************************************************/ | ||
/***/ 6: | ||
/***/ 5: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
'use strict'; | ||
var __extends = undefined && undefined.__extends || function (d, b) { | ||
for (var p in b) { | ||
if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
}function __() { | ||
this.constructor = d; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function not(fn) { | ||
return function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return !fn.apply(void 0, args); | ||
}; | ||
} | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
exports.not = not; | ||
function once(fn) { | ||
var _this = this; | ||
var didCall = false; | ||
var result; | ||
return function () { | ||
if (didCall) { | ||
return result; | ||
} | ||
didCall = true; | ||
result = fn.apply(_this, arguments); | ||
return result; | ||
}; | ||
} | ||
exports.once = once; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
//# sourceMappingURL=functional.js.map | ||
/***/ }), | ||
/***/ 9: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(5)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, functional_1) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.empty = Object.freeze({ | ||
dispose: function dispose() {} | ||
dispose: function () {} | ||
}); | ||
function _dispose(first) { | ||
function isDisposable(thing) { | ||
return typeof thing.dispose === 'function' && thing.dispose.length === 0; | ||
} | ||
exports.isDisposable = isDisposable; | ||
function dispose(first) { | ||
var rest = []; | ||
@@ -116,11 +148,11 @@ for (var _i = 1; _i < arguments.length; _i++) { | ||
} else { | ||
_dispose(first); | ||
_dispose(rest); | ||
dispose(first); | ||
dispose(rest); | ||
return []; | ||
} | ||
} | ||
exports.dispose = _dispose; | ||
exports.dispose = dispose; | ||
function combinedDisposable(disposables) { | ||
return { dispose: function dispose() { | ||
return _dispose(disposables); | ||
return { dispose: function () { | ||
return dispose(disposables); | ||
} }; | ||
@@ -134,8 +166,13 @@ } | ||
} | ||
return combinedDisposable(fns.map(function (fn) { | ||
return { dispose: fn }; | ||
})); | ||
return { | ||
dispose: function () { | ||
for (var _i = 0, fns_1 = fns; _i < fns_1.length; _i++) { | ||
var fn = fns_1[_i]; | ||
fn(); | ||
} | ||
} | ||
}; | ||
} | ||
exports.toDisposable = toDisposable; | ||
var Disposable = function () { | ||
var Disposable = /** @class */function () { | ||
function Disposable() { | ||
@@ -145,3 +182,3 @@ this._toDispose = []; | ||
Disposable.prototype.dispose = function () { | ||
this._toDispose = _dispose(this._toDispose); | ||
this._toDispose = dispose(this._toDispose); | ||
}; | ||
@@ -155,40 +192,3 @@ Disposable.prototype._register = function (t) { | ||
exports.Disposable = Disposable; | ||
var Disposables = function (_super) { | ||
__extends(Disposables, _super); | ||
function Disposables() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
Disposables.prototype.add = function (arg) { | ||
if (!Array.isArray(arg)) { | ||
return this._register(arg); | ||
} else { | ||
for (var _i = 0, arg_1 = arg; _i < arg_1.length; _i++) { | ||
var element = arg_1[_i]; | ||
return this._register(element); | ||
} | ||
return undefined; | ||
} | ||
}; | ||
return Disposables; | ||
}(Disposable); | ||
exports.Disposables = Disposables; | ||
var OneDisposable = function () { | ||
function OneDisposable() {} | ||
Object.defineProperty(OneDisposable.prototype, "value", { | ||
set: function set(value) { | ||
if (this._value) { | ||
this._value.dispose(); | ||
} | ||
this._value = value; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
OneDisposable.prototype.dispose = function () { | ||
this.value = null; | ||
}; | ||
return OneDisposable; | ||
}(); | ||
exports.OneDisposable = OneDisposable; | ||
var ReferenceCollection = function () { | ||
var ReferenceCollection = /** @class */function () { | ||
function ReferenceCollection() { | ||
@@ -204,3 +204,3 @@ this.references = Object.create(null); | ||
var object = reference.object; | ||
var dispose = function dispose() { | ||
var dispose = functional_1.once(function () { | ||
if (--reference.counter === 0) { | ||
@@ -210,3 +210,3 @@ _this.destroyReferencedObject(reference.object); | ||
} | ||
}; | ||
}); | ||
reference.counter++; | ||
@@ -218,3 +218,3 @@ return { object: object, dispose: dispose }; | ||
exports.ReferenceCollection = ReferenceCollection; | ||
var ImmortalReference = function () { | ||
var ImmortalReference = /** @class */function () { | ||
function ImmortalReference(object) { | ||
@@ -221,0 +221,0 @@ this.object = object; |
@@ -0,1 +1,2 @@ | ||
import URI from './uri'; | ||
export interface Key { | ||
@@ -5,30 +6,13 @@ toString(): string; | ||
export interface Entry<K, T> { | ||
next?: Entry<K, T>; | ||
prev?: Entry<K, T>; | ||
key: K; | ||
value: T; | ||
} | ||
/** | ||
* A simple map to store value by a key object. Key can be any object that has toString() function to get | ||
* string value of the key. | ||
*/ | ||
export declare class LinkedMap<K extends Key, T> { | ||
protected map: { | ||
[key: string]: Entry<K, T>; | ||
}; | ||
protected _size: number; | ||
constructor(); | ||
readonly size: number; | ||
get(k: K): T; | ||
getOrSet(k: K, t: T): T; | ||
keys(): K[]; | ||
values(): T[]; | ||
entries(): Entry<K, T>[]; | ||
set(k: K, t: T): boolean; | ||
delete(k: K): T; | ||
has(k: K): boolean; | ||
clear(): void; | ||
protected push(key: K, value: T): void; | ||
protected pop(k: K): void; | ||
protected peek(k: K): T; | ||
export declare function values<K, V>(map: Map<K, V>): V[]; | ||
export declare function keys<K, V>(map: Map<K, V>): K[]; | ||
export declare function getOrSet<K, V>(map: Map<K, V>, key: K, value: V): V; | ||
export interface ISerializedBoundedLinkedMap<T> { | ||
entries: { | ||
key: string; | ||
value: T; | ||
}[]; | ||
} | ||
@@ -40,12 +24,11 @@ /** | ||
*/ | ||
export declare class BoundedLinkedMap<T> { | ||
export declare class BoundedMap<T> { | ||
private limit; | ||
protected map: { | ||
[key: string]: Entry<string, T>; | ||
}; | ||
private map; | ||
private head; | ||
private tail; | ||
private _size; | ||
private ratio; | ||
constructor(limit?: number, ratio?: number); | ||
constructor(limit?: number, ratio?: number, value?: ISerializedBoundedLinkedMap<T>); | ||
setLimit(limit: number): void; | ||
serialize(): ISerializedBoundedLinkedMap<T>; | ||
readonly size: number; | ||
@@ -58,16 +41,6 @@ set(key: string, value: T): boolean; | ||
clear(): void; | ||
protected push(entry: Entry<string, T>): void; | ||
private push(entry); | ||
private trim(); | ||
} | ||
/** | ||
* A subclass of Map<T> that makes an entry the MRU entry as soon | ||
* as it is being accessed. In combination with the limit for the | ||
* maximum number of elements in the cache, it helps to remove those | ||
* entries from the cache that are LRU. | ||
*/ | ||
export declare class LRUCache<T> extends BoundedLinkedMap<T> { | ||
constructor(limit: number); | ||
get(key: string): T; | ||
} | ||
/** | ||
* A trie map that allows for fast look up when keys are substrings | ||
@@ -78,5 +51,5 @@ * to the actual search keys (dir/subdir-problem). | ||
static PathSplitter: (s: string) => string[]; | ||
private _splitter; | ||
private readonly _splitter; | ||
private _root; | ||
constructor(splitter: (s: string) => string[]); | ||
constructor(splitter?: (s: string) => string[]); | ||
insert(path: string, element: E): void; | ||
@@ -87,1 +60,49 @@ lookUp(path: string): E; | ||
} | ||
export declare class ResourceMap<T> { | ||
private ignoreCase; | ||
protected map: Map<string, T>; | ||
constructor(ignoreCase?: boolean); | ||
set(resource: URI, value: T): void; | ||
get(resource: URI): T; | ||
has(resource: URI): boolean; | ||
readonly size: number; | ||
clear(): void; | ||
delete(resource: URI): boolean; | ||
forEach(clb: (value: T) => void): void; | ||
values(): T[]; | ||
private toKey(resource); | ||
} | ||
export declare class StrictResourceMap<T> extends ResourceMap<T> { | ||
constructor(); | ||
keys(): URI[]; | ||
} | ||
export declare namespace Touch { | ||
const None: 0; | ||
const First: 1; | ||
const Last: 2; | ||
} | ||
export declare type Touch = 0 | 1 | 2; | ||
export declare class LinkedMap<K, V> { | ||
private _map; | ||
private _head; | ||
private _tail; | ||
private _size; | ||
constructor(); | ||
clear(): void; | ||
isEmpty(): boolean; | ||
readonly size: number; | ||
has(key: K): boolean; | ||
get(key: K): V | undefined; | ||
set(key: K, value: V, touch?: Touch): void; | ||
delete(key: K): boolean; | ||
remove(key: K): V | undefined; | ||
shift(): V | undefined; | ||
forEach(callbackfn: (value: V, key: K, map: LinkedMap<K, V>) => void, thisArg?: any): void; | ||
forEachReverse(callbackfn: (value: V, key: K, map: LinkedMap<K, V>) => void, thisArg?: any): void; | ||
values(): V[]; | ||
keys(): K[]; | ||
private addItemFirst(item); | ||
private addItemLast(item); | ||
private removeItem(item); | ||
private touch(item, touch); | ||
} |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,40 +65,210 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 5); | ||
/******/ return __webpack_require__(__webpack_require__.s = 6); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ({ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
/***/ 5: | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// --- THIS FILE IS TEMPORARY UNTIL ENV.TS IS CLEANED UP. IT CAN SAFELY BE USED IN ALL TARGET EXECUTION ENVIRONMENTS (node & dom) --- | ||
var _isWindows = false; | ||
var _isMacintosh = false; | ||
var _isLinux = false; | ||
var _isRootUser = false; | ||
var _isNative = false; | ||
var _isWeb = false; | ||
var _locale = undefined; | ||
var _language = undefined; | ||
exports.LANGUAGE_DEFAULT = 'en'; | ||
// OS detection | ||
if (typeof process === 'object') { | ||
_isWindows = process.platform === 'win32'; | ||
_isMacintosh = process.platform === 'darwin'; | ||
_isLinux = process.platform === 'linux'; | ||
_isRootUser = !_isWindows && process.getuid() === 0; | ||
var rawNlsConfig = process.env['VSCODE_NLS_CONFIG']; | ||
if (rawNlsConfig) { | ||
try { | ||
var nlsConfig = JSON.parse(rawNlsConfig); | ||
var resolved = nlsConfig.availableLanguages['*']; | ||
_locale = nlsConfig.locale; | ||
// VSCode's default language is 'en' | ||
_language = resolved ? resolved : exports.LANGUAGE_DEFAULT; | ||
} catch (e) {} | ||
} | ||
_isNative = true; | ||
} else if (typeof navigator === 'object') { | ||
var userAgent = navigator.userAgent; | ||
_isWindows = userAgent.indexOf('Windows') >= 0; | ||
_isMacintosh = userAgent.indexOf('Macintosh') >= 0; | ||
_isLinux = userAgent.indexOf('Linux') >= 0; | ||
_isWeb = true; | ||
_locale = navigator.language; | ||
_language = _locale; | ||
} | ||
var Platform; | ||
(function (Platform) { | ||
Platform[Platform["Web"] = 0] = "Web"; | ||
Platform[Platform["Mac"] = 1] = "Mac"; | ||
Platform[Platform["Linux"] = 2] = "Linux"; | ||
Platform[Platform["Windows"] = 3] = "Windows"; | ||
})(Platform = exports.Platform || (exports.Platform = {})); | ||
var _platform = Platform.Web; | ||
if (_isNative) { | ||
if (_isMacintosh) { | ||
_platform = Platform.Mac; | ||
} else if (_isWindows) { | ||
_platform = Platform.Windows; | ||
} else if (_isLinux) { | ||
_platform = Platform.Linux; | ||
} | ||
} | ||
exports.isWindows = _isWindows; | ||
exports.isMacintosh = _isMacintosh; | ||
exports.isLinux = _isLinux; | ||
exports.isRootUser = _isRootUser; | ||
exports.isNative = _isNative; | ||
exports.isWeb = _isWeb; | ||
exports.platform = _platform; | ||
/** | ||
* The language used for the user interface. The format of | ||
* the string is all lower case (e.g. zh-tw for Traditional | ||
* Chinese) | ||
*/ | ||
exports.language = _language; | ||
/** | ||
* The OS locale or the locale specified by --locale. The format of | ||
* the string is all lower case (e.g. zh-tw for Traditional | ||
* Chinese). The UI is not necessarily shown in the provided locale. | ||
*/ | ||
exports.locale = _locale; | ||
var _globals = typeof self === 'object' ? self : global; | ||
exports.globals = _globals; | ||
function hasWebWorkerSupport() { | ||
return typeof _globals.Worker !== 'undefined'; | ||
} | ||
exports.hasWebWorkerSupport = hasWebWorkerSupport; | ||
exports.setTimeout = _globals.setTimeout.bind(_globals); | ||
exports.clearTimeout = _globals.clearTimeout.bind(_globals); | ||
exports.setInterval = _globals.setInterval.bind(_globals); | ||
exports.clearInterval = _globals.clearInterval.bind(_globals); | ||
var OperatingSystem; | ||
(function (OperatingSystem) { | ||
OperatingSystem[OperatingSystem["Windows"] = 1] = "Windows"; | ||
OperatingSystem[OperatingSystem["Macintosh"] = 2] = "Macintosh"; | ||
OperatingSystem[OperatingSystem["Linux"] = 3] = "Linux"; | ||
})(OperatingSystem = exports.OperatingSystem || (exports.OperatingSystem = {})); | ||
exports.OS = _isMacintosh ? 2 /* Macintosh */ : _isWindows ? 1 /* Windows */ : 3 /* Linux */; | ||
var AccessibilitySupport; | ||
(function (AccessibilitySupport) { | ||
/** | ||
* This should be the browser case where it is not known if a screen reader is attached or no. | ||
*/ | ||
AccessibilitySupport[AccessibilitySupport["Unknown"] = 0] = "Unknown"; | ||
AccessibilitySupport[AccessibilitySupport["Disabled"] = 1] = "Disabled"; | ||
AccessibilitySupport[AccessibilitySupport["Enabled"] = 2] = "Enabled"; | ||
})(AccessibilitySupport = exports.AccessibilitySupport || (exports.AccessibilitySupport = {})); | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
//# sourceMappingURL=platform.js.map | ||
/***/ }), | ||
/* 1 */, | ||
/* 2 */, | ||
/* 3 */, | ||
/* 4 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(0)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, platform) { | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
'use strict'; | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
var __extends = undefined && undefined.__extends || function (d, b) { | ||
for (var p in b) { | ||
if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
}function __() { | ||
this.constructor = d; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function _encode(ch) { | ||
return '%' + ch.charCodeAt(0).toString(16).toUpperCase(); | ||
} | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
'use strict'; | ||
// see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent | ||
function encodeURIComponent2(str) { | ||
return encodeURIComponent(str).replace(/[!'()*]/g, _encode); | ||
} | ||
function encodeNoop(str) { | ||
return str.replace(/[#?]/, _encode); | ||
} | ||
/** | ||
* A simple map to store value by a key object. Key can be any object that has toString() function to get | ||
* string value of the key. | ||
* Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. | ||
* This class is a simple parser which creates the basic component paths | ||
* (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation | ||
* and encoding. | ||
* | ||
* foo://example.com:8042/over/there?name=ferret#nose | ||
* \_/ \______________/\_________/ \_________/ \__/ | ||
* | | | | | | ||
* scheme authority path query fragment | ||
* | _____________________|__ | ||
* / \ / \ | ||
* urn:example:animal:ferret:nose | ||
* | ||
* | ||
*/ | ||
var LinkedMap = function () { | ||
function LinkedMap() { | ||
this.map = Object.create(null); | ||
this._size = 0; | ||
var URI = /** @class */function () { | ||
/** | ||
* @internal | ||
*/ | ||
function URI(scheme, authority, path, query, fragment) { | ||
this._formatted = null; | ||
this._fsPath = null; | ||
this.scheme = scheme || URI._empty; | ||
this.authority = authority || URI._empty; | ||
this.path = path || URI._empty; | ||
this.query = query || URI._empty; | ||
this.fragment = fragment || URI._empty; | ||
this._validate(this); | ||
} | ||
Object.defineProperty(LinkedMap.prototype, "size", { | ||
get: function get() { | ||
return this._size; | ||
URI.isUri = function (thing) { | ||
if (thing instanceof URI) { | ||
return true; | ||
} | ||
if (!thing) { | ||
return false; | ||
} | ||
return typeof thing.authority === 'string' && typeof thing.fragment === 'string' && typeof thing.path === 'string' && typeof thing.query === 'string' && typeof thing.scheme === 'string'; | ||
}; | ||
Object.defineProperty(URI.prototype, "fsPath", { | ||
// ---- filesystem path ----------------------- | ||
/** | ||
* Returns a string representing the corresponding file system path of this URI. | ||
* Will handle UNC paths and normalize windows drive letters to lower-case. Also | ||
* uses the platform specific path separator. Will *not* validate the path for | ||
* invalid characters and semantics. Will *not* look at the scheme of this URI. | ||
*/ | ||
get: function () { | ||
if (!this._fsPath) { | ||
var value = void 0; | ||
if (this.authority && this.path && this.scheme === 'file') { | ||
// unc path: file://shares/c$/far/boo | ||
value = "//" + this.authority + this.path; | ||
} else if (URI._driveLetterPath.test(this.path)) { | ||
// windows drive letter: file:///c:/far/boo | ||
value = this.path[1].toLowerCase() + this.path.substr(2); | ||
} else { | ||
// other path | ||
value = this.path; | ||
} | ||
if (platform.isWindows) { | ||
value = value.replace(/\//g, '\\'); | ||
} | ||
this._fsPath = value; | ||
} | ||
return this._fsPath; | ||
}, | ||
@@ -111,73 +278,275 @@ enumerable: true, | ||
}); | ||
LinkedMap.prototype.get = function (k) { | ||
var value = this.peek(k); | ||
return value ? value : null; | ||
// ---- modify to new ------------------------- | ||
URI.prototype.with = function (change) { | ||
if (!change) { | ||
return this; | ||
} | ||
var scheme = change.scheme, | ||
authority = change.authority, | ||
path = change.path, | ||
query = change.query, | ||
fragment = change.fragment; | ||
if (scheme === void 0) { | ||
scheme = this.scheme; | ||
} else if (scheme === null) { | ||
scheme = ''; | ||
} | ||
if (authority === void 0) { | ||
authority = this.authority; | ||
} else if (authority === null) { | ||
authority = ''; | ||
} | ||
if (path === void 0) { | ||
path = this.path; | ||
} else if (path === null) { | ||
path = ''; | ||
} | ||
if (query === void 0) { | ||
query = this.query; | ||
} else if (query === null) { | ||
query = ''; | ||
} | ||
if (fragment === void 0) { | ||
fragment = this.fragment; | ||
} else if (fragment === null) { | ||
fragment = ''; | ||
} | ||
if (scheme === this.scheme && authority === this.authority && path === this.path && query === this.query && fragment === this.fragment) { | ||
return this; | ||
} | ||
return new URI(scheme, authority, path, query, fragment); | ||
}; | ||
LinkedMap.prototype.getOrSet = function (k, t) { | ||
var res = this.get(k); | ||
if (res) { | ||
return res; | ||
// ---- parse & validate ------------------------ | ||
URI.parse = function (value) { | ||
var match = URI._regexp.exec(value); | ||
if (!match) { | ||
return new URI(URI._empty, URI._empty, URI._empty, URI._empty, URI._empty); | ||
} | ||
this.set(k, t); | ||
return t; | ||
return new URI(match[2] || URI._empty, decodeURIComponent(match[4] || URI._empty), decodeURIComponent(match[5] || URI._empty), decodeURIComponent(match[7] || URI._empty), decodeURIComponent(match[9] || URI._empty)); | ||
}; | ||
LinkedMap.prototype.keys = function () { | ||
var keys = []; | ||
for (var key in this.map) { | ||
keys.push(this.map[key].key); | ||
URI.file = function (path) { | ||
var authority = URI._empty; | ||
// normalize to fwd-slashes on windows, | ||
// on other systems bwd-slashes are valid | ||
// filename character, eg /f\oo/ba\r.txt | ||
if (platform.isWindows) { | ||
path = path.replace(/\\/g, URI._slash); | ||
} | ||
return keys; | ||
// check for authority as used in UNC shares | ||
// or use the path as given | ||
if (path[0] === URI._slash && path[0] === path[1]) { | ||
var idx = path.indexOf(URI._slash, 2); | ||
if (idx === -1) { | ||
authority = path.substring(2); | ||
path = URI._empty; | ||
} else { | ||
authority = path.substring(2, idx); | ||
path = path.substring(idx); | ||
} | ||
} | ||
// Ensure that path starts with a slash | ||
// or that it is at least a slash | ||
if (path[0] !== URI._slash) { | ||
path = URI._slash + path; | ||
} | ||
return new URI('file', authority, path, URI._empty, URI._empty); | ||
}; | ||
LinkedMap.prototype.values = function () { | ||
var values = []; | ||
for (var key in this.map) { | ||
values.push(this.map[key].value); | ||
URI.from = function (components) { | ||
return new URI(components.scheme, components.authority, components.path, components.query, components.fragment); | ||
}; | ||
URI.prototype._validate = function (ret) { | ||
// scheme, https://tools.ietf.org/html/rfc3986#section-3.1 | ||
// ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) | ||
if (ret.scheme && !URI._schemePattern.test(ret.scheme)) { | ||
throw new Error('[UriError]: Scheme contains illegal characters.'); | ||
} | ||
return values; | ||
// path, http://tools.ietf.org/html/rfc3986#section-3.3 | ||
// If a URI contains an authority component, then the path component | ||
// must either be empty or begin with a slash ("/") character. If a URI | ||
// does not contain an authority component, then the path cannot begin | ||
// with two slash characters ("//"). | ||
if (ret.path) { | ||
if (ret.authority) { | ||
if (!URI._singleSlashStart.test(ret.path)) { | ||
throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); | ||
} | ||
} else { | ||
if (URI._doubleSlashStart.test(ret.path)) { | ||
throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); | ||
} | ||
} | ||
} | ||
}; | ||
LinkedMap.prototype.entries = function () { | ||
var entries = []; | ||
for (var key in this.map) { | ||
entries.push(this.map[key]); | ||
// ---- printing/externalize --------------------------- | ||
/** | ||
* | ||
* @param skipEncoding Do not encode the result, default is `false` | ||
*/ | ||
URI.prototype.toString = function (skipEncoding) { | ||
if (skipEncoding === void 0) { | ||
skipEncoding = false; | ||
} | ||
return entries; | ||
if (!skipEncoding) { | ||
if (!this._formatted) { | ||
this._formatted = URI._asFormatted(this, false); | ||
} | ||
return this._formatted; | ||
} else { | ||
// we don't cache that | ||
return URI._asFormatted(this, true); | ||
} | ||
}; | ||
LinkedMap.prototype.set = function (k, t) { | ||
if (this.get(k)) { | ||
return false; // already present! | ||
URI._asFormatted = function (uri, skipEncoding) { | ||
var encoder = !skipEncoding ? encodeURIComponent2 : encodeNoop; | ||
var parts = []; | ||
var scheme = uri.scheme, | ||
authority = uri.authority, | ||
path = uri.path, | ||
query = uri.query, | ||
fragment = uri.fragment; | ||
if (scheme) { | ||
parts.push(scheme, ':'); | ||
} | ||
this.push(k, t); | ||
return true; | ||
if (authority || scheme === 'file') { | ||
parts.push('//'); | ||
} | ||
if (authority) { | ||
authority = authority.toLowerCase(); | ||
var idx = authority.indexOf(':'); | ||
if (idx === -1) { | ||
parts.push(encoder(authority)); | ||
} else { | ||
parts.push(encoder(authority.substr(0, idx)), authority.substr(idx)); | ||
} | ||
} | ||
if (path) { | ||
// lower-case windows drive letters in /C:/fff or C:/fff | ||
var m = URI._upperCaseDrive.exec(path); | ||
if (m) { | ||
if (m[1]) { | ||
path = '/' + m[2].toLowerCase() + path.substr(3); // "/c:".length === 3 | ||
} else { | ||
path = m[2].toLowerCase() + path.substr(2); // // "c:".length === 2 | ||
} | ||
} | ||
// encode every segement but not slashes | ||
// make sure that # and ? are always encoded | ||
// when occurring in paths - otherwise the result | ||
// cannot be parsed back again | ||
var lastIdx = 0; | ||
while (true) { | ||
var idx = path.indexOf(URI._slash, lastIdx); | ||
if (idx === -1) { | ||
parts.push(encoder(path.substring(lastIdx))); | ||
break; | ||
} | ||
parts.push(encoder(path.substring(lastIdx, idx)), URI._slash); | ||
lastIdx = idx + 1; | ||
} | ||
; | ||
} | ||
if (query) { | ||
parts.push('?', encoder(query)); | ||
} | ||
if (fragment) { | ||
parts.push('#', encoder(fragment)); | ||
} | ||
return parts.join(URI._empty); | ||
}; | ||
LinkedMap.prototype.delete = function (k) { | ||
var value = this.get(k); | ||
if (value) { | ||
this.pop(k); | ||
return value; | ||
URI.prototype.toJSON = function () { | ||
var res = { | ||
fsPath: this.fsPath, | ||
external: this.toString(), | ||
$mid: 1 | ||
}; | ||
if (this.path) { | ||
res.path = this.path; | ||
} | ||
return null; | ||
if (this.scheme) { | ||
res.scheme = this.scheme; | ||
} | ||
if (this.authority) { | ||
res.authority = this.authority; | ||
} | ||
if (this.query) { | ||
res.query = this.query; | ||
} | ||
if (this.fragment) { | ||
res.fragment = this.fragment; | ||
} | ||
return res; | ||
}; | ||
LinkedMap.prototype.has = function (k) { | ||
return !!this.get(k); | ||
URI.revive = function (data) { | ||
var result = new URI(data.scheme, data.authority, data.path, data.query, data.fragment); | ||
result._fsPath = data.fsPath; | ||
result._formatted = data.external; | ||
return result; | ||
}; | ||
LinkedMap.prototype.clear = function () { | ||
this.map = Object.create(null); | ||
this._size = 0; | ||
}; | ||
LinkedMap.prototype.push = function (key, value) { | ||
var entry = { key: key, value: value }; | ||
this.map[key.toString()] = entry; | ||
this._size++; | ||
}; | ||
LinkedMap.prototype.pop = function (k) { | ||
delete this.map[k.toString()]; | ||
this._size--; | ||
}; | ||
LinkedMap.prototype.peek = function (k) { | ||
var entry = this.map[k.toString()]; | ||
return entry ? entry.value : null; | ||
}; | ||
return LinkedMap; | ||
URI._empty = ''; | ||
URI._slash = '/'; | ||
URI._regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; | ||
URI._driveLetterPath = /^\/[a-zA-Z]:/; | ||
URI._upperCaseDrive = /^(\/)?([A-Z]:)/; | ||
URI._schemePattern = /^\w[\w\d+.-]*$/; | ||
URI._singleSlashStart = /^\//; | ||
URI._doubleSlashStart = /^\/\//; | ||
return URI; | ||
}(); | ||
exports.LinkedMap = LinkedMap; | ||
exports.default = URI; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
//# sourceMappingURL=uri.js.map | ||
/***/ }), | ||
/* 5 */, | ||
/* 6 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
var __extends = this && this.__extends || function () { | ||
var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { | ||
d.__proto__ = b; | ||
} || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { | ||
this.constructor = d; | ||
} | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
}(); | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(4)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, uri_1) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function values(map) { | ||
var result = []; | ||
map.forEach(function (value) { | ||
return result.push(value); | ||
}); | ||
return result; | ||
} | ||
exports.values = values; | ||
function keys(map) { | ||
var result = []; | ||
map.forEach(function (value, key) { | ||
return result.push(key); | ||
}); | ||
return result; | ||
} | ||
exports.keys = keys; | ||
function getOrSet(map, key, value) { | ||
var result = map.get(key); | ||
if (result === void 0) { | ||
result = value; | ||
map.set(key, result); | ||
} | ||
return result; | ||
} | ||
exports.getOrSet = getOrSet; | ||
/** | ||
@@ -188,4 +557,4 @@ * A simple Map<T> that optionally allows to set a limit of entries to store. Once the limit is hit, | ||
*/ | ||
var BoundedLinkedMap = function () { | ||
function BoundedLinkedMap(limit, ratio) { | ||
var BoundedMap = /** @class */function () { | ||
function BoundedMap(limit, ratio, value) { | ||
if (limit === void 0) { | ||
@@ -197,10 +566,31 @@ limit = Number.MAX_VALUE; | ||
} | ||
var _this = this; | ||
this.limit = limit; | ||
this.map = Object.create(null); | ||
this._size = 0; | ||
this.map = new Map(); | ||
this.ratio = limit * ratio; | ||
if (value) { | ||
value.entries.forEach(function (entry) { | ||
_this.set(entry.key, entry.value); | ||
}); | ||
} | ||
} | ||
Object.defineProperty(BoundedLinkedMap.prototype, "size", { | ||
get: function get() { | ||
return this._size; | ||
BoundedMap.prototype.setLimit = function (limit) { | ||
if (limit < 0) { | ||
return; // invalid limit | ||
} | ||
this.limit = limit; | ||
while (this.map.size > this.limit) { | ||
this.trim(); | ||
} | ||
}; | ||
BoundedMap.prototype.serialize = function () { | ||
var serialized = { entries: [] }; | ||
this.map.forEach(function (entry) { | ||
serialized.entries.push({ key: entry.key, value: entry.value }); | ||
}); | ||
return serialized; | ||
}; | ||
Object.defineProperty(BoundedMap.prototype, "size", { | ||
get: function () { | ||
return this.map.size; | ||
}, | ||
@@ -210,4 +600,4 @@ enumerable: true, | ||
}); | ||
BoundedLinkedMap.prototype.set = function (key, value) { | ||
if (this.map[key]) { | ||
BoundedMap.prototype.set = function (key, value) { | ||
if (this.map.has(key)) { | ||
return false; // already present! | ||
@@ -217,3 +607,3 @@ } | ||
this.push(entry); | ||
if (this._size > this.limit) { | ||
if (this.size > this.limit) { | ||
this.trim(); | ||
@@ -223,7 +613,7 @@ } | ||
}; | ||
BoundedLinkedMap.prototype.get = function (key) { | ||
var entry = this.map[key]; | ||
BoundedMap.prototype.get = function (key) { | ||
var entry = this.map.get(key); | ||
return entry ? entry.value : null; | ||
}; | ||
BoundedLinkedMap.prototype.getOrSet = function (k, t) { | ||
BoundedMap.prototype.getOrSet = function (k, t) { | ||
var res = this.get(k); | ||
@@ -236,7 +626,6 @@ if (res) { | ||
}; | ||
BoundedLinkedMap.prototype.delete = function (key) { | ||
var entry = this.map[key]; | ||
BoundedMap.prototype.delete = function (key) { | ||
var entry = this.map.get(key); | ||
if (entry) { | ||
this.map[key] = void 0; | ||
this._size--; | ||
this.map.delete(key); | ||
if (entry.next) { | ||
@@ -256,12 +645,11 @@ entry.next.prev = entry.prev; // [A]<-[x]<-[C] = [A]<-[C] | ||
}; | ||
BoundedLinkedMap.prototype.has = function (key) { | ||
return !!this.map[key]; | ||
BoundedMap.prototype.has = function (key) { | ||
return this.map.has(key); | ||
}; | ||
BoundedLinkedMap.prototype.clear = function () { | ||
this.map = Object.create(null); | ||
this._size = 0; | ||
BoundedMap.prototype.clear = function () { | ||
this.map.clear(); | ||
this.head = null; | ||
this.tail = null; | ||
}; | ||
BoundedLinkedMap.prototype.push = function (entry) { | ||
BoundedMap.prototype.push = function (entry) { | ||
if (this.head) { | ||
@@ -276,6 +664,5 @@ // [A]-[B] = [A]-[B]->[X] | ||
this.head = entry; | ||
this.map[entry.key] = entry; | ||
this._size++; | ||
this.map.set(entry.key, entry); | ||
}; | ||
BoundedLinkedMap.prototype.trim = function () { | ||
BoundedMap.prototype.trim = function () { | ||
if (this.tail) { | ||
@@ -288,4 +675,3 @@ // Remove all elements until ratio is reached | ||
// Remove the entry | ||
this.map[current.key] = void 0; | ||
this._size--; | ||
this.map.delete(current.key); | ||
// if we reached the element that overflows our ratio condition | ||
@@ -303,40 +689,16 @@ // make its next element the new tail of the Map and adjust the size | ||
} else { | ||
this.map[this.tail.key] = void 0; | ||
this._size--; | ||
this.map.delete(this.tail.key); | ||
// [x]-[B] = [B] | ||
this.tail = this.tail.next; | ||
this.tail.prev = null; | ||
if (this.tail) { | ||
this.tail.prev = null; | ||
} | ||
} | ||
} | ||
}; | ||
return BoundedLinkedMap; | ||
return BoundedMap; | ||
}(); | ||
exports.BoundedLinkedMap = BoundedLinkedMap; | ||
/** | ||
* A subclass of Map<T> that makes an entry the MRU entry as soon | ||
* as it is being accessed. In combination with the limit for the | ||
* maximum number of elements in the cache, it helps to remove those | ||
* entries from the cache that are LRU. | ||
*/ | ||
var LRUCache = function (_super) { | ||
__extends(LRUCache, _super); | ||
function LRUCache(limit) { | ||
return _super.call(this, limit) || this; | ||
} | ||
LRUCache.prototype.get = function (key) { | ||
// Upon access of an entry, make it the head of | ||
// the linked map so that it is the MRU element | ||
var entry = this.map[key]; | ||
if (entry) { | ||
this.delete(key); | ||
this.push(entry); | ||
return entry.value; | ||
} | ||
return null; | ||
}; | ||
return LRUCache; | ||
}(BoundedLinkedMap); | ||
exports.LRUCache = LRUCache; | ||
exports.BoundedMap = BoundedMap; | ||
// --- trie'ish datastructure | ||
var Node = function () { | ||
var Node = /** @class */function () { | ||
function Node() { | ||
@@ -351,6 +713,13 @@ this.children = new Map(); | ||
*/ | ||
var TrieMap = function () { | ||
var TrieMap = /** @class */function () { | ||
function TrieMap(splitter) { | ||
if (splitter === void 0) { | ||
splitter = TrieMap.PathSplitter; | ||
} | ||
this._root = new Node(); | ||
this._splitter = splitter; | ||
this._splitter = function (s) { | ||
return splitter(s).filter(function (s) { | ||
return Boolean(s); | ||
}); | ||
}; | ||
} | ||
@@ -363,3 +732,3 @@ TrieMap.prototype.insert = function (path, element) { | ||
for (; i < parts.length; i++) { | ||
var child = node.children[parts[i]]; | ||
var child = node.children.get(parts[i]); | ||
if (child) { | ||
@@ -375,3 +744,3 @@ node = child; | ||
newNode = new Node(); | ||
node.children[parts[i]] = newNode; | ||
node.children.set(parts[i], newNode); | ||
node = newNode; | ||
@@ -387,3 +756,3 @@ } | ||
var part = parts_1[_i]; | ||
node = children[part]; | ||
node = children.get(part); | ||
if (!node) { | ||
@@ -402,3 +771,3 @@ return undefined; | ||
var part = parts_2[_i]; | ||
var node = children[part]; | ||
var node = children.get(part); | ||
if (!node) { | ||
@@ -425,3 +794,3 @@ break; | ||
var part = parts_3[_i]; | ||
node = children[part]; | ||
node = children.get(part); | ||
if (!node) { | ||
@@ -436,10 +805,336 @@ return undefined; | ||
}; | ||
TrieMap.PathSplitter = function (s) { | ||
return s.split(/[\\/]/).filter(function (s) { | ||
return !!s; | ||
}); | ||
}; | ||
return TrieMap; | ||
}(); | ||
TrieMap.PathSplitter = function (s) { | ||
return s.split(/[\\/]/).filter(function (s) { | ||
return !!s; | ||
exports.TrieMap = TrieMap; | ||
var ResourceMap = /** @class */function () { | ||
function ResourceMap(ignoreCase) { | ||
this.ignoreCase = ignoreCase; | ||
this.map = new Map(); | ||
} | ||
ResourceMap.prototype.set = function (resource, value) { | ||
this.map.set(this.toKey(resource), value); | ||
}; | ||
ResourceMap.prototype.get = function (resource) { | ||
return this.map.get(this.toKey(resource)); | ||
}; | ||
ResourceMap.prototype.has = function (resource) { | ||
return this.map.has(this.toKey(resource)); | ||
}; | ||
Object.defineProperty(ResourceMap.prototype, "size", { | ||
get: function () { | ||
return this.map.size; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
}; | ||
exports.TrieMap = TrieMap; | ||
ResourceMap.prototype.clear = function () { | ||
this.map.clear(); | ||
}; | ||
ResourceMap.prototype.delete = function (resource) { | ||
return this.map.delete(this.toKey(resource)); | ||
}; | ||
ResourceMap.prototype.forEach = function (clb) { | ||
this.map.forEach(clb); | ||
}; | ||
ResourceMap.prototype.values = function () { | ||
return values(this.map); | ||
}; | ||
ResourceMap.prototype.toKey = function (resource) { | ||
var key = resource.toString(); | ||
if (this.ignoreCase) { | ||
key = key.toLowerCase(); | ||
} | ||
return key; | ||
}; | ||
return ResourceMap; | ||
}(); | ||
exports.ResourceMap = ResourceMap; | ||
var StrictResourceMap = /** @class */function (_super) { | ||
__extends(StrictResourceMap, _super); | ||
function StrictResourceMap() { | ||
return _super.call(this) || this; | ||
} | ||
StrictResourceMap.prototype.keys = function () { | ||
return keys(this.map).map(function (key) { | ||
return uri_1.default.parse(key); | ||
}); | ||
}; | ||
return StrictResourceMap; | ||
}(ResourceMap); | ||
exports.StrictResourceMap = StrictResourceMap; | ||
var Touch; | ||
(function (Touch) { | ||
Touch.None = 0; | ||
Touch.First = 1; | ||
Touch.Last = 2; | ||
})(Touch = exports.Touch || (exports.Touch = {})); | ||
var LinkedMap = /** @class */function () { | ||
function LinkedMap() { | ||
this._map = new Map(); | ||
this._head = undefined; | ||
this._tail = undefined; | ||
this._size = 0; | ||
} | ||
LinkedMap.prototype.clear = function () { | ||
this._map.clear(); | ||
this._head = undefined; | ||
this._tail = undefined; | ||
this._size = 0; | ||
}; | ||
LinkedMap.prototype.isEmpty = function () { | ||
return !this._head && !this._tail; | ||
}; | ||
Object.defineProperty(LinkedMap.prototype, "size", { | ||
get: function () { | ||
return this._size; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
LinkedMap.prototype.has = function (key) { | ||
return this._map.has(key); | ||
}; | ||
LinkedMap.prototype.get = function (key) { | ||
var item = this._map.get(key); | ||
if (!item) { | ||
return undefined; | ||
} | ||
return item.value; | ||
}; | ||
LinkedMap.prototype.set = function (key, value, touch) { | ||
if (touch === void 0) { | ||
touch = Touch.None; | ||
} | ||
var item = this._map.get(key); | ||
if (item) { | ||
item.value = value; | ||
if (touch !== Touch.None) { | ||
this.touch(item, touch); | ||
} | ||
} else { | ||
item = { key: key, value: value, next: undefined, previous: undefined }; | ||
switch (touch) { | ||
case Touch.None: | ||
this.addItemLast(item); | ||
break; | ||
case Touch.First: | ||
this.addItemFirst(item); | ||
break; | ||
case Touch.Last: | ||
this.addItemLast(item); | ||
break; | ||
default: | ||
this.addItemLast(item); | ||
break; | ||
} | ||
this._map.set(key, item); | ||
this._size++; | ||
} | ||
}; | ||
LinkedMap.prototype.delete = function (key) { | ||
return !!this.remove(key); | ||
}; | ||
LinkedMap.prototype.remove = function (key) { | ||
var item = this._map.get(key); | ||
if (!item) { | ||
return undefined; | ||
} | ||
this._map.delete(key); | ||
this.removeItem(item); | ||
this._size--; | ||
return item.value; | ||
}; | ||
LinkedMap.prototype.shift = function () { | ||
if (!this._head && !this._tail) { | ||
return undefined; | ||
} | ||
if (!this._head || !this._tail) { | ||
throw new Error('Invalid list'); | ||
} | ||
var item = this._head; | ||
this._map.delete(item.key); | ||
this.removeItem(item); | ||
this._size--; | ||
return item.value; | ||
}; | ||
LinkedMap.prototype.forEach = function (callbackfn, thisArg) { | ||
var current = this._head; | ||
while (current) { | ||
if (thisArg) { | ||
callbackfn.bind(thisArg)(current.value, current.key, this); | ||
} else { | ||
callbackfn(current.value, current.key, this); | ||
} | ||
current = current.next; | ||
} | ||
}; | ||
LinkedMap.prototype.forEachReverse = function (callbackfn, thisArg) { | ||
var current = this._tail; | ||
while (current) { | ||
if (thisArg) { | ||
callbackfn.bind(thisArg)(current.value, current.key, this); | ||
} else { | ||
callbackfn(current.value, current.key, this); | ||
} | ||
current = current.previous; | ||
} | ||
}; | ||
LinkedMap.prototype.values = function () { | ||
var result = []; | ||
var current = this._head; | ||
while (current) { | ||
result.push(current.value); | ||
current = current.next; | ||
} | ||
return result; | ||
}; | ||
LinkedMap.prototype.keys = function () { | ||
var result = []; | ||
var current = this._head; | ||
while (current) { | ||
result.push(current.key); | ||
current = current.next; | ||
} | ||
return result; | ||
}; | ||
/* VS Code / Monaco editor runs on es5 which has no Symbol.iterator | ||
public keys(): IterableIterator<K> { | ||
let current = this._head; | ||
let iterator: IterableIterator<K> = { | ||
[Symbol.iterator]() { | ||
return iterator; | ||
}, | ||
next():IteratorResult<K> { | ||
if (current) { | ||
let result = { value: current.key, done: false }; | ||
current = current.next; | ||
return result; | ||
} else { | ||
return { value: undefined, done: true }; | ||
} | ||
} | ||
}; | ||
return iterator; | ||
} | ||
public values(): IterableIterator<V> { | ||
let current = this._head; | ||
let iterator: IterableIterator<V> = { | ||
[Symbol.iterator]() { | ||
return iterator; | ||
}, | ||
next():IteratorResult<V> { | ||
if (current) { | ||
let result = { value: current.value, done: false }; | ||
current = current.next; | ||
return result; | ||
} else { | ||
return { value: undefined, done: true }; | ||
} | ||
} | ||
}; | ||
return iterator; | ||
} | ||
*/ | ||
LinkedMap.prototype.addItemFirst = function (item) { | ||
// First time Insert | ||
if (!this._head && !this._tail) { | ||
this._tail = item; | ||
} else if (!this._head) { | ||
throw new Error('Invalid list'); | ||
} else { | ||
item.next = this._head; | ||
this._head.previous = item; | ||
} | ||
this._head = item; | ||
}; | ||
LinkedMap.prototype.addItemLast = function (item) { | ||
// First time Insert | ||
if (!this._head && !this._tail) { | ||
this._head = item; | ||
} else if (!this._tail) { | ||
throw new Error('Invalid list'); | ||
} else { | ||
item.previous = this._tail; | ||
this._tail.next = item; | ||
} | ||
this._tail = item; | ||
}; | ||
LinkedMap.prototype.removeItem = function (item) { | ||
if (item === this._head && item === this._tail) { | ||
this._head = undefined; | ||
this._tail = undefined; | ||
} else if (item === this._head) { | ||
this._head = item.next; | ||
} else if (item === this._tail) { | ||
this._tail = item.previous; | ||
} else { | ||
var next = item.next; | ||
var previous = item.previous; | ||
if (!next || !previous) { | ||
throw new Error('Invalid list'); | ||
} | ||
next.previous = previous; | ||
previous.next = next; | ||
} | ||
}; | ||
LinkedMap.prototype.touch = function (item, touch) { | ||
if (!this._head || !this._tail) { | ||
throw new Error('Invalid list'); | ||
} | ||
if (touch !== Touch.First && touch !== Touch.Last) { | ||
return; | ||
} | ||
if (touch === Touch.First) { | ||
if (item === this._head) { | ||
return; | ||
} | ||
var next = item.next; | ||
var previous = item.previous; | ||
// Unlink the item | ||
if (item === this._tail) { | ||
// previous must be defined since item was not head but is tail | ||
// So there are more than on item in the map | ||
previous.next = undefined; | ||
this._tail = previous; | ||
} else { | ||
// Both next and previous are not undefined since item was neither head nor tail. | ||
next.previous = previous; | ||
previous.next = next; | ||
} | ||
// Insert the node at head | ||
item.previous = undefined; | ||
item.next = this._head; | ||
this._head.previous = item; | ||
this._head = item; | ||
} else if (touch === Touch.Last) { | ||
if (item === this._tail) { | ||
return; | ||
} | ||
var next = item.next; | ||
var previous = item.previous; | ||
// Unlink the item. | ||
if (item === this._head) { | ||
// next must be defined since item was not tail but is head | ||
// So there are more than on item in the map | ||
next.previous = undefined; | ||
this._head = next; | ||
} else { | ||
// Both next and previous are not undefined since item was neither head nor tail. | ||
next.previous = previous; | ||
previous.next = next; | ||
} | ||
item.next = undefined; | ||
item.previous = this._tail; | ||
this._tail.next = item; | ||
this._tail = item; | ||
} | ||
}; | ||
return LinkedMap; | ||
}(); | ||
exports.LinkedMap = LinkedMap; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
@@ -450,4 +1145,3 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
/***/ }) | ||
/******/ }); | ||
/******/ ]); | ||
//# sourceMappingURL=map.js.map |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 91); | ||
/******/ return __webpack_require__(__webpack_require__.s = 40); | ||
/******/ }) | ||
@@ -74,9 +71,6 @@ /************************************************************************/ | ||
/***/ 42: | ||
/***/ 31: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
/** | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** | ||
* marked - a markdown parser | ||
@@ -137,4 +131,5 @@ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) | ||
block.gfm = merge({}, block.normal, { | ||
fences: /^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/, | ||
paragraph: /^/ | ||
fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/, | ||
paragraph: /^/, | ||
heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ | ||
}); | ||
@@ -241,3 +236,3 @@ | ||
lang: cap[2], | ||
text: cap[3] | ||
text: cap[3] || '' | ||
}); | ||
@@ -407,3 +402,3 @@ continue; | ||
type: this.options.sanitize ? 'paragraph' : 'html', | ||
pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style', | ||
pre: !this.options.sanitizer && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), | ||
text: cap[0] | ||
@@ -498,3 +493,3 @@ }); | ||
strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, | ||
em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, | ||
em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, | ||
code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, | ||
@@ -639,3 +634,3 @@ br: /^ {2,}\n(?!\s*$)/, | ||
src = src.substring(cap[0].length); | ||
out += this.options.sanitize ? escape(cap[0]) : cap[0]; | ||
out += this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0]; | ||
continue; | ||
@@ -710,3 +705,3 @@ } | ||
src = src.substring(cap[0].length); | ||
out += escape(this.smartypants(cap[0])); | ||
out += this.renderer.text(escape(this.smartypants(cap[0]))); | ||
continue; | ||
@@ -737,20 +732,20 @@ } | ||
*/ | ||
// TODO MonacoChange: Our build fails over the following lines if they are not commented out | ||
InlineLexer.prototype.smartypants = function (text) { | ||
return text; | ||
// if (!this.options.smartypants) return text; | ||
// return text | ||
// // em-dashes | ||
// .replace(/--/g, '\u2014') | ||
// // opening singles | ||
// .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') | ||
// // closing singles & apostrophes | ||
// .replace(/'/g, '\u2019') | ||
// // opening doubles | ||
// .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') | ||
// // closing doubles | ||
// .replace(/"/g, '\u201d') | ||
// // ellipses | ||
// .replace(/\.{3}/g, '\u2026'); | ||
// END MonacoChange | ||
if (!this.options.smartypants) return text; | ||
return text | ||
// em-dashes | ||
.replace(/---/g, '\u2014') | ||
// en-dashes | ||
.replace(/--/g, '\u2013') | ||
// opening singles | ||
.replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') | ||
// closing singles & apostrophes | ||
.replace(/'/g, '\u2019') | ||
// opening doubles | ||
.replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') | ||
// closing doubles | ||
.replace(/"/g, '\u201d') | ||
// ellipses | ||
.replace(/\.{3}/g, '\u2026'); | ||
}; | ||
@@ -763,2 +758,3 @@ | ||
InlineLexer.prototype.mangle = function (text) { | ||
if (!this.options.mangle) return text; | ||
var out = '', | ||
@@ -875,3 +871,3 @@ l = text.length, | ||
} | ||
if (prot.indexOf('javascript:') === 0) { | ||
if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { | ||
return ''; | ||
@@ -897,2 +893,6 @@ } | ||
Renderer.prototype.text = function (text) { | ||
return text; | ||
}; | ||
/** | ||
@@ -1084,3 +1084,4 @@ * Parsing & Compiling | ||
function unescape(html) { | ||
return html.replace(/&([#\w]+);/g, function (_, n) { | ||
// explicitly match decimal, hex, and named HTML entities | ||
return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, function (_, n) { | ||
n = n.toLowerCase(); | ||
@@ -1153,3 +1154,3 @@ if (n === 'colon') return ':'; | ||
var done = function done(err) { | ||
var done = function (err) { | ||
if (err) { | ||
@@ -1206,3 +1207,3 @@ opt.highlight = highlight; | ||
if ((opt || marked.defaults).silent) { | ||
return '<p>An error occured:</p><pre>' + escape(e.message + '', true) + '</pre>'; | ||
return '<p>An error occurred:</p><pre>' + escape(e.message + '', true) + '</pre>'; | ||
} | ||
@@ -1228,2 +1229,4 @@ throw e; | ||
sanitize: false, | ||
sanitizer: null, | ||
mangle: true, | ||
smartLists: false, | ||
@@ -1276,9 +1279,6 @@ silent: false, | ||
/***/ 91: | ||
/***/ 40: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
/*--------------------------------------------------------------------------------------------- | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
@@ -1288,3 +1288,3 @@ * Licensed under the MIT License. See License.txt in the project root for license information. | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(42)], __WEBPACK_AMD_DEFINE_RESULT__ = function (marked) { | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(31)], __WEBPACK_AMD_DEFINE_RESULT__ = function (marked) { | ||
return { | ||
@@ -1291,0 +1291,0 @@ marked: marked |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 42); | ||
/******/ return __webpack_require__(__webpack_require__.s = 31); | ||
/******/ }) | ||
@@ -74,9 +71,6 @@ /************************************************************************/ | ||
/***/ 42: | ||
/***/ 31: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
/** | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** | ||
* marked - a markdown parser | ||
@@ -137,4 +131,5 @@ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) | ||
block.gfm = merge({}, block.normal, { | ||
fences: /^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/, | ||
paragraph: /^/ | ||
fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/, | ||
paragraph: /^/, | ||
heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ | ||
}); | ||
@@ -241,3 +236,3 @@ | ||
lang: cap[2], | ||
text: cap[3] | ||
text: cap[3] || '' | ||
}); | ||
@@ -407,3 +402,3 @@ continue; | ||
type: this.options.sanitize ? 'paragraph' : 'html', | ||
pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style', | ||
pre: !this.options.sanitizer && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), | ||
text: cap[0] | ||
@@ -498,3 +493,3 @@ }); | ||
strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, | ||
em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, | ||
em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, | ||
code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, | ||
@@ -639,3 +634,3 @@ br: /^ {2,}\n(?!\s*$)/, | ||
src = src.substring(cap[0].length); | ||
out += this.options.sanitize ? escape(cap[0]) : cap[0]; | ||
out += this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0]; | ||
continue; | ||
@@ -710,3 +705,3 @@ } | ||
src = src.substring(cap[0].length); | ||
out += escape(this.smartypants(cap[0])); | ||
out += this.renderer.text(escape(this.smartypants(cap[0]))); | ||
continue; | ||
@@ -737,20 +732,20 @@ } | ||
*/ | ||
// TODO MonacoChange: Our build fails over the following lines if they are not commented out | ||
InlineLexer.prototype.smartypants = function (text) { | ||
return text; | ||
// if (!this.options.smartypants) return text; | ||
// return text | ||
// // em-dashes | ||
// .replace(/--/g, '\u2014') | ||
// // opening singles | ||
// .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') | ||
// // closing singles & apostrophes | ||
// .replace(/'/g, '\u2019') | ||
// // opening doubles | ||
// .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') | ||
// // closing doubles | ||
// .replace(/"/g, '\u201d') | ||
// // ellipses | ||
// .replace(/\.{3}/g, '\u2026'); | ||
// END MonacoChange | ||
if (!this.options.smartypants) return text; | ||
return text | ||
// em-dashes | ||
.replace(/---/g, '\u2014') | ||
// en-dashes | ||
.replace(/--/g, '\u2013') | ||
// opening singles | ||
.replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') | ||
// closing singles & apostrophes | ||
.replace(/'/g, '\u2019') | ||
// opening doubles | ||
.replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') | ||
// closing doubles | ||
.replace(/"/g, '\u201d') | ||
// ellipses | ||
.replace(/\.{3}/g, '\u2026'); | ||
}; | ||
@@ -763,2 +758,3 @@ | ||
InlineLexer.prototype.mangle = function (text) { | ||
if (!this.options.mangle) return text; | ||
var out = '', | ||
@@ -875,3 +871,3 @@ l = text.length, | ||
} | ||
if (prot.indexOf('javascript:') === 0) { | ||
if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { | ||
return ''; | ||
@@ -897,2 +893,6 @@ } | ||
Renderer.prototype.text = function (text) { | ||
return text; | ||
}; | ||
/** | ||
@@ -1084,3 +1084,4 @@ * Parsing & Compiling | ||
function unescape(html) { | ||
return html.replace(/&([#\w]+);/g, function (_, n) { | ||
// explicitly match decimal, hex, and named HTML entities | ||
return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, function (_, n) { | ||
n = n.toLowerCase(); | ||
@@ -1153,3 +1154,3 @@ if (n === 'colon') return ':'; | ||
var done = function done(err) { | ||
var done = function (err) { | ||
if (err) { | ||
@@ -1206,3 +1207,3 @@ opt.highlight = highlight; | ||
if ((opt || marked.defaults).silent) { | ||
return '<p>An error occured:</p><pre>' + escape(e.message + '', true) + '</pre>'; | ||
return '<p>An error occurred:</p><pre>' + escape(e.message + '', true) + '</pre>'; | ||
} | ||
@@ -1228,2 +1229,4 @@ throw e; | ||
sanitize: false, | ||
sanitizer: null, | ||
mangle: true, | ||
smartLists: false, | ||
@@ -1230,0 +1233,0 @@ silent: false, |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 92); | ||
/******/ return __webpack_require__(__webpack_require__.s = 75); | ||
/******/ }) | ||
@@ -77,8 +74,3 @@ /************************************************************************/ | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -89,4 +81,5 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// --- THIS FILE IS TEMPORARY UNTIL ENV.TS IS CLEANED UP. IT CAN SAFELY BE USED IN ALL TARGET EXECUTION ENVIRONMENTS (node & dom) --- | ||
var _isWindows = false; | ||
@@ -98,3 +91,2 @@ var _isMacintosh = false; | ||
var _isWeb = false; | ||
var _isQunit = false; | ||
var _locale = undefined; | ||
@@ -104,3 +96,3 @@ var _language = undefined; | ||
// OS detection | ||
if ((typeof process === "undefined" ? "undefined" : _typeof(process)) === 'object') { | ||
if (typeof process === 'object') { | ||
_isWindows = process.platform === 'win32'; | ||
@@ -121,3 +113,3 @@ _isMacintosh = process.platform === 'darwin'; | ||
_isNative = true; | ||
} else if ((typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) === 'object') { | ||
} else if (typeof navigator === 'object') { | ||
var userAgent = navigator.userAgent; | ||
@@ -130,3 +122,2 @@ _isWindows = userAgent.indexOf('Windows') >= 0; | ||
_language = _locale; | ||
_isQunit = !!self.QUnit; | ||
} | ||
@@ -140,10 +131,10 @@ var Platform; | ||
})(Platform = exports.Platform || (exports.Platform = {})); | ||
exports._platform = Platform.Web; | ||
var _platform = Platform.Web; | ||
if (_isNative) { | ||
if (_isMacintosh) { | ||
exports._platform = Platform.Mac; | ||
_platform = Platform.Mac; | ||
} else if (_isWindows) { | ||
exports._platform = Platform.Windows; | ||
_platform = Platform.Windows; | ||
} else if (_isLinux) { | ||
exports._platform = Platform.Linux; | ||
_platform = Platform.Linux; | ||
} | ||
@@ -157,4 +148,3 @@ } | ||
exports.isWeb = _isWeb; | ||
exports.isQunit = _isQunit; | ||
exports.platform = exports._platform; | ||
exports.platform = _platform; | ||
/** | ||
@@ -172,3 +162,3 @@ * The language used for the user interface. The format of | ||
exports.locale = _locale; | ||
var _globals = (typeof self === "undefined" ? "undefined" : _typeof(self)) === 'object' ? self : global; | ||
var _globals = typeof self === 'object' ? self : global; | ||
exports.globals = _globals; | ||
@@ -183,2 +173,18 @@ function hasWebWorkerSupport() { | ||
exports.clearInterval = _globals.clearInterval.bind(_globals); | ||
var OperatingSystem; | ||
(function (OperatingSystem) { | ||
OperatingSystem[OperatingSystem["Windows"] = 1] = "Windows"; | ||
OperatingSystem[OperatingSystem["Macintosh"] = 2] = "Macintosh"; | ||
OperatingSystem[OperatingSystem["Linux"] = 3] = "Linux"; | ||
})(OperatingSystem = exports.OperatingSystem || (exports.OperatingSystem = {})); | ||
exports.OS = _isMacintosh ? 2 /* Macintosh */ : _isWindows ? 1 /* Windows */ : 3 /* Linux */; | ||
var AccessibilitySupport; | ||
(function (AccessibilitySupport) { | ||
/** | ||
* This should be the browser case where it is not known if a screen reader is attached or no. | ||
*/ | ||
AccessibilitySupport[AccessibilitySupport["Unknown"] = 0] = "Unknown"; | ||
AccessibilitySupport[AccessibilitySupport["Disabled"] = 1] = "Disabled"; | ||
AccessibilitySupport[AccessibilitySupport["Enabled"] = 2] = "Enabled"; | ||
})(AccessibilitySupport = exports.AccessibilitySupport || (exports.AccessibilitySupport = {})); | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
@@ -190,9 +196,6 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
/***/ 16: | ||
/***/ 4: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(0)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, platform) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(0)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, platform) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -204,2 +207,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function _encode(ch) { | ||
@@ -213,3 +217,3 @@ return '%' + ch.charCodeAt(0).toString(16).toUpperCase(); | ||
function encodeNoop(str) { | ||
return str; | ||
return str.replace(/[#?]/, _encode); | ||
} | ||
@@ -232,11 +236,15 @@ /** | ||
*/ | ||
var URI = function () { | ||
function URI() { | ||
this._scheme = URI._empty; | ||
this._authority = URI._empty; | ||
this._path = URI._empty; | ||
this._query = URI._empty; | ||
this._fragment = URI._empty; | ||
var URI = /** @class */function () { | ||
/** | ||
* @internal | ||
*/ | ||
function URI(scheme, authority, path, query, fragment) { | ||
this._formatted = null; | ||
this._fsPath = null; | ||
this.scheme = scheme || URI._empty; | ||
this.authority = authority || URI._empty; | ||
this.path = path || URI._empty; | ||
this.query = query || URI._empty; | ||
this.fragment = fragment || URI._empty; | ||
this._validate(this); | ||
} | ||
@@ -252,54 +260,2 @@ URI.isUri = function (thing) { | ||
}; | ||
Object.defineProperty(URI.prototype, "scheme", { | ||
/** | ||
* scheme is the 'http' part of 'http://www.msft.com/some/path?query#fragment'. | ||
* The part before the first colon. | ||
*/ | ||
get: function get() { | ||
return this._scheme; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "authority", { | ||
/** | ||
* authority is the 'www.msft.com' part of 'http://www.msft.com/some/path?query#fragment'. | ||
* The part between the first double slashes and the next slash. | ||
*/ | ||
get: function get() { | ||
return this._authority; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "path", { | ||
/** | ||
* path is the '/some/path' part of 'http://www.msft.com/some/path?query#fragment'. | ||
*/ | ||
get: function get() { | ||
return this._path; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "query", { | ||
/** | ||
* query is the 'query' part of 'http://www.msft.com/some/path?query#fragment'. | ||
*/ | ||
get: function get() { | ||
return this._query; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "fragment", { | ||
/** | ||
* fragment is the 'fragment' part of 'http://www.msft.com/some/path?query#fragment'. | ||
*/ | ||
get: function get() { | ||
return this._fragment; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "fsPath", { | ||
@@ -313,14 +269,14 @@ // ---- filesystem path ----------------------- | ||
*/ | ||
get: function get() { | ||
get: function () { | ||
if (!this._fsPath) { | ||
var value; | ||
if (this._authority && this._path && this.scheme === 'file') { | ||
var value = void 0; | ||
if (this.authority && this.path && this.scheme === 'file') { | ||
// unc path: file://shares/c$/far/boo | ||
value = "//" + this._authority + this._path; | ||
} else if (URI._driveLetterPath.test(this._path)) { | ||
value = "//" + this.authority + this.path; | ||
} else if (URI._driveLetterPath.test(this.path)) { | ||
// windows drive letter: file:///c:/far/boo | ||
value = this._path[1].toLowerCase() + this._path.substr(2); | ||
value = this.path[1].toLowerCase() + this.path.substr(2); | ||
} else { | ||
// other path | ||
value = this._path; | ||
value = this.path; | ||
} | ||
@@ -375,28 +331,20 @@ if (platform.isWindows) { | ||
} | ||
var ret = new URI(); | ||
ret._scheme = scheme; | ||
ret._authority = authority; | ||
ret._path = path; | ||
ret._query = query; | ||
ret._fragment = fragment; | ||
URI._validate(ret); | ||
return ret; | ||
return new URI(scheme, authority, path, query, fragment); | ||
}; | ||
// ---- parse & validate ------------------------ | ||
URI.parse = function (value) { | ||
var ret = new URI(); | ||
var data = URI._parseComponents(value); | ||
ret._scheme = data.scheme; | ||
ret._authority = decodeURIComponent(data.authority); | ||
ret._path = decodeURIComponent(data.path); | ||
ret._query = decodeURIComponent(data.query); | ||
ret._fragment = decodeURIComponent(data.fragment); | ||
URI._validate(ret); | ||
return ret; | ||
var match = URI._regexp.exec(value); | ||
if (!match) { | ||
return new URI(URI._empty, URI._empty, URI._empty, URI._empty, URI._empty); | ||
} | ||
return new URI(match[2] || URI._empty, decodeURIComponent(match[4] || URI._empty), decodeURIComponent(match[5] || URI._empty), decodeURIComponent(match[7] || URI._empty), decodeURIComponent(match[9] || URI._empty)); | ||
}; | ||
URI.file = function (path) { | ||
var ret = new URI(); | ||
ret._scheme = 'file'; | ||
// normalize to fwd-slashes | ||
path = path.replace(/\\/g, URI._slash); | ||
var authority = URI._empty; | ||
// normalize to fwd-slashes on windows, | ||
// on other systems bwd-slashes are valid | ||
// filename character, eg /f\oo/ba\r.txt | ||
if (platform.isWindows) { | ||
path = path.replace(/\\/g, URI._slash); | ||
} | ||
// check for authority as used in UNC shares | ||
@@ -407,40 +355,20 @@ // or use the path as given | ||
if (idx === -1) { | ||
ret._authority = path.substring(2); | ||
authority = path.substring(2); | ||
path = URI._empty; | ||
} else { | ||
ret._authority = path.substring(2, idx); | ||
ret._path = path.substring(idx); | ||
authority = path.substring(2, idx); | ||
path = path.substring(idx); | ||
} | ||
} else { | ||
ret._path = path; | ||
} | ||
// Ensure that path starts with a slash | ||
// or that it is at least a slash | ||
if (ret._path[0] !== URI._slash) { | ||
ret._path = URI._slash + ret._path; | ||
if (path[0] !== URI._slash) { | ||
path = URI._slash + path; | ||
} | ||
URI._validate(ret); | ||
return ret; | ||
return new URI('file', authority, path, URI._empty, URI._empty); | ||
}; | ||
URI._parseComponents = function (value) { | ||
var ret = { | ||
scheme: URI._empty, | ||
authority: URI._empty, | ||
path: URI._empty, | ||
query: URI._empty, | ||
fragment: URI._empty | ||
}; | ||
var match = URI._regexp.exec(value); | ||
if (match) { | ||
ret.scheme = match[2] || ret.scheme; | ||
ret.authority = match[4] || ret.authority; | ||
ret.path = match[5] || ret.path; | ||
ret.query = match[7] || ret.query; | ||
ret.fragment = match[9] || ret.fragment; | ||
} | ||
return ret; | ||
}; | ||
URI.from = function (components) { | ||
return new URI().with(components); | ||
return new URI(components.scheme, components.authority, components.path, components.query, components.fragment); | ||
}; | ||
URI._validate = function (ret) { | ||
URI.prototype._validate = function (ret) { | ||
// scheme, https://tools.ietf.org/html/rfc3986#section-3.1 | ||
@@ -528,6 +456,6 @@ // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) | ||
if (idx === -1) { | ||
parts.push(encoder(path.substring(lastIdx)).replace(/[#?]/, _encode)); | ||
parts.push(encoder(path.substring(lastIdx))); | ||
break; | ||
} | ||
parts.push(encoder(path.substring(lastIdx, idx)).replace(/[#?]/, _encode), URI._slash); | ||
parts.push(encoder(path.substring(lastIdx, idx)), URI._slash); | ||
lastIdx = idx + 1; | ||
@@ -569,24 +497,17 @@ } | ||
URI.revive = function (data) { | ||
var result = new URI(); | ||
result._scheme = data.scheme || URI._empty; | ||
result._authority = data.authority || URI._empty; | ||
result._path = data.path || URI._empty; | ||
result._query = data.query || URI._empty; | ||
result._fragment = data.fragment || URI._empty; | ||
var result = new URI(data.scheme, data.authority, data.path, data.query, data.fragment); | ||
result._fsPath = data.fsPath; | ||
result._formatted = data.external; | ||
URI._validate(result); | ||
return result; | ||
}; | ||
URI._empty = ''; | ||
URI._slash = '/'; | ||
URI._regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; | ||
URI._driveLetterPath = /^\/[a-zA-Z]:/; | ||
URI._upperCaseDrive = /^(\/)?([A-Z]:)/; | ||
URI._schemePattern = /^\w[\w\d+.-]*$/; | ||
URI._singleSlashStart = /^\//; | ||
URI._doubleSlashStart = /^\/\//; | ||
return URI; | ||
}(); | ||
URI._empty = ''; | ||
URI._slash = '/'; | ||
URI._regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; | ||
URI._driveLetterPath = /^\/[a-zA-z]:/; | ||
URI._upperCaseDrive = /^(\/)?([A-Z]:)/; | ||
URI._schemePattern = /^\w[\w\d+.-]*$/; | ||
URI._singleSlashStart = /^\//; | ||
URI._doubleSlashStart = /^\/\//; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = URI; | ||
@@ -599,9 +520,6 @@ }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
/***/ 92: | ||
/***/ 75: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(16)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, uri_1) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(4)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, uri_1) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -613,2 +531,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function stringify(obj) { | ||
@@ -638,8 +557,9 @@ return JSON.stringify(obj, replacer); | ||
} | ||
if (marshallingConst === 1) { | ||
return uri_1.default.revive(value); | ||
} else if (marshallingConst === 2) { | ||
return new RegExp(value.source, value.flags); | ||
} else { | ||
return value; | ||
switch (marshallingConst) { | ||
case 1: | ||
return uri_1.default.revive(value); | ||
case 2: | ||
return new RegExp(value.source, value.flags); | ||
default: | ||
return value; | ||
} | ||
@@ -646,0 +566,0 @@ } |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 94); | ||
/******/ return __webpack_require__(__webpack_require__.s = 77); | ||
/******/ }) | ||
@@ -74,11 +71,6 @@ /************************************************************************/ | ||
/***/ 1: | ||
/***/ 2: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -90,2 +82,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var _typeof = { | ||
@@ -105,3 +98,3 @@ number: 'number', | ||
} | ||
if (array && _typeof2(array.length) === _typeof.number && array.constructor === Array) { | ||
if (array && typeof array.length === _typeof.number && array.constructor === Array) { | ||
return true; | ||
@@ -116,3 +109,3 @@ } | ||
function isString(str) { | ||
if ((typeof str === "undefined" ? "undefined" : _typeof2(str)) === _typeof.string || str instanceof String) { | ||
if (typeof str === _typeof.string || str instanceof String) { | ||
return true; | ||
@@ -141,3 +134,3 @@ } | ||
// narrowing results in wrong results. | ||
return (typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.object && obj !== null && !Array.isArray(obj) && !(obj instanceof RegExp) && !(obj instanceof Date); | ||
return typeof obj === _typeof.object && obj !== null && !Array.isArray(obj) && !(obj instanceof RegExp) && !(obj instanceof Date); | ||
} | ||
@@ -150,3 +143,3 @@ exports.isObject = isObject; | ||
function isNumber(obj) { | ||
if (((typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.number || obj instanceof Number) && !isNaN(obj)) { | ||
if ((typeof obj === _typeof.number || obj instanceof Number) && !isNaN(obj)) { | ||
return true; | ||
@@ -168,3 +161,3 @@ } | ||
function isUndefined(obj) { | ||
return (typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.undefined; | ||
return typeof obj === _typeof.undefined; | ||
} | ||
@@ -199,3 +192,3 @@ exports.isUndefined = isUndefined; | ||
function isFunction(obj) { | ||
return (typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.function; | ||
return typeof obj === _typeof.function; | ||
} | ||
@@ -223,3 +216,3 @@ exports.isFunction = isFunction; | ||
if (isString(constraint)) { | ||
if ((typeof arg === "undefined" ? "undefined" : _typeof2(arg)) !== constraint) { | ||
if (typeof arg !== constraint) { | ||
throw new Error("argument does not match constraint: typeof " + constraint); | ||
@@ -261,17 +254,16 @@ } | ||
/***/ 94: | ||
/***/ 77: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
/*--------------------------------------------------------------------------------------------- | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(1)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, types) { | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(2)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, types) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function count(fromOrTo, toOrCallback, callback) { | ||
var from, to; | ||
var from; | ||
var to; | ||
if (types.isNumber(toOrCallback)) { | ||
@@ -302,3 +294,3 @@ from = fromOrTo; | ||
var result = []; | ||
var fn = function fn(i) { | ||
var fn = function (i) { | ||
return result.push(i); | ||
@@ -305,0 +297,0 @@ }; |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -73,197 +70,15 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/***/ 1: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
'use strict'; | ||
var _typeof = { | ||
number: 'number', | ||
string: 'string', | ||
undefined: 'undefined', | ||
object: 'object', | ||
function: 'function' | ||
}; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript Array or not. | ||
*/ | ||
function isArray(array) { | ||
if (Array.isArray) { | ||
return Array.isArray(array); | ||
} | ||
if (array && _typeof2(array.length) === _typeof.number && array.constructor === Array) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
exports.isArray = isArray; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript String or not. | ||
*/ | ||
function isString(str) { | ||
if ((typeof str === "undefined" ? "undefined" : _typeof2(str)) === _typeof.string || str instanceof String) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
exports.isString = isString; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript Array and each element in the array is a string. | ||
*/ | ||
function isStringArray(value) { | ||
return isArray(value) && value.every(function (elem) { | ||
return isString(elem); | ||
}); | ||
} | ||
exports.isStringArray = isStringArray; | ||
/** | ||
* | ||
* @returns whether the provided parameter is of type `object` but **not** | ||
* `null`, an `array`, a `regexp`, nor a `date`. | ||
*/ | ||
function isObject(obj) { | ||
// The method can't do a type cast since there are type (like strings) which | ||
// are subclasses of any put not positvely matched by the function. Hence type | ||
// narrowing results in wrong results. | ||
return (typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.object && obj !== null && !Array.isArray(obj) && !(obj instanceof RegExp) && !(obj instanceof Date); | ||
} | ||
exports.isObject = isObject; | ||
/** | ||
* In **contrast** to just checking `typeof` this will return `false` for `NaN`. | ||
* @returns whether the provided parameter is a JavaScript Number or not. | ||
*/ | ||
function isNumber(obj) { | ||
if (((typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.number || obj instanceof Number) && !isNaN(obj)) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
exports.isNumber = isNumber; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript Boolean or not. | ||
*/ | ||
function isBoolean(obj) { | ||
return obj === true || obj === false; | ||
} | ||
exports.isBoolean = isBoolean; | ||
/** | ||
* @returns whether the provided parameter is undefined. | ||
*/ | ||
function isUndefined(obj) { | ||
return (typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.undefined; | ||
} | ||
exports.isUndefined = isUndefined; | ||
/** | ||
* @returns whether the provided parameter is undefined or null. | ||
*/ | ||
function isUndefinedOrNull(obj) { | ||
return isUndefined(obj) || obj === null; | ||
} | ||
exports.isUndefinedOrNull = isUndefinedOrNull; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
/** | ||
* @returns whether the provided parameter is an empty JavaScript Object or not. | ||
*/ | ||
function isEmptyObject(obj) { | ||
if (!isObject(obj)) { | ||
return false; | ||
} | ||
for (var key in obj) { | ||
if (hasOwnProperty.call(obj, key)) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
exports.isEmptyObject = isEmptyObject; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript Function or not. | ||
*/ | ||
function isFunction(obj) { | ||
return (typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.function; | ||
} | ||
exports.isFunction = isFunction; | ||
/** | ||
* @returns whether the provided parameters is are JavaScript Function or not. | ||
*/ | ||
function areFunctions() { | ||
var objects = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
objects[_i] = arguments[_i]; | ||
} | ||
return objects && objects.length > 0 && objects.every(isFunction); | ||
} | ||
exports.areFunctions = areFunctions; | ||
function validateConstraints(args, constraints) { | ||
var len = Math.min(args.length, constraints.length); | ||
for (var i = 0; i < len; i++) { | ||
validateConstraint(args[i], constraints[i]); | ||
} | ||
} | ||
exports.validateConstraints = validateConstraints; | ||
function validateConstraint(arg, constraint) { | ||
if (isString(constraint)) { | ||
if ((typeof arg === "undefined" ? "undefined" : _typeof2(arg)) !== constraint) { | ||
throw new Error("argument does not match constraint: typeof " + constraint); | ||
} | ||
} else if (isFunction(constraint)) { | ||
if (arg instanceof constraint) { | ||
return; | ||
} | ||
if (arg && arg.constructor === constraint) { | ||
return; | ||
} | ||
if (constraint.length === 1 && constraint.call(undefined, arg) === true) { | ||
return; | ||
} | ||
throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true"); | ||
} | ||
} | ||
exports.validateConstraint = validateConstraint; | ||
/** | ||
* Creates a new object of the provided class and will call the constructor with | ||
* any additional argument supplied. | ||
*/ | ||
function create(ctor) { | ||
var args = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
var obj = Object.create(ctor.prototype); | ||
ctor.apply(obj, args); | ||
return obj; | ||
} | ||
exports.create = create; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
//# sourceMappingURL=types.js.map | ||
/***/ }), | ||
/***/ 15: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(1)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, Types) { | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(2)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, types_1) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function clone(obj) { | ||
if (!obj || (typeof obj === "undefined" ? "undefined" : _typeof(obj)) !== 'object') { | ||
if (!obj || typeof obj !== 'object') { | ||
return obj; | ||
@@ -277,3 +92,3 @@ } | ||
Object.keys(obj).forEach(function (key) { | ||
if (obj[key] && _typeof(obj[key]) === 'object') { | ||
if (obj[key] && typeof obj[key] === 'object') { | ||
result[key] = clone(obj[key]); | ||
@@ -288,3 +103,3 @@ } else { | ||
function deepClone(obj) { | ||
if (!obj || (typeof obj === "undefined" ? "undefined" : _typeof(obj)) !== 'object') { | ||
if (!obj || typeof obj !== 'object') { | ||
return obj; | ||
@@ -294,3 +109,3 @@ } | ||
Object.getOwnPropertyNames(obj).forEach(function (key) { | ||
if (obj[key] && _typeof(obj[key]) === 'object') { | ||
if (obj[key] && typeof obj[key] === 'object') { | ||
result[key] = deepClone(obj[key]); | ||
@@ -310,3 +125,3 @@ } else { | ||
function _cloneAndChange(obj, changer, encounteredObjects) { | ||
if (Types.isUndefinedOrNull(obj)) { | ||
if (types_1.isUndefinedOrNull(obj)) { | ||
return obj; | ||
@@ -318,3 +133,3 @@ } | ||
} | ||
if (Types.isArray(obj)) { | ||
if (types_1.isArray(obj)) { | ||
var r1 = []; | ||
@@ -326,3 +141,3 @@ for (var i1 = 0; i1 < obj.length; i1++) { | ||
} | ||
if (Types.isObject(obj)) { | ||
if (types_1.isObject(obj)) { | ||
if (encounteredObjects.indexOf(obj) >= 0) { | ||
@@ -343,34 +158,2 @@ throw new Error('Cannot clone recursive data-structure'); | ||
} | ||
// DON'T USE THESE FUNCTION UNLESS YOU KNOW HOW CHROME | ||
// WORKS... WE HAVE SEEN VERY WEIRD BEHAVIOUR WITH CHROME >= 37 | ||
///** | ||
// * Recursively call Object.freeze on object and any properties that are objects. | ||
// */ | ||
//export function deepFreeze(obj:any):void { | ||
// Object.freeze(obj); | ||
// Object.keys(obj).forEach((key) => { | ||
// if(!(typeof obj[key] === 'object') || Object.isFrozen(obj[key])) { | ||
// return; | ||
// } | ||
// | ||
// deepFreeze(obj[key]); | ||
// }); | ||
// if(!Object.isFrozen(obj)) { | ||
// console.log('too warm'); | ||
// } | ||
//} | ||
// | ||
//export function deepSeal(obj:any):void { | ||
// Object.seal(obj); | ||
// Object.keys(obj).forEach((key) => { | ||
// if(!(typeof obj[key] === 'object') || Object.isSealed(obj[key])) { | ||
// return; | ||
// } | ||
// | ||
// deepSeal(obj[key]); | ||
// }); | ||
// if(!Object.isSealed(obj)) { | ||
// console.log('NOT sealed'); | ||
// } | ||
//} | ||
/** | ||
@@ -384,10 +167,10 @@ * Copies all properties of source into destination. The optional parameter "overwrite" allows to control | ||
} | ||
if (!Types.isObject(destination)) { | ||
if (!types_1.isObject(destination)) { | ||
return source; | ||
} | ||
if (Types.isObject(source)) { | ||
if (types_1.isObject(source)) { | ||
Object.keys(source).forEach(function (key) { | ||
if (key in destination) { | ||
if (overwrite) { | ||
if (Types.isObject(destination[key]) && Types.isObject(source[key])) { | ||
if (types_1.isObject(destination[key]) && types_1.isObject(source[key])) { | ||
mixin(destination[key], source[key], overwrite); | ||
@@ -419,10 +202,5 @@ } else { | ||
exports.assign = assign; | ||
function toObject(arr, keyMap, valueMap) { | ||
if (valueMap === void 0) { | ||
valueMap = function valueMap(x) { | ||
return x; | ||
}; | ||
} | ||
function toObject(arr, keyMap) { | ||
return arr.reduce(function (o, d) { | ||
return assign(o, (_a = {}, _a[keyMap(d)] = valueMap(d), _a)); | ||
return assign(o, (_a = {}, _a[keyMap(d)] = d, _a)); | ||
var _a; | ||
@@ -439,6 +217,6 @@ }, Object.create(null)); | ||
} | ||
if ((typeof one === "undefined" ? "undefined" : _typeof(one)) !== (typeof other === "undefined" ? "undefined" : _typeof(other))) { | ||
if (typeof one !== typeof other) { | ||
return false; | ||
} | ||
if ((typeof one === "undefined" ? "undefined" : _typeof(one)) !== 'object') { | ||
if (typeof one !== 'object') { | ||
return false; | ||
@@ -449,3 +227,4 @@ } | ||
} | ||
var i, key; | ||
var i; | ||
var key; | ||
if (Array.isArray(one)) { | ||
@@ -555,3 +334,3 @@ if (one.length !== other.length) { | ||
return JSON.stringify(obj, function (key, value) { | ||
if (Types.isObject(value) || Array.isArray(value)) { | ||
if (types_1.isObject(value) || Array.isArray(value)) { | ||
if (seen.indexOf(value) !== -1) { | ||
@@ -575,2 +354,18 @@ return '[Circular]'; | ||
exports.getOrDefault = getOrDefault; | ||
function distinct(base, target) { | ||
var result = Object.create(null); | ||
if (!base || !target) { | ||
return result; | ||
} | ||
var targetKeys = Object.keys(target); | ||
targetKeys.forEach(function (k) { | ||
var baseValue = base[k]; | ||
var targetValue = target[k]; | ||
if (!equals(baseValue, targetValue)) { | ||
result[k] = targetValue; | ||
} | ||
}); | ||
return result; | ||
} | ||
exports.distinct = distinct; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
@@ -580,2 +375,176 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
/***/ }), | ||
/***/ 2: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var _typeof = { | ||
number: 'number', | ||
string: 'string', | ||
undefined: 'undefined', | ||
object: 'object', | ||
function: 'function' | ||
}; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript Array or not. | ||
*/ | ||
function isArray(array) { | ||
if (Array.isArray) { | ||
return Array.isArray(array); | ||
} | ||
if (array && typeof array.length === _typeof.number && array.constructor === Array) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
exports.isArray = isArray; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript String or not. | ||
*/ | ||
function isString(str) { | ||
if (typeof str === _typeof.string || str instanceof String) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
exports.isString = isString; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript Array and each element in the array is a string. | ||
*/ | ||
function isStringArray(value) { | ||
return isArray(value) && value.every(function (elem) { | ||
return isString(elem); | ||
}); | ||
} | ||
exports.isStringArray = isStringArray; | ||
/** | ||
* | ||
* @returns whether the provided parameter is of type `object` but **not** | ||
* `null`, an `array`, a `regexp`, nor a `date`. | ||
*/ | ||
function isObject(obj) { | ||
// The method can't do a type cast since there are type (like strings) which | ||
// are subclasses of any put not positvely matched by the function. Hence type | ||
// narrowing results in wrong results. | ||
return typeof obj === _typeof.object && obj !== null && !Array.isArray(obj) && !(obj instanceof RegExp) && !(obj instanceof Date); | ||
} | ||
exports.isObject = isObject; | ||
/** | ||
* In **contrast** to just checking `typeof` this will return `false` for `NaN`. | ||
* @returns whether the provided parameter is a JavaScript Number or not. | ||
*/ | ||
function isNumber(obj) { | ||
if ((typeof obj === _typeof.number || obj instanceof Number) && !isNaN(obj)) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
exports.isNumber = isNumber; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript Boolean or not. | ||
*/ | ||
function isBoolean(obj) { | ||
return obj === true || obj === false; | ||
} | ||
exports.isBoolean = isBoolean; | ||
/** | ||
* @returns whether the provided parameter is undefined. | ||
*/ | ||
function isUndefined(obj) { | ||
return typeof obj === _typeof.undefined; | ||
} | ||
exports.isUndefined = isUndefined; | ||
/** | ||
* @returns whether the provided parameter is undefined or null. | ||
*/ | ||
function isUndefinedOrNull(obj) { | ||
return isUndefined(obj) || obj === null; | ||
} | ||
exports.isUndefinedOrNull = isUndefinedOrNull; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
/** | ||
* @returns whether the provided parameter is an empty JavaScript Object or not. | ||
*/ | ||
function isEmptyObject(obj) { | ||
if (!isObject(obj)) { | ||
return false; | ||
} | ||
for (var key in obj) { | ||
if (hasOwnProperty.call(obj, key)) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
exports.isEmptyObject = isEmptyObject; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript Function or not. | ||
*/ | ||
function isFunction(obj) { | ||
return typeof obj === _typeof.function; | ||
} | ||
exports.isFunction = isFunction; | ||
/** | ||
* @returns whether the provided parameters is are JavaScript Function or not. | ||
*/ | ||
function areFunctions() { | ||
var objects = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
objects[_i] = arguments[_i]; | ||
} | ||
return objects && objects.length > 0 && objects.every(isFunction); | ||
} | ||
exports.areFunctions = areFunctions; | ||
function validateConstraints(args, constraints) { | ||
var len = Math.min(args.length, constraints.length); | ||
for (var i = 0; i < len; i++) { | ||
validateConstraint(args[i], constraints[i]); | ||
} | ||
} | ||
exports.validateConstraints = validateConstraints; | ||
function validateConstraint(arg, constraint) { | ||
if (isString(constraint)) { | ||
if (typeof arg !== constraint) { | ||
throw new Error("argument does not match constraint: typeof " + constraint); | ||
} | ||
} else if (isFunction(constraint)) { | ||
if (arg instanceof constraint) { | ||
return; | ||
} | ||
if (arg && arg.constructor === constraint) { | ||
return; | ||
} | ||
if (constraint.length === 1 && constraint.call(undefined, arg) === true) { | ||
return; | ||
} | ||
throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true"); | ||
} | ||
} | ||
exports.validateConstraint = validateConstraint; | ||
/** | ||
* Creates a new object of the provided class and will call the constructor with | ||
* any additional argument supplied. | ||
*/ | ||
function create(ctor) { | ||
var args = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
var obj = Object.create(ctor.prototype); | ||
ctor.apply(obj, args); | ||
return obj; | ||
} | ||
exports.create = create; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
//# sourceMappingURL=types.js.map | ||
/***/ }) | ||
@@ -582,0 +551,0 @@ |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 30); | ||
/******/ return __webpack_require__(__webpack_require__.s = 32); | ||
/******/ }) | ||
@@ -74,11 +71,6 @@ /************************************************************************/ | ||
/***/ 1: | ||
/***/ 2: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -90,2 +82,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var _typeof = { | ||
@@ -105,3 +98,3 @@ number: 'number', | ||
} | ||
if (array && _typeof2(array.length) === _typeof.number && array.constructor === Array) { | ||
if (array && typeof array.length === _typeof.number && array.constructor === Array) { | ||
return true; | ||
@@ -116,3 +109,3 @@ } | ||
function isString(str) { | ||
if ((typeof str === "undefined" ? "undefined" : _typeof2(str)) === _typeof.string || str instanceof String) { | ||
if (typeof str === _typeof.string || str instanceof String) { | ||
return true; | ||
@@ -141,3 +134,3 @@ } | ||
// narrowing results in wrong results. | ||
return (typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.object && obj !== null && !Array.isArray(obj) && !(obj instanceof RegExp) && !(obj instanceof Date); | ||
return typeof obj === _typeof.object && obj !== null && !Array.isArray(obj) && !(obj instanceof RegExp) && !(obj instanceof Date); | ||
} | ||
@@ -150,3 +143,3 @@ exports.isObject = isObject; | ||
function isNumber(obj) { | ||
if (((typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.number || obj instanceof Number) && !isNaN(obj)) { | ||
if ((typeof obj === _typeof.number || obj instanceof Number) && !isNaN(obj)) { | ||
return true; | ||
@@ -168,3 +161,3 @@ } | ||
function isUndefined(obj) { | ||
return (typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.undefined; | ||
return typeof obj === _typeof.undefined; | ||
} | ||
@@ -199,3 +192,3 @@ exports.isUndefined = isUndefined; | ||
function isFunction(obj) { | ||
return (typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.function; | ||
return typeof obj === _typeof.function; | ||
} | ||
@@ -223,3 +216,3 @@ exports.isFunction = isFunction; | ||
if (isString(constraint)) { | ||
if ((typeof arg === "undefined" ? "undefined" : _typeof2(arg)) !== constraint) { | ||
if (typeof arg !== constraint) { | ||
throw new Error("argument does not match constraint: typeof " + constraint); | ||
@@ -261,9 +254,6 @@ } | ||
/***/ 30: | ||
/***/ 32: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(1)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, Types) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(2)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, Types) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -275,2 +265,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ValidationState; | ||
@@ -284,3 +275,3 @@ (function (ValidationState) { | ||
})(ValidationState = exports.ValidationState || (exports.ValidationState = {})); | ||
var ValidationStatus = function () { | ||
var ValidationStatus = /** @class */function () { | ||
function ValidationStatus() { | ||
@@ -290,6 +281,6 @@ this._state = ValidationState.OK; | ||
Object.defineProperty(ValidationStatus.prototype, "state", { | ||
get: function get() { | ||
get: function () { | ||
return this._state; | ||
}, | ||
set: function set(value) { | ||
set: function (value) { | ||
if (value > this._state) { | ||
@@ -311,13 +302,27 @@ this._state = value; | ||
exports.ValidationStatus = ValidationStatus; | ||
var Parser = function () { | ||
function Parser(logger, validationStatus) { | ||
if (validationStatus === void 0) { | ||
validationStatus = new ValidationStatus(); | ||
} | ||
this._logger = logger; | ||
this.validationStatus = validationStatus; | ||
var NullProblemReporter = /** @class */function () { | ||
function NullProblemReporter() { | ||
this.status = new ValidationStatus(); | ||
} | ||
Object.defineProperty(Parser.prototype, "logger", { | ||
get: function get() { | ||
return this._logger; | ||
NullProblemReporter.prototype.info = function (message) {}; | ||
; | ||
NullProblemReporter.prototype.warn = function (message) {}; | ||
; | ||
NullProblemReporter.prototype.error = function (message) {}; | ||
; | ||
NullProblemReporter.prototype.fatal = function (message) {}; | ||
; | ||
return NullProblemReporter; | ||
}(); | ||
exports.NullProblemReporter = NullProblemReporter; | ||
var Parser = /** @class */function () { | ||
function Parser(problemReporter) { | ||
this._problemReporter = problemReporter; | ||
} | ||
Parser.prototype.reset = function () { | ||
this._problemReporter.status.state = ValidationState.OK; | ||
}; | ||
Object.defineProperty(Parser.prototype, "problemReporter", { | ||
get: function () { | ||
return this._problemReporter; | ||
}, | ||
@@ -327,19 +332,21 @@ enumerable: true, | ||
}); | ||
Object.defineProperty(Parser.prototype, "status", { | ||
get: function get() { | ||
return this.validationStatus; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Parser.prototype.log = function (message) { | ||
this._logger.log(message); | ||
Parser.prototype.info = function (message) { | ||
this._problemReporter.info(message); | ||
}; | ||
Parser.prototype.warn = function (message) { | ||
this._problemReporter.warn(message); | ||
}; | ||
Parser.prototype.error = function (message) { | ||
this._problemReporter.error(message); | ||
}; | ||
Parser.prototype.fatal = function (message) { | ||
this._problemReporter.fatal(message); | ||
}; | ||
Parser.prototype.is = function (value, func, wrongTypeState, wrongTypeMessage, undefinedState, undefinedMessage) { | ||
if (Types.isUndefined(value)) { | ||
if (undefinedState) { | ||
this.validationStatus.state = undefinedState; | ||
this._problemReporter.status.state = undefinedState; | ||
} | ||
if (undefinedMessage) { | ||
this.log(undefinedMessage); | ||
this._problemReporter.info(undefinedMessage); | ||
} | ||
@@ -350,6 +357,6 @@ return false; | ||
if (wrongTypeState) { | ||
this.validationStatus.state = wrongTypeState; | ||
this._problemReporter.status.state = wrongTypeState; | ||
} | ||
if (wrongTypeMessage) { | ||
this.log(wrongTypeMessage); | ||
this.info(wrongTypeMessage); | ||
} | ||
@@ -384,3 +391,3 @@ return false; | ||
exports.Parser = Parser; | ||
var AbstractSystemVariables = function () { | ||
var AbstractSystemVariables = /** @class */function () { | ||
function AbstractSystemVariables() {} | ||
@@ -387,0 +394,0 @@ AbstractSystemVariables.prototype.resolve = function (value) { |
@@ -11,3 +11,2 @@ export interface IProcessEnvironment { | ||
} | ||
export declare let _platform: Platform; | ||
export declare const isWindows: boolean; | ||
@@ -19,3 +18,2 @@ export declare const isMacintosh: boolean; | ||
export declare const isWeb: boolean; | ||
export declare const isQunit: boolean; | ||
export declare const platform: Platform; | ||
@@ -44,1 +42,15 @@ /** | ||
export declare const clearInterval: any; | ||
export declare const enum OperatingSystem { | ||
Windows = 1, | ||
Macintosh = 2, | ||
Linux = 3, | ||
} | ||
export declare const OS: OperatingSystem; | ||
export declare const enum AccessibilitySupport { | ||
/** | ||
* This should be the browser case where it is not known if a screen reader is attached or no. | ||
*/ | ||
Unknown = 0, | ||
Disabled = 1, | ||
Enabled = 2, | ||
} |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -75,8 +72,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -87,4 +79,5 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// --- THIS FILE IS TEMPORARY UNTIL ENV.TS IS CLEANED UP. IT CAN SAFELY BE USED IN ALL TARGET EXECUTION ENVIRONMENTS (node & dom) --- | ||
var _isWindows = false; | ||
@@ -96,3 +89,2 @@ var _isMacintosh = false; | ||
var _isWeb = false; | ||
var _isQunit = false; | ||
var _locale = undefined; | ||
@@ -102,3 +94,3 @@ var _language = undefined; | ||
// OS detection | ||
if ((typeof process === "undefined" ? "undefined" : _typeof(process)) === 'object') { | ||
if (typeof process === 'object') { | ||
_isWindows = process.platform === 'win32'; | ||
@@ -119,3 +111,3 @@ _isMacintosh = process.platform === 'darwin'; | ||
_isNative = true; | ||
} else if ((typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) === 'object') { | ||
} else if (typeof navigator === 'object') { | ||
var userAgent = navigator.userAgent; | ||
@@ -128,3 +120,2 @@ _isWindows = userAgent.indexOf('Windows') >= 0; | ||
_language = _locale; | ||
_isQunit = !!self.QUnit; | ||
} | ||
@@ -138,10 +129,10 @@ var Platform; | ||
})(Platform = exports.Platform || (exports.Platform = {})); | ||
exports._platform = Platform.Web; | ||
var _platform = Platform.Web; | ||
if (_isNative) { | ||
if (_isMacintosh) { | ||
exports._platform = Platform.Mac; | ||
_platform = Platform.Mac; | ||
} else if (_isWindows) { | ||
exports._platform = Platform.Windows; | ||
_platform = Platform.Windows; | ||
} else if (_isLinux) { | ||
exports._platform = Platform.Linux; | ||
_platform = Platform.Linux; | ||
} | ||
@@ -155,4 +146,3 @@ } | ||
exports.isWeb = _isWeb; | ||
exports.isQunit = _isQunit; | ||
exports.platform = exports._platform; | ||
exports.platform = _platform; | ||
/** | ||
@@ -170,3 +160,3 @@ * The language used for the user interface. The format of | ||
exports.locale = _locale; | ||
var _globals = (typeof self === "undefined" ? "undefined" : _typeof(self)) === 'object' ? self : global; | ||
var _globals = typeof self === 'object' ? self : global; | ||
exports.globals = _globals; | ||
@@ -181,2 +171,18 @@ function hasWebWorkerSupport() { | ||
exports.clearInterval = _globals.clearInterval.bind(_globals); | ||
var OperatingSystem; | ||
(function (OperatingSystem) { | ||
OperatingSystem[OperatingSystem["Windows"] = 1] = "Windows"; | ||
OperatingSystem[OperatingSystem["Macintosh"] = 2] = "Macintosh"; | ||
OperatingSystem[OperatingSystem["Linux"] = 3] = "Linux"; | ||
})(OperatingSystem = exports.OperatingSystem || (exports.OperatingSystem = {})); | ||
exports.OS = _isMacintosh ? 2 /* Macintosh */ : _isWindows ? 1 /* Windows */ : 3 /* Linux */; | ||
var AccessibilitySupport; | ||
(function (AccessibilitySupport) { | ||
/** | ||
* This should be the browser case where it is not known if a screen reader is attached or no. | ||
*/ | ||
AccessibilitySupport[AccessibilitySupport["Unknown"] = 0] = "Unknown"; | ||
AccessibilitySupport[AccessibilitySupport["Disabled"] = 1] = "Disabled"; | ||
AccessibilitySupport[AccessibilitySupport["Enabled"] = 2] = "Enabled"; | ||
})(AccessibilitySupport = exports.AccessibilitySupport || (exports.AccessibilitySupport = {})); | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
@@ -183,0 +189,0 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 44); | ||
/******/ return __webpack_require__(__webpack_require__.s = 43); | ||
/******/ }) | ||
@@ -77,8 +74,3 @@ /************************************************************************/ | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -89,4 +81,5 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// --- THIS FILE IS TEMPORARY UNTIL ENV.TS IS CLEANED UP. IT CAN SAFELY BE USED IN ALL TARGET EXECUTION ENVIRONMENTS (node & dom) --- | ||
var _isWindows = false; | ||
@@ -98,3 +91,2 @@ var _isMacintosh = false; | ||
var _isWeb = false; | ||
var _isQunit = false; | ||
var _locale = undefined; | ||
@@ -104,3 +96,3 @@ var _language = undefined; | ||
// OS detection | ||
if ((typeof process === "undefined" ? "undefined" : _typeof(process)) === 'object') { | ||
if (typeof process === 'object') { | ||
_isWindows = process.platform === 'win32'; | ||
@@ -121,3 +113,3 @@ _isMacintosh = process.platform === 'darwin'; | ||
_isNative = true; | ||
} else if ((typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) === 'object') { | ||
} else if (typeof navigator === 'object') { | ||
var userAgent = navigator.userAgent; | ||
@@ -130,3 +122,2 @@ _isWindows = userAgent.indexOf('Windows') >= 0; | ||
_language = _locale; | ||
_isQunit = !!self.QUnit; | ||
} | ||
@@ -140,10 +131,10 @@ var Platform; | ||
})(Platform = exports.Platform || (exports.Platform = {})); | ||
exports._platform = Platform.Web; | ||
var _platform = Platform.Web; | ||
if (_isNative) { | ||
if (_isMacintosh) { | ||
exports._platform = Platform.Mac; | ||
_platform = Platform.Mac; | ||
} else if (_isWindows) { | ||
exports._platform = Platform.Windows; | ||
_platform = Platform.Windows; | ||
} else if (_isLinux) { | ||
exports._platform = Platform.Linux; | ||
_platform = Platform.Linux; | ||
} | ||
@@ -157,4 +148,3 @@ } | ||
exports.isWeb = _isWeb; | ||
exports.isQunit = _isQunit; | ||
exports.platform = exports._platform; | ||
exports.platform = _platform; | ||
/** | ||
@@ -172,3 +162,3 @@ * The language used for the user interface. The format of | ||
exports.locale = _locale; | ||
var _globals = (typeof self === "undefined" ? "undefined" : _typeof(self)) === 'object' ? self : global; | ||
var _globals = typeof self === 'object' ? self : global; | ||
exports.globals = _globals; | ||
@@ -183,2 +173,18 @@ function hasWebWorkerSupport() { | ||
exports.clearInterval = _globals.clearInterval.bind(_globals); | ||
var OperatingSystem; | ||
(function (OperatingSystem) { | ||
OperatingSystem[OperatingSystem["Windows"] = 1] = "Windows"; | ||
OperatingSystem[OperatingSystem["Macintosh"] = 2] = "Macintosh"; | ||
OperatingSystem[OperatingSystem["Linux"] = 3] = "Linux"; | ||
})(OperatingSystem = exports.OperatingSystem || (exports.OperatingSystem = {})); | ||
exports.OS = _isMacintosh ? 2 /* Macintosh */ : _isWindows ? 1 /* Windows */ : 3 /* Linux */; | ||
var AccessibilitySupport; | ||
(function (AccessibilitySupport) { | ||
/** | ||
* This should be the browser case where it is not known if a screen reader is attached or no. | ||
*/ | ||
AccessibilitySupport[AccessibilitySupport["Unknown"] = 0] = "Unknown"; | ||
AccessibilitySupport[AccessibilitySupport["Disabled"] = 1] = "Disabled"; | ||
AccessibilitySupport[AccessibilitySupport["Enabled"] = 2] = "Enabled"; | ||
})(AccessibilitySupport = exports.AccessibilitySupport || (exports.AccessibilitySupport = {})); | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
@@ -190,197 +196,15 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
/***/ 1: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
'use strict'; | ||
var _typeof = { | ||
number: 'number', | ||
string: 'string', | ||
undefined: 'undefined', | ||
object: 'object', | ||
function: 'function' | ||
}; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript Array or not. | ||
*/ | ||
function isArray(array) { | ||
if (Array.isArray) { | ||
return Array.isArray(array); | ||
} | ||
if (array && _typeof2(array.length) === _typeof.number && array.constructor === Array) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
exports.isArray = isArray; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript String or not. | ||
*/ | ||
function isString(str) { | ||
if ((typeof str === "undefined" ? "undefined" : _typeof2(str)) === _typeof.string || str instanceof String) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
exports.isString = isString; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript Array and each element in the array is a string. | ||
*/ | ||
function isStringArray(value) { | ||
return isArray(value) && value.every(function (elem) { | ||
return isString(elem); | ||
}); | ||
} | ||
exports.isStringArray = isStringArray; | ||
/** | ||
* | ||
* @returns whether the provided parameter is of type `object` but **not** | ||
* `null`, an `array`, a `regexp`, nor a `date`. | ||
*/ | ||
function isObject(obj) { | ||
// The method can't do a type cast since there are type (like strings) which | ||
// are subclasses of any put not positvely matched by the function. Hence type | ||
// narrowing results in wrong results. | ||
return (typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.object && obj !== null && !Array.isArray(obj) && !(obj instanceof RegExp) && !(obj instanceof Date); | ||
} | ||
exports.isObject = isObject; | ||
/** | ||
* In **contrast** to just checking `typeof` this will return `false` for `NaN`. | ||
* @returns whether the provided parameter is a JavaScript Number or not. | ||
*/ | ||
function isNumber(obj) { | ||
if (((typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.number || obj instanceof Number) && !isNaN(obj)) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
exports.isNumber = isNumber; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript Boolean or not. | ||
*/ | ||
function isBoolean(obj) { | ||
return obj === true || obj === false; | ||
} | ||
exports.isBoolean = isBoolean; | ||
/** | ||
* @returns whether the provided parameter is undefined. | ||
*/ | ||
function isUndefined(obj) { | ||
return (typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.undefined; | ||
} | ||
exports.isUndefined = isUndefined; | ||
/** | ||
* @returns whether the provided parameter is undefined or null. | ||
*/ | ||
function isUndefinedOrNull(obj) { | ||
return isUndefined(obj) || obj === null; | ||
} | ||
exports.isUndefinedOrNull = isUndefinedOrNull; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
/** | ||
* @returns whether the provided parameter is an empty JavaScript Object or not. | ||
*/ | ||
function isEmptyObject(obj) { | ||
if (!isObject(obj)) { | ||
return false; | ||
} | ||
for (var key in obj) { | ||
if (hasOwnProperty.call(obj, key)) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
exports.isEmptyObject = isEmptyObject; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript Function or not. | ||
*/ | ||
function isFunction(obj) { | ||
return (typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.function; | ||
} | ||
exports.isFunction = isFunction; | ||
/** | ||
* @returns whether the provided parameters is are JavaScript Function or not. | ||
*/ | ||
function areFunctions() { | ||
var objects = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
objects[_i] = arguments[_i]; | ||
} | ||
return objects && objects.length > 0 && objects.every(isFunction); | ||
} | ||
exports.areFunctions = areFunctions; | ||
function validateConstraints(args, constraints) { | ||
var len = Math.min(args.length, constraints.length); | ||
for (var i = 0; i < len; i++) { | ||
validateConstraint(args[i], constraints[i]); | ||
} | ||
} | ||
exports.validateConstraints = validateConstraints; | ||
function validateConstraint(arg, constraint) { | ||
if (isString(constraint)) { | ||
if ((typeof arg === "undefined" ? "undefined" : _typeof2(arg)) !== constraint) { | ||
throw new Error("argument does not match constraint: typeof " + constraint); | ||
} | ||
} else if (isFunction(constraint)) { | ||
if (arg instanceof constraint) { | ||
return; | ||
} | ||
if (arg && arg.constructor === constraint) { | ||
return; | ||
} | ||
if (constraint.length === 1 && constraint.call(undefined, arg) === true) { | ||
return; | ||
} | ||
throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true"); | ||
} | ||
} | ||
exports.validateConstraint = validateConstraint; | ||
/** | ||
* Creates a new object of the provided class and will call the constructor with | ||
* any additional argument supplied. | ||
*/ | ||
function create(ctor) { | ||
var args = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
var obj = Object.create(ctor.prototype); | ||
ctor.apply(obj, args); | ||
return obj; | ||
} | ||
exports.create = create; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
//# sourceMappingURL=types.js.map | ||
/***/ }), | ||
/***/ 15: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(1)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, Types) { | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(2)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, types_1) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function clone(obj) { | ||
if (!obj || (typeof obj === "undefined" ? "undefined" : _typeof(obj)) !== 'object') { | ||
if (!obj || typeof obj !== 'object') { | ||
return obj; | ||
@@ -394,3 +218,3 @@ } | ||
Object.keys(obj).forEach(function (key) { | ||
if (obj[key] && _typeof(obj[key]) === 'object') { | ||
if (obj[key] && typeof obj[key] === 'object') { | ||
result[key] = clone(obj[key]); | ||
@@ -405,3 +229,3 @@ } else { | ||
function deepClone(obj) { | ||
if (!obj || (typeof obj === "undefined" ? "undefined" : _typeof(obj)) !== 'object') { | ||
if (!obj || typeof obj !== 'object') { | ||
return obj; | ||
@@ -411,3 +235,3 @@ } | ||
Object.getOwnPropertyNames(obj).forEach(function (key) { | ||
if (obj[key] && _typeof(obj[key]) === 'object') { | ||
if (obj[key] && typeof obj[key] === 'object') { | ||
result[key] = deepClone(obj[key]); | ||
@@ -427,3 +251,3 @@ } else { | ||
function _cloneAndChange(obj, changer, encounteredObjects) { | ||
if (Types.isUndefinedOrNull(obj)) { | ||
if (types_1.isUndefinedOrNull(obj)) { | ||
return obj; | ||
@@ -435,3 +259,3 @@ } | ||
} | ||
if (Types.isArray(obj)) { | ||
if (types_1.isArray(obj)) { | ||
var r1 = []; | ||
@@ -443,3 +267,3 @@ for (var i1 = 0; i1 < obj.length; i1++) { | ||
} | ||
if (Types.isObject(obj)) { | ||
if (types_1.isObject(obj)) { | ||
if (encounteredObjects.indexOf(obj) >= 0) { | ||
@@ -460,34 +284,2 @@ throw new Error('Cannot clone recursive data-structure'); | ||
} | ||
// DON'T USE THESE FUNCTION UNLESS YOU KNOW HOW CHROME | ||
// WORKS... WE HAVE SEEN VERY WEIRD BEHAVIOUR WITH CHROME >= 37 | ||
///** | ||
// * Recursively call Object.freeze on object and any properties that are objects. | ||
// */ | ||
//export function deepFreeze(obj:any):void { | ||
// Object.freeze(obj); | ||
// Object.keys(obj).forEach((key) => { | ||
// if(!(typeof obj[key] === 'object') || Object.isFrozen(obj[key])) { | ||
// return; | ||
// } | ||
// | ||
// deepFreeze(obj[key]); | ||
// }); | ||
// if(!Object.isFrozen(obj)) { | ||
// console.log('too warm'); | ||
// } | ||
//} | ||
// | ||
//export function deepSeal(obj:any):void { | ||
// Object.seal(obj); | ||
// Object.keys(obj).forEach((key) => { | ||
// if(!(typeof obj[key] === 'object') || Object.isSealed(obj[key])) { | ||
// return; | ||
// } | ||
// | ||
// deepSeal(obj[key]); | ||
// }); | ||
// if(!Object.isSealed(obj)) { | ||
// console.log('NOT sealed'); | ||
// } | ||
//} | ||
/** | ||
@@ -501,10 +293,10 @@ * Copies all properties of source into destination. The optional parameter "overwrite" allows to control | ||
} | ||
if (!Types.isObject(destination)) { | ||
if (!types_1.isObject(destination)) { | ||
return source; | ||
} | ||
if (Types.isObject(source)) { | ||
if (types_1.isObject(source)) { | ||
Object.keys(source).forEach(function (key) { | ||
if (key in destination) { | ||
if (overwrite) { | ||
if (Types.isObject(destination[key]) && Types.isObject(source[key])) { | ||
if (types_1.isObject(destination[key]) && types_1.isObject(source[key])) { | ||
mixin(destination[key], source[key], overwrite); | ||
@@ -536,10 +328,5 @@ } else { | ||
exports.assign = assign; | ||
function toObject(arr, keyMap, valueMap) { | ||
if (valueMap === void 0) { | ||
valueMap = function valueMap(x) { | ||
return x; | ||
}; | ||
} | ||
function toObject(arr, keyMap) { | ||
return arr.reduce(function (o, d) { | ||
return assign(o, (_a = {}, _a[keyMap(d)] = valueMap(d), _a)); | ||
return assign(o, (_a = {}, _a[keyMap(d)] = d, _a)); | ||
var _a; | ||
@@ -556,6 +343,6 @@ }, Object.create(null)); | ||
} | ||
if ((typeof one === "undefined" ? "undefined" : _typeof(one)) !== (typeof other === "undefined" ? "undefined" : _typeof(other))) { | ||
if (typeof one !== typeof other) { | ||
return false; | ||
} | ||
if ((typeof one === "undefined" ? "undefined" : _typeof(one)) !== 'object') { | ||
if (typeof one !== 'object') { | ||
return false; | ||
@@ -566,3 +353,4 @@ } | ||
} | ||
var i, key; | ||
var i; | ||
var key; | ||
if (Array.isArray(one)) { | ||
@@ -672,3 +460,3 @@ if (one.length !== other.length) { | ||
return JSON.stringify(obj, function (key, value) { | ||
if (Types.isObject(value) || Array.isArray(value)) { | ||
if (types_1.isObject(value) || Array.isArray(value)) { | ||
if (seen.indexOf(value) !== -1) { | ||
@@ -692,2 +480,18 @@ return '[Circular]'; | ||
exports.getOrDefault = getOrDefault; | ||
function distinct(base, target) { | ||
var result = Object.create(null); | ||
if (!base || !target) { | ||
return result; | ||
} | ||
var targetKeys = Object.keys(target); | ||
targetKeys.forEach(function (k) { | ||
var baseValue = base[k]; | ||
var targetValue = target[k]; | ||
if (!equals(baseValue, targetValue)) { | ||
result[k] = targetValue; | ||
} | ||
}); | ||
return result; | ||
} | ||
exports.distinct = distinct; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
@@ -699,9 +503,139 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
/***/ 30: | ||
/***/ 16: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
/*--------------------------------------------------------------------------------------------- | ||
*--------------------------------------------------------------------------------------------- | ||
*--------------------------------------------------------------------------------------------- | ||
*--------------------------------------------------------------------------------------------- | ||
*--------------------------------------------------------------------------------------------- | ||
* Please make sure to make edits in the .ts file at https://github.com/Microsoft/vscode-loader/ | ||
*--------------------------------------------------------------------------------------------- | ||
*--------------------------------------------------------------------------------------------- | ||
*--------------------------------------------------------------------------------------------- | ||
*--------------------------------------------------------------------------------------------- | ||
*--------------------------------------------------------------------------------------------*/ | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(1)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, Types) { | ||
var NLSLoaderPlugin; | ||
(function (NLSLoaderPlugin) { | ||
var Environment = function () { | ||
function Environment(isPseudo) { | ||
this.isPseudo = isPseudo; | ||
// | ||
} | ||
Environment.detect = function () { | ||
var isPseudo = typeof document !== 'undefined' && document.location && document.location.hash.indexOf('pseudo=true') >= 0; | ||
return new Environment(isPseudo); | ||
}; | ||
return Environment; | ||
}(); | ||
function _format(message, args, env) { | ||
var result; | ||
if (args.length === 0) { | ||
result = message; | ||
} else { | ||
result = message.replace(/\{(\d+)\}/g, function (match, rest) { | ||
var index = rest[0]; | ||
return typeof args[index] !== 'undefined' ? args[index] : match; | ||
}); | ||
} | ||
if (env.isPseudo) { | ||
// FF3B and FF3D is the Unicode zenkaku representation for [ and ] | ||
result = '\uFF3B' + result.replace(/[aouei]/g, '$&$&') + '\uFF3D'; | ||
} | ||
return result; | ||
} | ||
function findLanguageForModule(config, name) { | ||
var result = config[name]; | ||
if (result) return result; | ||
result = config['*']; | ||
if (result) return result; | ||
return null; | ||
} | ||
function localize(env, data, message) { | ||
var args = []; | ||
for (var _i = 3; _i < arguments.length; _i++) { | ||
args[_i - 3] = arguments[_i]; | ||
} | ||
return _format(message, args, env); | ||
} | ||
function createScopedLocalize(scope, env) { | ||
return function (idx, defaultValue) { | ||
var restArgs = Array.prototype.slice.call(arguments, 2); | ||
return _format(scope[idx], restArgs, env); | ||
}; | ||
} | ||
var NLSPlugin = function () { | ||
function NLSPlugin(env) { | ||
var _this = this; | ||
this._env = env; | ||
this.localize = function (data, message) { | ||
var args = []; | ||
for (var _i = 2; _i < arguments.length; _i++) { | ||
args[_i - 2] = arguments[_i]; | ||
} | ||
return localize.apply(void 0, [_this._env, data, message].concat(args)); | ||
}; | ||
} | ||
NLSPlugin.prototype.setPseudoTranslation = function (value) { | ||
this._env = new Environment(value); | ||
}; | ||
NLSPlugin.prototype.create = function (key, data) { | ||
return { | ||
localize: createScopedLocalize(data[key], this._env) | ||
}; | ||
}; | ||
NLSPlugin.prototype.load = function (name, req, load, config) { | ||
var _this = this; | ||
config = config || {}; | ||
if (!name || name.length === 0) { | ||
load({ | ||
localize: this.localize | ||
}); | ||
} else { | ||
var pluginConfig = config['vs/nls'] || {}; | ||
var language = pluginConfig.availableLanguages ? findLanguageForModule(pluginConfig.availableLanguages, name) : null; | ||
var suffix = '.nls'; | ||
if (language !== null && language !== NLSPlugin.DEFAULT_TAG) { | ||
suffix = suffix + '.' + language; | ||
} | ||
req([name + suffix], function (messages) { | ||
if (Array.isArray(messages)) { | ||
messages.localize = createScopedLocalize(messages, _this._env); | ||
} else { | ||
messages.localize = createScopedLocalize(messages[name], _this._env); | ||
} | ||
load(messages); | ||
}); | ||
} | ||
}; | ||
return NLSPlugin; | ||
}(); | ||
NLSPlugin.DEFAULT_TAG = 'i-default'; | ||
NLSLoaderPlugin.NLSPlugin = NLSPlugin; | ||
function init() { | ||
!(__WEBPACK_AMD_DEFINE_FACTORY__ = (new NLSPlugin(Environment.detect())), | ||
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? | ||
(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : | ||
__WEBPACK_AMD_DEFINE_FACTORY__), | ||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
} | ||
NLSLoaderPlugin.init = init; | ||
if (typeof doNotInitLoader === 'undefined') { | ||
init(); | ||
} | ||
})(NLSLoaderPlugin || (NLSLoaderPlugin = {})); | ||
/***/ }), | ||
/***/ 2: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -713,2 +647,177 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var _typeof = { | ||
number: 'number', | ||
string: 'string', | ||
undefined: 'undefined', | ||
object: 'object', | ||
function: 'function' | ||
}; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript Array or not. | ||
*/ | ||
function isArray(array) { | ||
if (Array.isArray) { | ||
return Array.isArray(array); | ||
} | ||
if (array && typeof array.length === _typeof.number && array.constructor === Array) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
exports.isArray = isArray; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript String or not. | ||
*/ | ||
function isString(str) { | ||
if (typeof str === _typeof.string || str instanceof String) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
exports.isString = isString; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript Array and each element in the array is a string. | ||
*/ | ||
function isStringArray(value) { | ||
return isArray(value) && value.every(function (elem) { | ||
return isString(elem); | ||
}); | ||
} | ||
exports.isStringArray = isStringArray; | ||
/** | ||
* | ||
* @returns whether the provided parameter is of type `object` but **not** | ||
* `null`, an `array`, a `regexp`, nor a `date`. | ||
*/ | ||
function isObject(obj) { | ||
// The method can't do a type cast since there are type (like strings) which | ||
// are subclasses of any put not positvely matched by the function. Hence type | ||
// narrowing results in wrong results. | ||
return typeof obj === _typeof.object && obj !== null && !Array.isArray(obj) && !(obj instanceof RegExp) && !(obj instanceof Date); | ||
} | ||
exports.isObject = isObject; | ||
/** | ||
* In **contrast** to just checking `typeof` this will return `false` for `NaN`. | ||
* @returns whether the provided parameter is a JavaScript Number or not. | ||
*/ | ||
function isNumber(obj) { | ||
if ((typeof obj === _typeof.number || obj instanceof Number) && !isNaN(obj)) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
exports.isNumber = isNumber; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript Boolean or not. | ||
*/ | ||
function isBoolean(obj) { | ||
return obj === true || obj === false; | ||
} | ||
exports.isBoolean = isBoolean; | ||
/** | ||
* @returns whether the provided parameter is undefined. | ||
*/ | ||
function isUndefined(obj) { | ||
return typeof obj === _typeof.undefined; | ||
} | ||
exports.isUndefined = isUndefined; | ||
/** | ||
* @returns whether the provided parameter is undefined or null. | ||
*/ | ||
function isUndefinedOrNull(obj) { | ||
return isUndefined(obj) || obj === null; | ||
} | ||
exports.isUndefinedOrNull = isUndefinedOrNull; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
/** | ||
* @returns whether the provided parameter is an empty JavaScript Object or not. | ||
*/ | ||
function isEmptyObject(obj) { | ||
if (!isObject(obj)) { | ||
return false; | ||
} | ||
for (var key in obj) { | ||
if (hasOwnProperty.call(obj, key)) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
exports.isEmptyObject = isEmptyObject; | ||
/** | ||
* @returns whether the provided parameter is a JavaScript Function or not. | ||
*/ | ||
function isFunction(obj) { | ||
return typeof obj === _typeof.function; | ||
} | ||
exports.isFunction = isFunction; | ||
/** | ||
* @returns whether the provided parameters is are JavaScript Function or not. | ||
*/ | ||
function areFunctions() { | ||
var objects = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
objects[_i] = arguments[_i]; | ||
} | ||
return objects && objects.length > 0 && objects.every(isFunction); | ||
} | ||
exports.areFunctions = areFunctions; | ||
function validateConstraints(args, constraints) { | ||
var len = Math.min(args.length, constraints.length); | ||
for (var i = 0; i < len; i++) { | ||
validateConstraint(args[i], constraints[i]); | ||
} | ||
} | ||
exports.validateConstraints = validateConstraints; | ||
function validateConstraint(arg, constraint) { | ||
if (isString(constraint)) { | ||
if (typeof arg !== constraint) { | ||
throw new Error("argument does not match constraint: typeof " + constraint); | ||
} | ||
} else if (isFunction(constraint)) { | ||
if (arg instanceof constraint) { | ||
return; | ||
} | ||
if (arg && arg.constructor === constraint) { | ||
return; | ||
} | ||
if (constraint.length === 1 && constraint.call(undefined, arg) === true) { | ||
return; | ||
} | ||
throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true"); | ||
} | ||
} | ||
exports.validateConstraint = validateConstraint; | ||
/** | ||
* Creates a new object of the provided class and will call the constructor with | ||
* any additional argument supplied. | ||
*/ | ||
function create(ctor) { | ||
var args = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
var obj = Object.create(ctor.prototype); | ||
ctor.apply(obj, args); | ||
return obj; | ||
} | ||
exports.create = create; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
//# sourceMappingURL=types.js.map | ||
/***/ }), | ||
/***/ 32: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(2)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, Types) { | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ValidationState; | ||
@@ -722,3 +831,3 @@ (function (ValidationState) { | ||
})(ValidationState = exports.ValidationState || (exports.ValidationState = {})); | ||
var ValidationStatus = function () { | ||
var ValidationStatus = /** @class */function () { | ||
function ValidationStatus() { | ||
@@ -728,6 +837,6 @@ this._state = ValidationState.OK; | ||
Object.defineProperty(ValidationStatus.prototype, "state", { | ||
get: function get() { | ||
get: function () { | ||
return this._state; | ||
}, | ||
set: function set(value) { | ||
set: function (value) { | ||
if (value > this._state) { | ||
@@ -749,13 +858,27 @@ this._state = value; | ||
exports.ValidationStatus = ValidationStatus; | ||
var Parser = function () { | ||
function Parser(logger, validationStatus) { | ||
if (validationStatus === void 0) { | ||
validationStatus = new ValidationStatus(); | ||
} | ||
this._logger = logger; | ||
this.validationStatus = validationStatus; | ||
var NullProblemReporter = /** @class */function () { | ||
function NullProblemReporter() { | ||
this.status = new ValidationStatus(); | ||
} | ||
Object.defineProperty(Parser.prototype, "logger", { | ||
get: function get() { | ||
return this._logger; | ||
NullProblemReporter.prototype.info = function (message) {}; | ||
; | ||
NullProblemReporter.prototype.warn = function (message) {}; | ||
; | ||
NullProblemReporter.prototype.error = function (message) {}; | ||
; | ||
NullProblemReporter.prototype.fatal = function (message) {}; | ||
; | ||
return NullProblemReporter; | ||
}(); | ||
exports.NullProblemReporter = NullProblemReporter; | ||
var Parser = /** @class */function () { | ||
function Parser(problemReporter) { | ||
this._problemReporter = problemReporter; | ||
} | ||
Parser.prototype.reset = function () { | ||
this._problemReporter.status.state = ValidationState.OK; | ||
}; | ||
Object.defineProperty(Parser.prototype, "problemReporter", { | ||
get: function () { | ||
return this._problemReporter; | ||
}, | ||
@@ -765,19 +888,21 @@ enumerable: true, | ||
}); | ||
Object.defineProperty(Parser.prototype, "status", { | ||
get: function get() { | ||
return this.validationStatus; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Parser.prototype.log = function (message) { | ||
this._logger.log(message); | ||
Parser.prototype.info = function (message) { | ||
this._problemReporter.info(message); | ||
}; | ||
Parser.prototype.warn = function (message) { | ||
this._problemReporter.warn(message); | ||
}; | ||
Parser.prototype.error = function (message) { | ||
this._problemReporter.error(message); | ||
}; | ||
Parser.prototype.fatal = function (message) { | ||
this._problemReporter.fatal(message); | ||
}; | ||
Parser.prototype.is = function (value, func, wrongTypeState, wrongTypeMessage, undefinedState, undefinedMessage) { | ||
if (Types.isUndefined(value)) { | ||
if (undefinedState) { | ||
this.validationStatus.state = undefinedState; | ||
this._problemReporter.status.state = undefinedState; | ||
} | ||
if (undefinedMessage) { | ||
this.log(undefinedMessage); | ||
this._problemReporter.info(undefinedMessage); | ||
} | ||
@@ -788,6 +913,6 @@ return false; | ||
if (wrongTypeState) { | ||
this.validationStatus.state = wrongTypeState; | ||
this._problemReporter.status.state = wrongTypeState; | ||
} | ||
if (wrongTypeMessage) { | ||
this.log(wrongTypeMessage); | ||
this.info(wrongTypeMessage); | ||
} | ||
@@ -822,3 +947,3 @@ return false; | ||
exports.Parser = Parser; | ||
var AbstractSystemVariables = function () { | ||
var AbstractSystemVariables = /** @class */function () { | ||
function AbstractSystemVariables() {} | ||
@@ -896,17 +1021,20 @@ AbstractSystemVariables.prototype.resolve = function (value) { | ||
/***/ 44: | ||
/***/ 43: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var __extends = undefined && undefined.__extends || function (d, b) { | ||
for (var p in b) { | ||
if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
}function __() { | ||
this.constructor = d; | ||
} | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, !(function webpackMissingModule() { var e = new Error("Cannot find module \"vs/nls!vs/base/common/processes\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()), __webpack_require__(15), __webpack_require__(0), __webpack_require__(1), __webpack_require__(30)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, NLS, Objects, Platform, Types, parsers_1) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = this && this.__extends || function () { | ||
var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { | ||
d.__proto__ = b; | ||
} || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { | ||
this.constructor = d; | ||
} | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
}(); | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(16), __webpack_require__(15), __webpack_require__(0), __webpack_require__(2), __webpack_require__(32)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, NLS, Objects, Platform, Types, parsers_1) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -918,2 +1046,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var Source; | ||
@@ -931,9 +1060,6 @@ (function (Source) { | ||
})(TerminateResponseCode = exports.TerminateResponseCode || (exports.TerminateResponseCode = {})); | ||
var ExecutableParser = function (_super) { | ||
var ExecutableParser = /** @class */function (_super) { | ||
__extends(ExecutableParser, _super); | ||
function ExecutableParser(logger, validationStatus) { | ||
if (validationStatus === void 0) { | ||
validationStatus = new parsers_1.ValidationStatus(); | ||
} | ||
return _super.call(this, logger, validationStatus) || this; | ||
function ExecutableParser(logger) { | ||
return _super.call(this, logger) || this; | ||
} | ||
@@ -945,3 +1071,3 @@ ExecutableParser.prototype.parse = function (json, parserOptions) { | ||
var result = this.parseExecutable(json, parserOptions.globals); | ||
if (this.status.isFatal()) { | ||
if (this.problemReporter.status.isFatal()) { | ||
return result; | ||
@@ -961,4 +1087,3 @@ } | ||
if ((!result || !result.command) && !parserOptions.emptyCommand) { | ||
this.status.state = parsers_1.ValidationState.Fatal; | ||
this.log(NLS.localize(0, null)); | ||
this.fatal(NLS.localize('ExecutableParser.commandMissing', 'Error: executable info must define a command of type string.')); | ||
return null; | ||
@@ -984,6 +1109,6 @@ } | ||
} | ||
if (this.is(json.isShellCommand, Types.isBoolean, parsers_1.ValidationState.Warning, NLS.localize(1, null, json.isShellCommand))) { | ||
if (this.is(json.isShellCommand, Types.isBoolean, parsers_1.ValidationState.Warning, NLS.localize('ExecutableParser.isShellCommand', 'Warning: isShellCommand must be of type boolean. Ignoring value {0}.', json.isShellCommand))) { | ||
isShellCommand = json.isShellCommand; | ||
} | ||
if (this.is(json.args, Types.isStringArray, parsers_1.ValidationState.Warning, NLS.localize(2, null, json.isShellCommand))) { | ||
if (this.is(json.args, Types.isStringArray, parsers_1.ValidationState.Warning, NLS.localize('ExecutableParser.args', 'Warning: args must be of type string[]. Ignoring value {0}.', json.isShellCommand))) { | ||
args = json.args.slice(0); | ||
@@ -1001,3 +1126,3 @@ } | ||
} | ||
if (this.is(json.cwd, Types.isString, parsers_1.ValidationState.Warning, NLS.localize(3, null, json.cwd))) { | ||
if (this.is(json.cwd, Types.isString, parsers_1.ValidationState.Warning, NLS.localize('ExecutableParser.invalidCWD', 'Warning: options.cwd must be of type string. Ignoring value {0}.', json.cwd))) { | ||
result.cwd = json.cwd; | ||
@@ -1004,0 +1129,0 @@ } |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 45); | ||
/******/ return __webpack_require__(__webpack_require__.s = 38); | ||
/******/ }) | ||
@@ -74,9 +71,6 @@ /************************************************************************/ | ||
/***/ 45: | ||
/***/ 38: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
/*--------------------------------------------------------------------------------------------- | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
@@ -87,2 +81,4 @@ * Licensed under the MIT License. See License.txt in the project root for license information. | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// Based on material from: | ||
@@ -116,3 +112,2 @@ /*! | ||
*/ | ||
var wordPathBoundary = ['-', '_', ' ', '/', '\\', '.']; | ||
@@ -134,3 +129,3 @@ function score(target, query, cache) { | ||
var score = 0; | ||
var _loop_1 = function _loop_1() { | ||
var _loop_1 = function () { | ||
var indexOf = targetLower.indexOf(queryLower[index], startAt); | ||
@@ -137,0 +132,0 @@ if (indexOf < 0) { |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 103); | ||
/******/ return __webpack_require__(__webpack_require__.s = 81); | ||
/******/ }) | ||
@@ -77,8 +74,3 @@ /************************************************************************/ | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -89,4 +81,5 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// --- THIS FILE IS TEMPORARY UNTIL ENV.TS IS CLEANED UP. IT CAN SAFELY BE USED IN ALL TARGET EXECUTION ENVIRONMENTS (node & dom) --- | ||
var _isWindows = false; | ||
@@ -98,3 +91,2 @@ var _isMacintosh = false; | ||
var _isWeb = false; | ||
var _isQunit = false; | ||
var _locale = undefined; | ||
@@ -104,3 +96,3 @@ var _language = undefined; | ||
// OS detection | ||
if ((typeof process === "undefined" ? "undefined" : _typeof(process)) === 'object') { | ||
if (typeof process === 'object') { | ||
_isWindows = process.platform === 'win32'; | ||
@@ -121,3 +113,3 @@ _isMacintosh = process.platform === 'darwin'; | ||
_isNative = true; | ||
} else if ((typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) === 'object') { | ||
} else if (typeof navigator === 'object') { | ||
var userAgent = navigator.userAgent; | ||
@@ -130,3 +122,2 @@ _isWindows = userAgent.indexOf('Windows') >= 0; | ||
_language = _locale; | ||
_isQunit = !!self.QUnit; | ||
} | ||
@@ -140,10 +131,10 @@ var Platform; | ||
})(Platform = exports.Platform || (exports.Platform = {})); | ||
exports._platform = Platform.Web; | ||
var _platform = Platform.Web; | ||
if (_isNative) { | ||
if (_isMacintosh) { | ||
exports._platform = Platform.Mac; | ||
_platform = Platform.Mac; | ||
} else if (_isWindows) { | ||
exports._platform = Platform.Windows; | ||
_platform = Platform.Windows; | ||
} else if (_isLinux) { | ||
exports._platform = Platform.Linux; | ||
_platform = Platform.Linux; | ||
} | ||
@@ -157,4 +148,3 @@ } | ||
exports.isWeb = _isWeb; | ||
exports.isQunit = _isQunit; | ||
exports.platform = exports._platform; | ||
exports.platform = _platform; | ||
/** | ||
@@ -172,3 +162,3 @@ * The language used for the user interface. The format of | ||
exports.locale = _locale; | ||
var _globals = (typeof self === "undefined" ? "undefined" : _typeof(self)) === 'object' ? self : global; | ||
var _globals = typeof self === 'object' ? self : global; | ||
exports.globals = _globals; | ||
@@ -183,2 +173,18 @@ function hasWebWorkerSupport() { | ||
exports.clearInterval = _globals.clearInterval.bind(_globals); | ||
var OperatingSystem; | ||
(function (OperatingSystem) { | ||
OperatingSystem[OperatingSystem["Windows"] = 1] = "Windows"; | ||
OperatingSystem[OperatingSystem["Macintosh"] = 2] = "Macintosh"; | ||
OperatingSystem[OperatingSystem["Linux"] = 3] = "Linux"; | ||
})(OperatingSystem = exports.OperatingSystem || (exports.OperatingSystem = {})); | ||
exports.OS = _isMacintosh ? 2 /* Macintosh */ : _isWindows ? 1 /* Windows */ : 3 /* Linux */; | ||
var AccessibilitySupport; | ||
(function (AccessibilitySupport) { | ||
/** | ||
* This should be the browser case where it is not known if a screen reader is attached or no. | ||
*/ | ||
AccessibilitySupport[AccessibilitySupport["Unknown"] = 0] = "Unknown"; | ||
AccessibilitySupport[AccessibilitySupport["Disabled"] = 1] = "Disabled"; | ||
AccessibilitySupport[AccessibilitySupport["Enabled"] = 2] = "Enabled"; | ||
})(AccessibilitySupport = exports.AccessibilitySupport || (exports.AccessibilitySupport = {})); | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
@@ -190,9 +196,6 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
/***/ 103: | ||
/***/ 81: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(0)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, platform_1) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(0)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, platform_1) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -204,4 +207,5 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var hasPerformanceNow = platform_1.globals.performance && typeof platform_1.globals.performance.now === 'function'; | ||
var StopWatch = function () { | ||
var StopWatch = /** @class */function () { | ||
function StopWatch(highResolution) { | ||
@@ -208,0 +212,0 @@ this._highResolution = hasPerformanceNow && highResolution; |
@@ -54,3 +54,2 @@ /** | ||
export declare function endsWith(haystack: string, needle: string): boolean; | ||
export declare function indexOfIgnoreCase(haystack: string, needle: string, position?: number): number; | ||
export interface RegExpOptions { | ||
@@ -70,3 +69,3 @@ matchCase?: boolean; | ||
*/ | ||
export declare let canNormalize: boolean; | ||
export declare const canNormalize: boolean; | ||
export declare function normalizeNFC(str: string): string; | ||
@@ -82,3 +81,3 @@ /** | ||
*/ | ||
export declare function getLeadingWhitespace(str: string): string; | ||
export declare function getLeadingWhitespace(str: string, start?: number, end?: number): string; | ||
/** | ||
@@ -92,2 +91,3 @@ * Returns last index of the string that is not whitespace. | ||
export declare function equalsIgnoreCase(a: string, b: string): boolean; | ||
export declare function beginsWithIgnoreCase(str: string, candidate: string): boolean; | ||
/** | ||
@@ -101,2 +101,7 @@ * @returns the length of the common prefix of the two strings. | ||
export declare function commonSuffixLength(a: string, b: string): number; | ||
/** | ||
* Return the overlap between the suffix of `a` and the prefix of `b`. | ||
* For instance `overlap("foobar", "arr, I'm a pirate") === 2`. | ||
*/ | ||
export declare function overlap(a: string, b: string): number; | ||
export declare function isHighSurrogate(charCode: number): boolean; | ||
@@ -108,2 +113,3 @@ export declare function isLowSurrogate(charCode: number): boolean; | ||
export declare function containsRTL(str: string): boolean; | ||
export declare function containsEmoji(str: string): boolean; | ||
/** | ||
@@ -113,2 +119,3 @@ * Returns true if `str` contains only basic ASCII characters in the range 32 - 126 (including 32 and 126) or \n, \r, \t | ||
export declare function isBasicASCII(str: string): boolean; | ||
export declare function containsFullWidthCharacter(str: string): boolean; | ||
export declare function isFullWidthCharacter(charCode: number): boolean; | ||
@@ -115,0 +122,0 @@ /** |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,16 +65,11 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 1); | ||
/******/ return __webpack_require__(__webpack_require__.s = 2); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */, | ||
/* 1 */ | ||
/******/ ({ | ||
/***/ 2: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -89,2 +81,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var _typeof = { | ||
@@ -104,3 +97,3 @@ number: 'number', | ||
} | ||
if (array && _typeof2(array.length) === _typeof.number && array.constructor === Array) { | ||
if (array && typeof array.length === _typeof.number && array.constructor === Array) { | ||
return true; | ||
@@ -115,3 +108,3 @@ } | ||
function isString(str) { | ||
if ((typeof str === "undefined" ? "undefined" : _typeof2(str)) === _typeof.string || str instanceof String) { | ||
if (typeof str === _typeof.string || str instanceof String) { | ||
return true; | ||
@@ -140,3 +133,3 @@ } | ||
// narrowing results in wrong results. | ||
return (typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.object && obj !== null && !Array.isArray(obj) && !(obj instanceof RegExp) && !(obj instanceof Date); | ||
return typeof obj === _typeof.object && obj !== null && !Array.isArray(obj) && !(obj instanceof RegExp) && !(obj instanceof Date); | ||
} | ||
@@ -149,3 +142,3 @@ exports.isObject = isObject; | ||
function isNumber(obj) { | ||
if (((typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.number || obj instanceof Number) && !isNaN(obj)) { | ||
if ((typeof obj === _typeof.number || obj instanceof Number) && !isNaN(obj)) { | ||
return true; | ||
@@ -167,3 +160,3 @@ } | ||
function isUndefined(obj) { | ||
return (typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.undefined; | ||
return typeof obj === _typeof.undefined; | ||
} | ||
@@ -198,3 +191,3 @@ exports.isUndefined = isUndefined; | ||
function isFunction(obj) { | ||
return (typeof obj === "undefined" ? "undefined" : _typeof2(obj)) === _typeof.function; | ||
return typeof obj === _typeof.function; | ||
} | ||
@@ -222,3 +215,3 @@ exports.isFunction = isFunction; | ||
if (isString(constraint)) { | ||
if ((typeof arg === "undefined" ? "undefined" : _typeof2(arg)) !== constraint) { | ||
if (typeof arg !== constraint) { | ||
throw new Error("argument does not match constraint: typeof " + constraint); | ||
@@ -259,3 +252,4 @@ } | ||
/***/ }) | ||
/******/ ]); | ||
/******/ }); | ||
//# sourceMappingURL=types.js.map |
@@ -24,10 +24,2 @@ /** | ||
private static _upperCaseDrive; | ||
private _scheme; | ||
private _authority; | ||
private _path; | ||
private _query; | ||
private _fragment; | ||
private _formatted; | ||
private _fsPath; | ||
protected constructor(); | ||
/** | ||
@@ -55,3 +47,9 @@ * scheme is the 'http' part of 'http://www.msft.com/some/path?query#fragment'. | ||
readonly fragment: string; | ||
private _formatted; | ||
private _fsPath; | ||
/** | ||
* @internal | ||
*/ | ||
private constructor(); | ||
/** | ||
* Returns a string representing the corresponding file system path of this URI. | ||
@@ -72,3 +70,2 @@ * Will handle UNC paths and normalize windows drive letters to lower-case. Also | ||
static file(path: string): URI; | ||
private static _parseComponents(value); | ||
static from(components: { | ||
@@ -84,3 +81,3 @@ scheme?: string; | ||
private static _doubleSlashStart; | ||
private static _validate(ret); | ||
private _validate(ret); | ||
/** | ||
@@ -87,0 +84,0 @@ * |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,16 +65,10 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 16); | ||
/******/ return __webpack_require__(__webpack_require__.s = 4); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ({ | ||
/***/ 0: | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -88,4 +79,5 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// --- THIS FILE IS TEMPORARY UNTIL ENV.TS IS CLEANED UP. IT CAN SAFELY BE USED IN ALL TARGET EXECUTION ENVIRONMENTS (node & dom) --- | ||
var _isWindows = false; | ||
@@ -97,3 +89,2 @@ var _isMacintosh = false; | ||
var _isWeb = false; | ||
var _isQunit = false; | ||
var _locale = undefined; | ||
@@ -103,3 +94,3 @@ var _language = undefined; | ||
// OS detection | ||
if ((typeof process === "undefined" ? "undefined" : _typeof(process)) === 'object') { | ||
if (typeof process === 'object') { | ||
_isWindows = process.platform === 'win32'; | ||
@@ -120,3 +111,3 @@ _isMacintosh = process.platform === 'darwin'; | ||
_isNative = true; | ||
} else if ((typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) === 'object') { | ||
} else if (typeof navigator === 'object') { | ||
var userAgent = navigator.userAgent; | ||
@@ -129,3 +120,2 @@ _isWindows = userAgent.indexOf('Windows') >= 0; | ||
_language = _locale; | ||
_isQunit = !!self.QUnit; | ||
} | ||
@@ -139,10 +129,10 @@ var Platform; | ||
})(Platform = exports.Platform || (exports.Platform = {})); | ||
exports._platform = Platform.Web; | ||
var _platform = Platform.Web; | ||
if (_isNative) { | ||
if (_isMacintosh) { | ||
exports._platform = Platform.Mac; | ||
_platform = Platform.Mac; | ||
} else if (_isWindows) { | ||
exports._platform = Platform.Windows; | ||
_platform = Platform.Windows; | ||
} else if (_isLinux) { | ||
exports._platform = Platform.Linux; | ||
_platform = Platform.Linux; | ||
} | ||
@@ -156,4 +146,3 @@ } | ||
exports.isWeb = _isWeb; | ||
exports.isQunit = _isQunit; | ||
exports.platform = exports._platform; | ||
exports.platform = _platform; | ||
/** | ||
@@ -171,3 +160,3 @@ * The language used for the user interface. The format of | ||
exports.locale = _locale; | ||
var _globals = (typeof self === "undefined" ? "undefined" : _typeof(self)) === 'object' ? self : global; | ||
var _globals = typeof self === 'object' ? self : global; | ||
exports.globals = _globals; | ||
@@ -182,2 +171,18 @@ function hasWebWorkerSupport() { | ||
exports.clearInterval = _globals.clearInterval.bind(_globals); | ||
var OperatingSystem; | ||
(function (OperatingSystem) { | ||
OperatingSystem[OperatingSystem["Windows"] = 1] = "Windows"; | ||
OperatingSystem[OperatingSystem["Macintosh"] = 2] = "Macintosh"; | ||
OperatingSystem[OperatingSystem["Linux"] = 3] = "Linux"; | ||
})(OperatingSystem = exports.OperatingSystem || (exports.OperatingSystem = {})); | ||
exports.OS = _isMacintosh ? 2 /* Macintosh */ : _isWindows ? 1 /* Windows */ : 3 /* Linux */; | ||
var AccessibilitySupport; | ||
(function (AccessibilitySupport) { | ||
/** | ||
* This should be the browser case where it is not known if a screen reader is attached or no. | ||
*/ | ||
AccessibilitySupport[AccessibilitySupport["Unknown"] = 0] = "Unknown"; | ||
AccessibilitySupport[AccessibilitySupport["Disabled"] = 1] = "Disabled"; | ||
AccessibilitySupport[AccessibilitySupport["Enabled"] = 2] = "Enabled"; | ||
})(AccessibilitySupport = exports.AccessibilitySupport || (exports.AccessibilitySupport = {})); | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
@@ -188,10 +193,9 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
/***/ }), | ||
/***/ 16: | ||
/* 1 */, | ||
/* 2 */, | ||
/* 3 */, | ||
/* 4 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(0)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, platform) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(0)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, platform) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -203,2 +207,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function _encode(ch) { | ||
@@ -212,3 +217,3 @@ return '%' + ch.charCodeAt(0).toString(16).toUpperCase(); | ||
function encodeNoop(str) { | ||
return str; | ||
return str.replace(/[#?]/, _encode); | ||
} | ||
@@ -231,11 +236,15 @@ /** | ||
*/ | ||
var URI = function () { | ||
function URI() { | ||
this._scheme = URI._empty; | ||
this._authority = URI._empty; | ||
this._path = URI._empty; | ||
this._query = URI._empty; | ||
this._fragment = URI._empty; | ||
var URI = /** @class */function () { | ||
/** | ||
* @internal | ||
*/ | ||
function URI(scheme, authority, path, query, fragment) { | ||
this._formatted = null; | ||
this._fsPath = null; | ||
this.scheme = scheme || URI._empty; | ||
this.authority = authority || URI._empty; | ||
this.path = path || URI._empty; | ||
this.query = query || URI._empty; | ||
this.fragment = fragment || URI._empty; | ||
this._validate(this); | ||
} | ||
@@ -251,54 +260,2 @@ URI.isUri = function (thing) { | ||
}; | ||
Object.defineProperty(URI.prototype, "scheme", { | ||
/** | ||
* scheme is the 'http' part of 'http://www.msft.com/some/path?query#fragment'. | ||
* The part before the first colon. | ||
*/ | ||
get: function get() { | ||
return this._scheme; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "authority", { | ||
/** | ||
* authority is the 'www.msft.com' part of 'http://www.msft.com/some/path?query#fragment'. | ||
* The part between the first double slashes and the next slash. | ||
*/ | ||
get: function get() { | ||
return this._authority; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "path", { | ||
/** | ||
* path is the '/some/path' part of 'http://www.msft.com/some/path?query#fragment'. | ||
*/ | ||
get: function get() { | ||
return this._path; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "query", { | ||
/** | ||
* query is the 'query' part of 'http://www.msft.com/some/path?query#fragment'. | ||
*/ | ||
get: function get() { | ||
return this._query; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "fragment", { | ||
/** | ||
* fragment is the 'fragment' part of 'http://www.msft.com/some/path?query#fragment'. | ||
*/ | ||
get: function get() { | ||
return this._fragment; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "fsPath", { | ||
@@ -312,14 +269,14 @@ // ---- filesystem path ----------------------- | ||
*/ | ||
get: function get() { | ||
get: function () { | ||
if (!this._fsPath) { | ||
var value; | ||
if (this._authority && this._path && this.scheme === 'file') { | ||
var value = void 0; | ||
if (this.authority && this.path && this.scheme === 'file') { | ||
// unc path: file://shares/c$/far/boo | ||
value = "//" + this._authority + this._path; | ||
} else if (URI._driveLetterPath.test(this._path)) { | ||
value = "//" + this.authority + this.path; | ||
} else if (URI._driveLetterPath.test(this.path)) { | ||
// windows drive letter: file:///c:/far/boo | ||
value = this._path[1].toLowerCase() + this._path.substr(2); | ||
value = this.path[1].toLowerCase() + this.path.substr(2); | ||
} else { | ||
// other path | ||
value = this._path; | ||
value = this.path; | ||
} | ||
@@ -374,28 +331,20 @@ if (platform.isWindows) { | ||
} | ||
var ret = new URI(); | ||
ret._scheme = scheme; | ||
ret._authority = authority; | ||
ret._path = path; | ||
ret._query = query; | ||
ret._fragment = fragment; | ||
URI._validate(ret); | ||
return ret; | ||
return new URI(scheme, authority, path, query, fragment); | ||
}; | ||
// ---- parse & validate ------------------------ | ||
URI.parse = function (value) { | ||
var ret = new URI(); | ||
var data = URI._parseComponents(value); | ||
ret._scheme = data.scheme; | ||
ret._authority = decodeURIComponent(data.authority); | ||
ret._path = decodeURIComponent(data.path); | ||
ret._query = decodeURIComponent(data.query); | ||
ret._fragment = decodeURIComponent(data.fragment); | ||
URI._validate(ret); | ||
return ret; | ||
var match = URI._regexp.exec(value); | ||
if (!match) { | ||
return new URI(URI._empty, URI._empty, URI._empty, URI._empty, URI._empty); | ||
} | ||
return new URI(match[2] || URI._empty, decodeURIComponent(match[4] || URI._empty), decodeURIComponent(match[5] || URI._empty), decodeURIComponent(match[7] || URI._empty), decodeURIComponent(match[9] || URI._empty)); | ||
}; | ||
URI.file = function (path) { | ||
var ret = new URI(); | ||
ret._scheme = 'file'; | ||
// normalize to fwd-slashes | ||
path = path.replace(/\\/g, URI._slash); | ||
var authority = URI._empty; | ||
// normalize to fwd-slashes on windows, | ||
// on other systems bwd-slashes are valid | ||
// filename character, eg /f\oo/ba\r.txt | ||
if (platform.isWindows) { | ||
path = path.replace(/\\/g, URI._slash); | ||
} | ||
// check for authority as used in UNC shares | ||
@@ -406,40 +355,20 @@ // or use the path as given | ||
if (idx === -1) { | ||
ret._authority = path.substring(2); | ||
authority = path.substring(2); | ||
path = URI._empty; | ||
} else { | ||
ret._authority = path.substring(2, idx); | ||
ret._path = path.substring(idx); | ||
authority = path.substring(2, idx); | ||
path = path.substring(idx); | ||
} | ||
} else { | ||
ret._path = path; | ||
} | ||
// Ensure that path starts with a slash | ||
// or that it is at least a slash | ||
if (ret._path[0] !== URI._slash) { | ||
ret._path = URI._slash + ret._path; | ||
if (path[0] !== URI._slash) { | ||
path = URI._slash + path; | ||
} | ||
URI._validate(ret); | ||
return ret; | ||
return new URI('file', authority, path, URI._empty, URI._empty); | ||
}; | ||
URI._parseComponents = function (value) { | ||
var ret = { | ||
scheme: URI._empty, | ||
authority: URI._empty, | ||
path: URI._empty, | ||
query: URI._empty, | ||
fragment: URI._empty | ||
}; | ||
var match = URI._regexp.exec(value); | ||
if (match) { | ||
ret.scheme = match[2] || ret.scheme; | ||
ret.authority = match[4] || ret.authority; | ||
ret.path = match[5] || ret.path; | ||
ret.query = match[7] || ret.query; | ||
ret.fragment = match[9] || ret.fragment; | ||
} | ||
return ret; | ||
}; | ||
URI.from = function (components) { | ||
return new URI().with(components); | ||
return new URI(components.scheme, components.authority, components.path, components.query, components.fragment); | ||
}; | ||
URI._validate = function (ret) { | ||
URI.prototype._validate = function (ret) { | ||
// scheme, https://tools.ietf.org/html/rfc3986#section-3.1 | ||
@@ -527,6 +456,6 @@ // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) | ||
if (idx === -1) { | ||
parts.push(encoder(path.substring(lastIdx)).replace(/[#?]/, _encode)); | ||
parts.push(encoder(path.substring(lastIdx))); | ||
break; | ||
} | ||
parts.push(encoder(path.substring(lastIdx, idx)).replace(/[#?]/, _encode), URI._slash); | ||
parts.push(encoder(path.substring(lastIdx, idx)), URI._slash); | ||
lastIdx = idx + 1; | ||
@@ -568,24 +497,17 @@ } | ||
URI.revive = function (data) { | ||
var result = new URI(); | ||
result._scheme = data.scheme || URI._empty; | ||
result._authority = data.authority || URI._empty; | ||
result._path = data.path || URI._empty; | ||
result._query = data.query || URI._empty; | ||
result._fragment = data.fragment || URI._empty; | ||
var result = new URI(data.scheme, data.authority, data.path, data.query, data.fragment); | ||
result._fsPath = data.fsPath; | ||
result._formatted = data.external; | ||
URI._validate(result); | ||
return result; | ||
}; | ||
URI._empty = ''; | ||
URI._slash = '/'; | ||
URI._regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; | ||
URI._driveLetterPath = /^\/[a-zA-Z]:/; | ||
URI._upperCaseDrive = /^(\/)?([A-Z]:)/; | ||
URI._schemePattern = /^\w[\w\d+.-]*$/; | ||
URI._singleSlashStart = /^\//; | ||
URI._doubleSlashStart = /^\/\//; | ||
return URI; | ||
}(); | ||
URI._empty = ''; | ||
URI._slash = '/'; | ||
URI._regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; | ||
URI._driveLetterPath = /^\/[a-zA-z]:/; | ||
URI._upperCaseDrive = /^(\/)?([A-Z]:)/; | ||
URI._schemePattern = /^\w[\w\d+.-]*$/; | ||
URI._singleSlashStart = /^\//; | ||
URI._doubleSlashStart = /^\/\//; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = URI; | ||
@@ -597,4 +519,3 @@ }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
/***/ }) | ||
/******/ }); | ||
/******/ ]); | ||
//# sourceMappingURL=uri.js.map |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -76,13 +73,16 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var __extends = undefined && undefined.__extends || function (d, b) { | ||
for (var p in b) { | ||
if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
}function __() { | ||
this.constructor = d; | ||
} | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = this && this.__extends || function () { | ||
var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { | ||
d.__proto__ = b; | ||
} || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { | ||
this.constructor = d; | ||
} | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
}(); | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
@@ -95,3 +95,4 @@ /*--------------------------------------------------------------------------------------------- | ||
var ValueUUID = function () { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ValueUUID = /** @class */function () { | ||
function ValueUUID(_value) { | ||
@@ -109,3 +110,3 @@ this._value = _value; | ||
}(); | ||
var V4UUID = function (_super) { | ||
var V4UUID = /** @class */function (_super) { | ||
__extends(V4UUID, _super); | ||
@@ -121,6 +122,6 @@ function V4UUID() { | ||
}; | ||
V4UUID._chars = ['0', '1', '2', '3', '4', '5', '6', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']; | ||
V4UUID._timeHighBits = ['8', '9', 'a', 'b']; | ||
return V4UUID; | ||
}(ValueUUID); | ||
V4UUID._chars = ['0', '1', '2', '3', '4', '5', '6', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']; | ||
V4UUID._timeHighBits = ['8', '9', 'a', 'b']; | ||
function v4() { | ||
@@ -127,0 +128,0 @@ return new V4UUID(); |
@@ -52,3 +52,3 @@ /*--------------------------------------------------------------------------------------------- | ||
*/ | ||
public static addEventListener(event: 'error', promiseErrorHandler: (e: IPromiseError) => void); | ||
public static addEventListener(event: 'error', promiseErrorHandler: (e: IPromiseError) => void): void; | ||
} | ||
@@ -55,0 +55,0 @@ |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 46); | ||
/******/ return __webpack_require__(__webpack_require__.s = 45); | ||
/******/ }) | ||
@@ -74,14 +71,13 @@ /************************************************************************/ | ||
/***/ 46: | ||
/***/ 45: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
/*--------------------------------------------------------------------------------------------- | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(51)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, sd) { | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(46)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, sd) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
@@ -95,4 +91,3 @@ * Convenient way to iterate over output line by line. This helper accommodates for the fact that | ||
*/ | ||
var LineDecoder = function () { | ||
var LineDecoder = /** @class */function () { | ||
function LineDecoder(encoding) { | ||
@@ -113,5 +108,2 @@ if (encoding === void 0) { | ||
var ch; | ||
while (start < value.length && ((ch = value.charCodeAt(start)) === 13 /* CarriageReturn */ || ch === 10 /* LineFeed */)) { | ||
start++; | ||
} | ||
var idx = start; | ||
@@ -123,4 +115,8 @@ while (idx < value.length) { | ||
idx++; | ||
while (idx < value.length && ((ch = value.charCodeAt(idx)) === 13 /* CarriageReturn */ || ch === 10 /* LineFeed */)) { | ||
idx++; | ||
if (idx < value.length) { | ||
var lastChar = ch; | ||
ch = value.charCodeAt(idx); | ||
if (lastChar === 13 /* CarriageReturn */ && ch === 10 /* LineFeed */ || lastChar === 10 /* LineFeed */ && ch === 13 /* CarriageReturn */) { | ||
idx++; | ||
} | ||
} | ||
@@ -147,3 +143,3 @@ start = idx; | ||
/***/ 51: | ||
/***/ 46: | ||
/***/ (function(module, exports) { | ||
@@ -150,0 +146,0 @@ |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -76,6 +73,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
/*--------------------------------------------------------------------------------------------- | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
@@ -86,2 +80,4 @@ * Licensed under the MIT License. See License.txt in the project root for license information. | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
@@ -91,3 +87,2 @@ * Executes the given function (fn) over the given array of items (list) in parallel and returns the resulting errors and results as | ||
*/ | ||
function parallel(list, fn, callback) { | ||
@@ -138,3 +133,3 @@ var results = new Array(list.length); | ||
var results_1 = []; | ||
var looper_1 = function looper_1(i) { | ||
var looper_1 = function (i) { | ||
// Still work to do | ||
@@ -184,3 +179,3 @@ if (i < param.length) { | ||
loop(sequences, function (sequence, clb) { | ||
var sequenceFunction = function sequenceFunction(error, result) { | ||
var sequenceFunction = function (error, result) { | ||
// A method might only send a boolean value as return value (e.g. fs.exists), support this case gracefully | ||
@@ -187,0 +182,0 @@ if (error === true || error === false) { |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 110); | ||
/******/ return __webpack_require__(__webpack_require__.s = 89); | ||
/******/ }) | ||
@@ -77,8 +74,3 @@ /************************************************************************/ | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -89,4 +81,5 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// --- THIS FILE IS TEMPORARY UNTIL ENV.TS IS CLEANED UP. IT CAN SAFELY BE USED IN ALL TARGET EXECUTION ENVIRONMENTS (node & dom) --- | ||
var _isWindows = false; | ||
@@ -98,3 +91,2 @@ var _isMacintosh = false; | ||
var _isWeb = false; | ||
var _isQunit = false; | ||
var _locale = undefined; | ||
@@ -104,3 +96,3 @@ var _language = undefined; | ||
// OS detection | ||
if ((typeof process === "undefined" ? "undefined" : _typeof(process)) === 'object') { | ||
if (typeof process === 'object') { | ||
_isWindows = process.platform === 'win32'; | ||
@@ -121,3 +113,3 @@ _isMacintosh = process.platform === 'darwin'; | ||
_isNative = true; | ||
} else if ((typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) === 'object') { | ||
} else if (typeof navigator === 'object') { | ||
var userAgent = navigator.userAgent; | ||
@@ -130,3 +122,2 @@ _isWindows = userAgent.indexOf('Windows') >= 0; | ||
_language = _locale; | ||
_isQunit = !!self.QUnit; | ||
} | ||
@@ -140,10 +131,10 @@ var Platform; | ||
})(Platform = exports.Platform || (exports.Platform = {})); | ||
exports._platform = Platform.Web; | ||
var _platform = Platform.Web; | ||
if (_isNative) { | ||
if (_isMacintosh) { | ||
exports._platform = Platform.Mac; | ||
_platform = Platform.Mac; | ||
} else if (_isWindows) { | ||
exports._platform = Platform.Windows; | ||
_platform = Platform.Windows; | ||
} else if (_isLinux) { | ||
exports._platform = Platform.Linux; | ||
_platform = Platform.Linux; | ||
} | ||
@@ -157,4 +148,3 @@ } | ||
exports.isWeb = _isWeb; | ||
exports.isQunit = _isQunit; | ||
exports.platform = exports._platform; | ||
exports.platform = _platform; | ||
/** | ||
@@ -172,3 +162,3 @@ * The language used for the user interface. The format of | ||
exports.locale = _locale; | ||
var _globals = (typeof self === "undefined" ? "undefined" : _typeof(self)) === 'object' ? self : global; | ||
var _globals = typeof self === 'object' ? self : global; | ||
exports.globals = _globals; | ||
@@ -183,2 +173,18 @@ function hasWebWorkerSupport() { | ||
exports.clearInterval = _globals.clearInterval.bind(_globals); | ||
var OperatingSystem; | ||
(function (OperatingSystem) { | ||
OperatingSystem[OperatingSystem["Windows"] = 1] = "Windows"; | ||
OperatingSystem[OperatingSystem["Macintosh"] = 2] = "Macintosh"; | ||
OperatingSystem[OperatingSystem["Linux"] = 3] = "Linux"; | ||
})(OperatingSystem = exports.OperatingSystem || (exports.OperatingSystem = {})); | ||
exports.OS = _isMacintosh ? 2 /* Macintosh */ : _isWindows ? 1 /* Windows */ : 3 /* Linux */; | ||
var AccessibilitySupport; | ||
(function (AccessibilitySupport) { | ||
/** | ||
* This should be the browser case where it is not known if a screen reader is attached or no. | ||
*/ | ||
AccessibilitySupport[AccessibilitySupport["Unknown"] = 0] = "Unknown"; | ||
AccessibilitySupport[AccessibilitySupport["Disabled"] = 1] = "Disabled"; | ||
AccessibilitySupport[AccessibilitySupport["Enabled"] = 2] = "Enabled"; | ||
})(AccessibilitySupport = exports.AccessibilitySupport || (exports.AccessibilitySupport = {})); | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
@@ -190,32 +196,19 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
/***/ 110: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
/***/ 21: | ||
/***/ (function(module, exports) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
function webpackEmptyContext(req) { | ||
throw new Error("Cannot find module '" + req + "'."); | ||
} | ||
webpackEmptyContext.keys = function() { return []; }; | ||
webpackEmptyContext.resolve = webpackEmptyContext; | ||
module.exports = webpackEmptyContext; | ||
webpackEmptyContext.id = 21; | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(16)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, uri_1) { | ||
"use strict"; | ||
var pathsPath = uri_1.default.parse(!(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()).toUrl('paths')).fsPath; | ||
var paths = !(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()).__$__nodeRequire(pathsPath); | ||
exports.getAppDataPath = paths.getAppDataPath; | ||
exports.getDefaultUserDataPath = paths.getDefaultUserDataPath; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
//# sourceMappingURL=paths.js.map | ||
/***/ }), | ||
/***/ 16: | ||
/***/ 4: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(0)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, platform) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(0)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, platform) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -227,2 +220,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function _encode(ch) { | ||
@@ -236,3 +230,3 @@ return '%' + ch.charCodeAt(0).toString(16).toUpperCase(); | ||
function encodeNoop(str) { | ||
return str; | ||
return str.replace(/[#?]/, _encode); | ||
} | ||
@@ -255,11 +249,15 @@ /** | ||
*/ | ||
var URI = function () { | ||
function URI() { | ||
this._scheme = URI._empty; | ||
this._authority = URI._empty; | ||
this._path = URI._empty; | ||
this._query = URI._empty; | ||
this._fragment = URI._empty; | ||
var URI = /** @class */function () { | ||
/** | ||
* @internal | ||
*/ | ||
function URI(scheme, authority, path, query, fragment) { | ||
this._formatted = null; | ||
this._fsPath = null; | ||
this.scheme = scheme || URI._empty; | ||
this.authority = authority || URI._empty; | ||
this.path = path || URI._empty; | ||
this.query = query || URI._empty; | ||
this.fragment = fragment || URI._empty; | ||
this._validate(this); | ||
} | ||
@@ -275,54 +273,2 @@ URI.isUri = function (thing) { | ||
}; | ||
Object.defineProperty(URI.prototype, "scheme", { | ||
/** | ||
* scheme is the 'http' part of 'http://www.msft.com/some/path?query#fragment'. | ||
* The part before the first colon. | ||
*/ | ||
get: function get() { | ||
return this._scheme; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "authority", { | ||
/** | ||
* authority is the 'www.msft.com' part of 'http://www.msft.com/some/path?query#fragment'. | ||
* The part between the first double slashes and the next slash. | ||
*/ | ||
get: function get() { | ||
return this._authority; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "path", { | ||
/** | ||
* path is the '/some/path' part of 'http://www.msft.com/some/path?query#fragment'. | ||
*/ | ||
get: function get() { | ||
return this._path; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "query", { | ||
/** | ||
* query is the 'query' part of 'http://www.msft.com/some/path?query#fragment'. | ||
*/ | ||
get: function get() { | ||
return this._query; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "fragment", { | ||
/** | ||
* fragment is the 'fragment' part of 'http://www.msft.com/some/path?query#fragment'. | ||
*/ | ||
get: function get() { | ||
return this._fragment; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "fsPath", { | ||
@@ -336,14 +282,14 @@ // ---- filesystem path ----------------------- | ||
*/ | ||
get: function get() { | ||
get: function () { | ||
if (!this._fsPath) { | ||
var value; | ||
if (this._authority && this._path && this.scheme === 'file') { | ||
var value = void 0; | ||
if (this.authority && this.path && this.scheme === 'file') { | ||
// unc path: file://shares/c$/far/boo | ||
value = "//" + this._authority + this._path; | ||
} else if (URI._driveLetterPath.test(this._path)) { | ||
value = "//" + this.authority + this.path; | ||
} else if (URI._driveLetterPath.test(this.path)) { | ||
// windows drive letter: file:///c:/far/boo | ||
value = this._path[1].toLowerCase() + this._path.substr(2); | ||
value = this.path[1].toLowerCase() + this.path.substr(2); | ||
} else { | ||
// other path | ||
value = this._path; | ||
value = this.path; | ||
} | ||
@@ -398,28 +344,20 @@ if (platform.isWindows) { | ||
} | ||
var ret = new URI(); | ||
ret._scheme = scheme; | ||
ret._authority = authority; | ||
ret._path = path; | ||
ret._query = query; | ||
ret._fragment = fragment; | ||
URI._validate(ret); | ||
return ret; | ||
return new URI(scheme, authority, path, query, fragment); | ||
}; | ||
// ---- parse & validate ------------------------ | ||
URI.parse = function (value) { | ||
var ret = new URI(); | ||
var data = URI._parseComponents(value); | ||
ret._scheme = data.scheme; | ||
ret._authority = decodeURIComponent(data.authority); | ||
ret._path = decodeURIComponent(data.path); | ||
ret._query = decodeURIComponent(data.query); | ||
ret._fragment = decodeURIComponent(data.fragment); | ||
URI._validate(ret); | ||
return ret; | ||
var match = URI._regexp.exec(value); | ||
if (!match) { | ||
return new URI(URI._empty, URI._empty, URI._empty, URI._empty, URI._empty); | ||
} | ||
return new URI(match[2] || URI._empty, decodeURIComponent(match[4] || URI._empty), decodeURIComponent(match[5] || URI._empty), decodeURIComponent(match[7] || URI._empty), decodeURIComponent(match[9] || URI._empty)); | ||
}; | ||
URI.file = function (path) { | ||
var ret = new URI(); | ||
ret._scheme = 'file'; | ||
// normalize to fwd-slashes | ||
path = path.replace(/\\/g, URI._slash); | ||
var authority = URI._empty; | ||
// normalize to fwd-slashes on windows, | ||
// on other systems bwd-slashes are valid | ||
// filename character, eg /f\oo/ba\r.txt | ||
if (platform.isWindows) { | ||
path = path.replace(/\\/g, URI._slash); | ||
} | ||
// check for authority as used in UNC shares | ||
@@ -430,40 +368,20 @@ // or use the path as given | ||
if (idx === -1) { | ||
ret._authority = path.substring(2); | ||
authority = path.substring(2); | ||
path = URI._empty; | ||
} else { | ||
ret._authority = path.substring(2, idx); | ||
ret._path = path.substring(idx); | ||
authority = path.substring(2, idx); | ||
path = path.substring(idx); | ||
} | ||
} else { | ||
ret._path = path; | ||
} | ||
// Ensure that path starts with a slash | ||
// or that it is at least a slash | ||
if (ret._path[0] !== URI._slash) { | ||
ret._path = URI._slash + ret._path; | ||
if (path[0] !== URI._slash) { | ||
path = URI._slash + path; | ||
} | ||
URI._validate(ret); | ||
return ret; | ||
return new URI('file', authority, path, URI._empty, URI._empty); | ||
}; | ||
URI._parseComponents = function (value) { | ||
var ret = { | ||
scheme: URI._empty, | ||
authority: URI._empty, | ||
path: URI._empty, | ||
query: URI._empty, | ||
fragment: URI._empty | ||
}; | ||
var match = URI._regexp.exec(value); | ||
if (match) { | ||
ret.scheme = match[2] || ret.scheme; | ||
ret.authority = match[4] || ret.authority; | ||
ret.path = match[5] || ret.path; | ||
ret.query = match[7] || ret.query; | ||
ret.fragment = match[9] || ret.fragment; | ||
} | ||
return ret; | ||
}; | ||
URI.from = function (components) { | ||
return new URI().with(components); | ||
return new URI(components.scheme, components.authority, components.path, components.query, components.fragment); | ||
}; | ||
URI._validate = function (ret) { | ||
URI.prototype._validate = function (ret) { | ||
// scheme, https://tools.ietf.org/html/rfc3986#section-3.1 | ||
@@ -551,6 +469,6 @@ // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) | ||
if (idx === -1) { | ||
parts.push(encoder(path.substring(lastIdx)).replace(/[#?]/, _encode)); | ||
parts.push(encoder(path.substring(lastIdx))); | ||
break; | ||
} | ||
parts.push(encoder(path.substring(lastIdx, idx)).replace(/[#?]/, _encode), URI._slash); | ||
parts.push(encoder(path.substring(lastIdx, idx)), URI._slash); | ||
lastIdx = idx + 1; | ||
@@ -592,24 +510,17 @@ } | ||
URI.revive = function (data) { | ||
var result = new URI(); | ||
result._scheme = data.scheme || URI._empty; | ||
result._authority = data.authority || URI._empty; | ||
result._path = data.path || URI._empty; | ||
result._query = data.query || URI._empty; | ||
result._fragment = data.fragment || URI._empty; | ||
var result = new URI(data.scheme, data.authority, data.path, data.query, data.fragment); | ||
result._fsPath = data.fsPath; | ||
result._formatted = data.external; | ||
URI._validate(result); | ||
return result; | ||
}; | ||
URI._empty = ''; | ||
URI._slash = '/'; | ||
URI._regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; | ||
URI._driveLetterPath = /^\/[a-zA-Z]:/; | ||
URI._upperCaseDrive = /^(\/)?([A-Z]:)/; | ||
URI._schemePattern = /^\w[\w\d+.-]*$/; | ||
URI._singleSlashStart = /^\//; | ||
URI._doubleSlashStart = /^\/\//; | ||
return URI; | ||
}(); | ||
URI._empty = ''; | ||
URI._slash = '/'; | ||
URI._regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; | ||
URI._driveLetterPath = /^\/[a-zA-z]:/; | ||
URI._upperCaseDrive = /^(\/)?([A-Z]:)/; | ||
URI._schemePattern = /^\w[\w\d+.-]*$/; | ||
URI._singleSlashStart = /^\//; | ||
URI._doubleSlashStart = /^\/\//; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = URI; | ||
@@ -622,13 +533,21 @@ }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
/***/ 17: | ||
/***/ (function(module, exports) { | ||
/***/ 89: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
function webpackEmptyContext(req) { | ||
throw new Error("Cannot find module '" + req + "'."); | ||
} | ||
webpackEmptyContext.keys = function() { return []; }; | ||
webpackEmptyContext.resolve = webpackEmptyContext; | ||
module.exports = webpackEmptyContext; | ||
webpackEmptyContext.id = 17; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(4)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, uri_1) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var pathsPath = uri_1.default.parse(!(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()).toUrl('paths')).fsPath; | ||
var paths = !(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()).__$__nodeRequire(pathsPath); | ||
exports.getAppDataPath = paths.getAppDataPath; | ||
exports.getDefaultUserDataPath = paths.getDefaultUserDataPath; | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
//# sourceMappingURL=paths.js.map | ||
/***/ }) | ||
@@ -635,0 +554,0 @@ |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 111); | ||
/******/ return __webpack_require__(__webpack_require__.s = 90); | ||
/******/ }) | ||
@@ -74,14 +71,20 @@ /************************************************************************/ | ||
/***/ 111: | ||
/***/ 27: | ||
/***/ (function(module, exports) { | ||
module.exports = require("net"); | ||
/***/ }), | ||
/***/ 90: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
/*--------------------------------------------------------------------------------------------- | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(23)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, net) { | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(27)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, net) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
@@ -91,3 +94,2 @@ * Given a start point and a max number of retries, will find a port that | ||
*/ | ||
function findFreePort(startPort, giveUpAfter, timeout, clb) { | ||
@@ -146,9 +148,2 @@ var done = false; | ||
/***/ }), | ||
/***/ 23: | ||
/***/ (function(module, exports) { | ||
module.exports = require("net"); | ||
/***/ }) | ||
@@ -155,0 +150,0 @@ |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 49); | ||
/******/ return __webpack_require__(__webpack_require__.s = 50); | ||
/******/ }) | ||
@@ -77,8 +74,3 @@ /************************************************************************/ | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -89,4 +81,5 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// --- THIS FILE IS TEMPORARY UNTIL ENV.TS IS CLEANED UP. IT CAN SAFELY BE USED IN ALL TARGET EXECUTION ENVIRONMENTS (node & dom) --- | ||
var _isWindows = false; | ||
@@ -98,3 +91,2 @@ var _isMacintosh = false; | ||
var _isWeb = false; | ||
var _isQunit = false; | ||
var _locale = undefined; | ||
@@ -104,3 +96,3 @@ var _language = undefined; | ||
// OS detection | ||
if ((typeof process === "undefined" ? "undefined" : _typeof(process)) === 'object') { | ||
if (typeof process === 'object') { | ||
_isWindows = process.platform === 'win32'; | ||
@@ -121,3 +113,3 @@ _isMacintosh = process.platform === 'darwin'; | ||
_isNative = true; | ||
} else if ((typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) === 'object') { | ||
} else if (typeof navigator === 'object') { | ||
var userAgent = navigator.userAgent; | ||
@@ -130,3 +122,2 @@ _isWindows = userAgent.indexOf('Windows') >= 0; | ||
_language = _locale; | ||
_isQunit = !!self.QUnit; | ||
} | ||
@@ -140,10 +131,10 @@ var Platform; | ||
})(Platform = exports.Platform || (exports.Platform = {})); | ||
exports._platform = Platform.Web; | ||
var _platform = Platform.Web; | ||
if (_isNative) { | ||
if (_isMacintosh) { | ||
exports._platform = Platform.Mac; | ||
_platform = Platform.Mac; | ||
} else if (_isWindows) { | ||
exports._platform = Platform.Windows; | ||
_platform = Platform.Windows; | ||
} else if (_isLinux) { | ||
exports._platform = Platform.Linux; | ||
_platform = Platform.Linux; | ||
} | ||
@@ -157,4 +148,3 @@ } | ||
exports.isWeb = _isWeb; | ||
exports.isQunit = _isQunit; | ||
exports.platform = exports._platform; | ||
exports.platform = _platform; | ||
/** | ||
@@ -172,3 +162,3 @@ * The language used for the user interface. The format of | ||
exports.locale = _locale; | ||
var _globals = (typeof self === "undefined" ? "undefined" : _typeof(self)) === 'object' ? self : global; | ||
var _globals = typeof self === 'object' ? self : global; | ||
exports.globals = _globals; | ||
@@ -183,2 +173,18 @@ function hasWebWorkerSupport() { | ||
exports.clearInterval = _globals.clearInterval.bind(_globals); | ||
var OperatingSystem; | ||
(function (OperatingSystem) { | ||
OperatingSystem[OperatingSystem["Windows"] = 1] = "Windows"; | ||
OperatingSystem[OperatingSystem["Macintosh"] = 2] = "Macintosh"; | ||
OperatingSystem[OperatingSystem["Linux"] = 3] = "Linux"; | ||
})(OperatingSystem = exports.OperatingSystem || (exports.OperatingSystem = {})); | ||
exports.OS = _isMacintosh ? 2 /* Macintosh */ : _isWindows ? 1 /* Windows */ : 3 /* Linux */; | ||
var AccessibilitySupport; | ||
(function (AccessibilitySupport) { | ||
/** | ||
* This should be the browser case where it is not known if a screen reader is attached or no. | ||
*/ | ||
AccessibilitySupport[AccessibilitySupport["Unknown"] = 0] = "Unknown"; | ||
AccessibilitySupport[AccessibilitySupport["Disabled"] = 1] = "Disabled"; | ||
AccessibilitySupport[AccessibilitySupport["Enabled"] = 2] = "Enabled"; | ||
})(AccessibilitySupport = exports.AccessibilitySupport || (exports.AccessibilitySupport = {})); | ||
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
@@ -197,9 +203,40 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
/***/ 16: | ||
/***/ 20: | ||
/***/ (function(module, exports) { | ||
module.exports = require("os"); | ||
/***/ }), | ||
/***/ 21: | ||
/***/ (function(module, exports) { | ||
function webpackEmptyContext(req) { | ||
throw new Error("Cannot find module '" + req + "'."); | ||
} | ||
webpackEmptyContext.keys = function() { return []; }; | ||
webpackEmptyContext.resolve = webpackEmptyContext; | ||
module.exports = webpackEmptyContext; | ||
webpackEmptyContext.id = 21; | ||
/***/ }), | ||
/***/ 27: | ||
/***/ (function(module, exports) { | ||
module.exports = require("net"); | ||
/***/ }), | ||
/***/ 34: | ||
/***/ (function(module, exports) { | ||
module.exports = require("child_process"); | ||
/***/ }), | ||
/***/ 4: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(0)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, platform) { | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(0)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, platform) { | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -211,2 +248,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function _encode(ch) { | ||
@@ -220,3 +258,3 @@ return '%' + ch.charCodeAt(0).toString(16).toUpperCase(); | ||
function encodeNoop(str) { | ||
return str; | ||
return str.replace(/[#?]/, _encode); | ||
} | ||
@@ -239,11 +277,15 @@ /** | ||
*/ | ||
var URI = function () { | ||
function URI() { | ||
this._scheme = URI._empty; | ||
this._authority = URI._empty; | ||
this._path = URI._empty; | ||
this._query = URI._empty; | ||
this._fragment = URI._empty; | ||
var URI = /** @class */function () { | ||
/** | ||
* @internal | ||
*/ | ||
function URI(scheme, authority, path, query, fragment) { | ||
this._formatted = null; | ||
this._fsPath = null; | ||
this.scheme = scheme || URI._empty; | ||
this.authority = authority || URI._empty; | ||
this.path = path || URI._empty; | ||
this.query = query || URI._empty; | ||
this.fragment = fragment || URI._empty; | ||
this._validate(this); | ||
} | ||
@@ -259,54 +301,2 @@ URI.isUri = function (thing) { | ||
}; | ||
Object.defineProperty(URI.prototype, "scheme", { | ||
/** | ||
* scheme is the 'http' part of 'http://www.msft.com/some/path?query#fragment'. | ||
* The part before the first colon. | ||
*/ | ||
get: function get() { | ||
return this._scheme; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "authority", { | ||
/** | ||
* authority is the 'www.msft.com' part of 'http://www.msft.com/some/path?query#fragment'. | ||
* The part between the first double slashes and the next slash. | ||
*/ | ||
get: function get() { | ||
return this._authority; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "path", { | ||
/** | ||
* path is the '/some/path' part of 'http://www.msft.com/some/path?query#fragment'. | ||
*/ | ||
get: function get() { | ||
return this._path; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "query", { | ||
/** | ||
* query is the 'query' part of 'http://www.msft.com/some/path?query#fragment'. | ||
*/ | ||
get: function get() { | ||
return this._query; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "fragment", { | ||
/** | ||
* fragment is the 'fragment' part of 'http://www.msft.com/some/path?query#fragment'. | ||
*/ | ||
get: function get() { | ||
return this._fragment; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(URI.prototype, "fsPath", { | ||
@@ -320,14 +310,14 @@ // ---- filesystem path ----------------------- | ||
*/ | ||
get: function get() { | ||
get: function () { | ||
if (!this._fsPath) { | ||
var value; | ||
if (this._authority && this._path && this.scheme === 'file') { | ||
var value = void 0; | ||
if (this.authority && this.path && this.scheme === 'file') { | ||
// unc path: file://shares/c$/far/boo | ||
value = "//" + this._authority + this._path; | ||
} else if (URI._driveLetterPath.test(this._path)) { | ||
value = "//" + this.authority + this.path; | ||
} else if (URI._driveLetterPath.test(this.path)) { | ||
// windows drive letter: file:///c:/far/boo | ||
value = this._path[1].toLowerCase() + this._path.substr(2); | ||
value = this.path[1].toLowerCase() + this.path.substr(2); | ||
} else { | ||
// other path | ||
value = this._path; | ||
value = this.path; | ||
} | ||
@@ -382,28 +372,20 @@ if (platform.isWindows) { | ||
} | ||
var ret = new URI(); | ||
ret._scheme = scheme; | ||
ret._authority = authority; | ||
ret._path = path; | ||
ret._query = query; | ||
ret._fragment = fragment; | ||
URI._validate(ret); | ||
return ret; | ||
return new URI(scheme, authority, path, query, fragment); | ||
}; | ||
// ---- parse & validate ------------------------ | ||
URI.parse = function (value) { | ||
var ret = new URI(); | ||
var data = URI._parseComponents(value); | ||
ret._scheme = data.scheme; | ||
ret._authority = decodeURIComponent(data.authority); | ||
ret._path = decodeURIComponent(data.path); | ||
ret._query = decodeURIComponent(data.query); | ||
ret._fragment = decodeURIComponent(data.fragment); | ||
URI._validate(ret); | ||
return ret; | ||
var match = URI._regexp.exec(value); | ||
if (!match) { | ||
return new URI(URI._empty, URI._empty, URI._empty, URI._empty, URI._empty); | ||
} | ||
return new URI(match[2] || URI._empty, decodeURIComponent(match[4] || URI._empty), decodeURIComponent(match[5] || URI._empty), decodeURIComponent(match[7] || URI._empty), decodeURIComponent(match[9] || URI._empty)); | ||
}; | ||
URI.file = function (path) { | ||
var ret = new URI(); | ||
ret._scheme = 'file'; | ||
// normalize to fwd-slashes | ||
path = path.replace(/\\/g, URI._slash); | ||
var authority = URI._empty; | ||
// normalize to fwd-slashes on windows, | ||
// on other systems bwd-slashes are valid | ||
// filename character, eg /f\oo/ba\r.txt | ||
if (platform.isWindows) { | ||
path = path.replace(/\\/g, URI._slash); | ||
} | ||
// check for authority as used in UNC shares | ||
@@ -414,40 +396,20 @@ // or use the path as given | ||
if (idx === -1) { | ||
ret._authority = path.substring(2); | ||
authority = path.substring(2); | ||
path = URI._empty; | ||
} else { | ||
ret._authority = path.substring(2, idx); | ||
ret._path = path.substring(idx); | ||
authority = path.substring(2, idx); | ||
path = path.substring(idx); | ||
} | ||
} else { | ||
ret._path = path; | ||
} | ||
// Ensure that path starts with a slash | ||
// or that it is at least a slash | ||
if (ret._path[0] !== URI._slash) { | ||
ret._path = URI._slash + ret._path; | ||
if (path[0] !== URI._slash) { | ||
path = URI._slash + path; | ||
} | ||
URI._validate(ret); | ||
return ret; | ||
return new URI('file', authority, path, URI._empty, URI._empty); | ||
}; | ||
URI._parseComponents = function (value) { | ||
var ret = { | ||
scheme: URI._empty, | ||
authority: URI._empty, | ||
path: URI._empty, | ||
query: URI._empty, | ||
fragment: URI._empty | ||
}; | ||
var match = URI._regexp.exec(value); | ||
if (match) { | ||
ret.scheme = match[2] || ret.scheme; | ||
ret.authority = match[4] || ret.authority; | ||
ret.path = match[5] || ret.path; | ||
ret.query = match[7] || ret.query; | ||
ret.fragment = match[9] || ret.fragment; | ||
} | ||
return ret; | ||
}; | ||
URI.from = function (components) { | ||
return new URI().with(components); | ||
return new URI(components.scheme, components.authority, components.path, components.query, components.fragment); | ||
}; | ||
URI._validate = function (ret) { | ||
URI.prototype._validate = function (ret) { | ||
// scheme, https://tools.ietf.org/html/rfc3986#section-3.1 | ||
@@ -535,6 +497,6 @@ // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) | ||
if (idx === -1) { | ||
parts.push(encoder(path.substring(lastIdx)).replace(/[#?]/, _encode)); | ||
parts.push(encoder(path.substring(lastIdx))); | ||
break; | ||
} | ||
parts.push(encoder(path.substring(lastIdx, idx)).replace(/[#?]/, _encode), URI._slash); | ||
parts.push(encoder(path.substring(lastIdx, idx)), URI._slash); | ||
lastIdx = idx + 1; | ||
@@ -576,24 +538,17 @@ } | ||
URI.revive = function (data) { | ||
var result = new URI(); | ||
result._scheme = data.scheme || URI._empty; | ||
result._authority = data.authority || URI._empty; | ||
result._path = data.path || URI._empty; | ||
result._query = data.query || URI._empty; | ||
result._fragment = data.fragment || URI._empty; | ||
var result = new URI(data.scheme, data.authority, data.path, data.query, data.fragment); | ||
result._fsPath = data.fsPath; | ||
result._formatted = data.external; | ||
URI._validate(result); | ||
return result; | ||
}; | ||
URI._empty = ''; | ||
URI._slash = '/'; | ||
URI._regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; | ||
URI._driveLetterPath = /^\/[a-zA-Z]:/; | ||
URI._upperCaseDrive = /^(\/)?([A-Z]:)/; | ||
URI._schemePattern = /^\w[\w\d+.-]*$/; | ||
URI._singleSlashStart = /^\//; | ||
URI._doubleSlashStart = /^\/\//; | ||
return URI; | ||
}(); | ||
URI._empty = ''; | ||
URI._slash = '/'; | ||
URI._regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; | ||
URI._driveLetterPath = /^\/[a-zA-z]:/; | ||
URI._upperCaseDrive = /^(\/)?([A-Z]:)/; | ||
URI._schemePattern = /^\w[\w\d+.-]*$/; | ||
URI._singleSlashStart = /^\//; | ||
URI._doubleSlashStart = /^\/\//; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = URI; | ||
@@ -606,49 +561,13 @@ }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
/***/ 17: | ||
/***/ (function(module, exports) { | ||
function webpackEmptyContext(req) { | ||
throw new Error("Cannot find module '" + req + "'."); | ||
} | ||
webpackEmptyContext.keys = function() { return []; }; | ||
webpackEmptyContext.resolve = webpackEmptyContext; | ||
module.exports = webpackEmptyContext; | ||
webpackEmptyContext.id = 17; | ||
/***/ }), | ||
/***/ 18: | ||
/***/ (function(module, exports) { | ||
module.exports = require("os"); | ||
/***/ }), | ||
/***/ 23: | ||
/***/ (function(module, exports) { | ||
module.exports = require("net"); | ||
/***/ }), | ||
/***/ 32: | ||
/***/ (function(module, exports) { | ||
module.exports = require("child_process"); | ||
/***/ }), | ||
/***/ 49: | ||
/***/ 50: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; | ||
/*--------------------------------------------------------------------------------------------- | ||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(14), __webpack_require__(18), __webpack_require__(23), __webpack_require__(32), __webpack_require__(16)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, path, os, net, cp, uri_1) { | ||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(14), __webpack_require__(20), __webpack_require__(27), __webpack_require__(34), __webpack_require__(4)], __WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, path, os, net, cp, uri_1) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function makeRandomHexString(length) { | ||
@@ -686,3 +605,3 @@ var chars = ['0', '1', '2', '3', '4', '5', '6', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']; | ||
var callbackCalled = false; | ||
var resolve = function resolve(result) { | ||
var resolve = function (result) { | ||
if (callbackCalled) { | ||
@@ -694,3 +613,3 @@ return; | ||
}; | ||
var reject = function reject(err) { | ||
var reject = function (err) { | ||
if (callbackCalled) { | ||
@@ -727,3 +646,3 @@ return; | ||
var serverClosed = false; | ||
var closeServer = function closeServer() { | ||
var closeServer = function () { | ||
if (serverClosed) { | ||
@@ -730,0 +649,0 @@ return; |
@@ -37,5 +37,2 @@ module.exports = | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
@@ -68,3 +65,3 @@ /******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 117); | ||
/******/ return __webpack_require__(__webpack_require__.s = 103); | ||
/******/ }) | ||
@@ -74,8 +71,5 @@ /************************************************************************/ | ||
/***/ 117: | ||
/***/ 103: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
/*--------------------------------------------------------------------------------------------- | ||
@@ -86,6 +80,6 @@ * Copyright (c) Microsoft Corporation. All rights reserved. | ||
var net = __webpack_require__(23), | ||
fs = __webpack_require__(8), | ||
stream = __webpack_require__(34), | ||
util = __webpack_require__(58); | ||
const net = __webpack_require__(27); | ||
const fs = __webpack_require__(11); | ||
// const stream = require('stream'); | ||
// const util = require('util'); | ||
@@ -145,3 +139,3 @@ var ENABLE_LOGGING = false; | ||
var fsWriteSyncString = function fsWriteSyncString(fd, str, position, encoding) { | ||
var fsWriteSyncString = function (fd, str, position, encoding) { | ||
// fs.writeSync(fd, string[, position[, encoding]]); | ||
@@ -152,3 +146,3 @@ var buf = new Buffer(str, encoding || 'utf8'); | ||
var fsWriteSyncBuffer = function fsWriteSyncBuffer(fd, buffer, off, len, position) { | ||
var fsWriteSyncBuffer = function (fd, buffer, off, len /* , position */) { | ||
off = Math.abs(off | 0); | ||
@@ -189,3 +183,3 @@ len = Math.abs(len | 0); | ||
var originalWriteSync = fs.writeSync; | ||
fs.writeSync = function (fd, data, position, encoding) { | ||
fs.writeSync = function (fd, data /* , position, encoding */) { | ||
if (fd !== 1 && fd !== 2) { | ||
@@ -282,5 +276,12 @@ return originalWriteSync.apply(fs, arguments); | ||
/***/ 17: | ||
/***/ 11: | ||
/***/ (function(module, exports) { | ||
module.exports = require("fs"); | ||
/***/ }), | ||
/***/ 21: | ||
/***/ (function(module, exports) { | ||
function webpackEmptyContext(req) { | ||
@@ -292,7 +293,7 @@ throw new Error("Cannot find module '" + req + "'."); | ||
module.exports = webpackEmptyContext; | ||
webpackEmptyContext.id = 17; | ||
webpackEmptyContext.id = 21; | ||
/***/ }), | ||
/***/ 23: | ||
/***/ 27: | ||
/***/ (function(module, exports) { | ||
@@ -302,23 +303,2 @@ | ||
/***/ }), | ||
/***/ 34: | ||
/***/ (function(module, exports) { | ||
module.exports = require("stream"); | ||
/***/ }), | ||
/***/ 58: | ||
/***/ (function(module, exports) { | ||
module.exports = require("util"); | ||
/***/ }), | ||
/***/ 8: | ||
/***/ (function(module, exports) { | ||
module.exports = require("fs"); | ||
/***/ }) | ||
@@ -325,0 +305,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17219324
152784
248
43