add hw2
This commit is contained in:
		
							
								
								
									
										9
									
								
								node_modules/vscode-languageserver/lib/common/utils/is.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								node_modules/vscode-languageserver/lib/common/utils/is.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| export declare function boolean(value: any): value is boolean; | ||||
| export declare function string(value: any): value is string; | ||||
| export declare function number(value: any): value is number; | ||||
| export declare function error(value: any): value is Error; | ||||
| export declare function func(value: any): value is Function; | ||||
| export declare function array<T>(value: any): value is T[]; | ||||
| export declare function stringArray(value: any): value is string[]; | ||||
| export declare function typedArray<T>(value: any, check: (value: any) => boolean): value is T[]; | ||||
| export declare function thenable<T>(value: any): value is Thenable<T>; | ||||
							
								
								
									
										43
									
								
								node_modules/vscode-languageserver/lib/common/utils/is.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								node_modules/vscode-languageserver/lib/common/utils/is.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,43 @@ | ||||
| "use strict"; | ||||
| /* -------------------------------------------------------------------------------------------- | ||||
|  * Copyright (c) Microsoft Corporation. All rights reserved. | ||||
|  * Licensed under the MIT License. See License.txt in the project root for license information. | ||||
|  * ------------------------------------------------------------------------------------------ */ | ||||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||||
| exports.thenable = exports.typedArray = exports.stringArray = exports.array = exports.func = exports.error = exports.number = exports.string = exports.boolean = void 0; | ||||
| function boolean(value) { | ||||
|     return value === true || value === false; | ||||
| } | ||||
| exports.boolean = boolean; | ||||
| function string(value) { | ||||
|     return typeof value === 'string' || value instanceof String; | ||||
| } | ||||
| exports.string = string; | ||||
| function number(value) { | ||||
|     return typeof value === 'number' || value instanceof Number; | ||||
| } | ||||
| exports.number = number; | ||||
| function error(value) { | ||||
|     return value instanceof Error; | ||||
| } | ||||
| exports.error = error; | ||||
| function func(value) { | ||||
|     return typeof value === 'function'; | ||||
| } | ||||
| exports.func = func; | ||||
| function array(value) { | ||||
|     return Array.isArray(value); | ||||
| } | ||||
| exports.array = array; | ||||
| function stringArray(value) { | ||||
|     return array(value) && value.every(elem => string(elem)); | ||||
| } | ||||
| exports.stringArray = stringArray; | ||||
| function typedArray(value, check) { | ||||
|     return Array.isArray(value) && value.every(check); | ||||
| } | ||||
| exports.typedArray = typedArray; | ||||
| function thenable(value) { | ||||
|     return value && func(value.then); | ||||
| } | ||||
| exports.thenable = thenable; | ||||
							
								
								
									
										22
									
								
								node_modules/vscode-languageserver/lib/common/utils/uuid.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								node_modules/vscode-languageserver/lib/common/utils/uuid.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | ||||
| /** | ||||
|  * Represents a UUID as defined by rfc4122. | ||||
|  */ | ||||
| export interface UUID { | ||||
|     /** | ||||
|      * @returns the canonical representation in sets of hexadecimal numbers separated by dashes. | ||||
|      */ | ||||
|     asHex(): string; | ||||
|     equals(other: UUID): boolean; | ||||
| } | ||||
| /** | ||||
|  * An empty UUID that contains only zeros. | ||||
|  */ | ||||
| export declare const empty: UUID; | ||||
| export declare function v4(): UUID; | ||||
| export declare function isUUID(value: string): boolean; | ||||
| /** | ||||
|  * Parses a UUID that is of the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. | ||||
|  * @param value A uuid string. | ||||
|  */ | ||||
| export declare function parse(value: string): UUID; | ||||
| export declare function generateUuid(): string; | ||||
							
								
								
									
										97
									
								
								node_modules/vscode-languageserver/lib/common/utils/uuid.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										97
									
								
								node_modules/vscode-languageserver/lib/common/utils/uuid.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,97 @@ | ||||
| "use strict"; | ||||
| /*--------------------------------------------------------------------------------------------- | ||||
|  *  Copyright (c) Microsoft Corporation. All rights reserved. | ||||
|  *  Licensed under the MIT License. See License.txt in the project root for license information. | ||||
|  *--------------------------------------------------------------------------------------------*/ | ||||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||||
| exports.generateUuid = exports.parse = exports.isUUID = exports.v4 = exports.empty = void 0; | ||||
| class ValueUUID { | ||||
|     constructor(_value) { | ||||
|         this._value = _value; | ||||
|         // empty | ||||
|     } | ||||
|     asHex() { | ||||
|         return this._value; | ||||
|     } | ||||
|     equals(other) { | ||||
|         return this.asHex() === other.asHex(); | ||||
|     } | ||||
| } | ||||
| class V4UUID extends ValueUUID { | ||||
|     static _oneOf(array) { | ||||
|         return array[Math.floor(array.length * Math.random())]; | ||||
|     } | ||||
|     static _randomHex() { | ||||
|         return V4UUID._oneOf(V4UUID._chars); | ||||
|     } | ||||
|     constructor() { | ||||
|         super([ | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             '-', | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             '-', | ||||
|             '4', | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             '-', | ||||
|             V4UUID._oneOf(V4UUID._timeHighBits), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             '-', | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|             V4UUID._randomHex(), | ||||
|         ].join('')); | ||||
|     } | ||||
| } | ||||
| 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']; | ||||
| /** | ||||
|  * An empty UUID that contains only zeros. | ||||
|  */ | ||||
| exports.empty = new ValueUUID('00000000-0000-0000-0000-000000000000'); | ||||
| function v4() { | ||||
|     return new V4UUID(); | ||||
| } | ||||
| exports.v4 = v4; | ||||
| const _UUIDPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; | ||||
| function isUUID(value) { | ||||
|     return _UUIDPattern.test(value); | ||||
| } | ||||
| exports.isUUID = isUUID; | ||||
| /** | ||||
|  * Parses a UUID that is of the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. | ||||
|  * @param value A uuid string. | ||||
|  */ | ||||
| function parse(value) { | ||||
|     if (!isUUID(value)) { | ||||
|         throw new Error('invalid uuid'); | ||||
|     } | ||||
|     return new ValueUUID(value); | ||||
| } | ||||
| exports.parse = parse; | ||||
| function generateUuid() { | ||||
|     return v4().asHex(); | ||||
| } | ||||
| exports.generateUuid = generateUuid; | ||||
		Reference in New Issue
	
	Block a user
	 nik
					nik