Skip to content

Commit 36937d0

Browse files
committed
update nodejs externs
1 parent 2ce2b34 commit 36937d0

23 files changed

+2040
-7939
lines changed

javascript/externs/nodejs/assert.js

Lines changed: 65 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,184 +1,142 @@
1-
// Automatically generated from TypeScript type definitions provided by
2-
// DefinitelyTyped (https://github.com/DefinitelyTyped/DefinitelyTyped),
3-
// which is licensed under the MIT license; see file DefinitelyTyped-LICENSE
4-
// in parent directory.
5-
// Type definitions for Node.js 10.5.x
6-
// Project: http://nodejs.org/
7-
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>
8-
// DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>
9-
// Parambir Singh <https://github.com/parambirs>
10-
// Christian Vaagland Tellnes <https://github.com/tellnes>
11-
// Wilco Bakker <https://github.com/WilcoBakker>
12-
// Nicolas Voigt <https://github.com/octo-sniffle>
13-
// Chigozirim C. <https://github.com/smac89>
14-
// Flarna <https://github.com/Flarna>
15-
// Mariusz Wiktorczyk <https://github.com/mwiktorczyk>
16-
// wwwy3y3 <https://github.com/wwwy3y3>
17-
// Deividas Bakanas <https://github.com/DeividasBakanas>
18-
// Kelvin Jin <https://github.com/kjin>
19-
// Alvis HT Tang <https://github.com/alvis>
20-
// Sebastian Silbermann <https://github.com/eps1lon>
21-
// Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>
22-
// Alberto Schiabel <https://github.com/jkomyno>
23-
// Klaus Meinhardt <https://github.com/ajafff>
24-
// Huw <https://github.com/hoo29>
25-
// Nicolas Even <https://github.com/n-e>
26-
// Bruno Scheufler <https://github.com/brunoscheufler>
27-
// Mohsen Azimi <https://github.com/mohsen1>
28-
// Hoàng Văn Khải <https://github.com/KSXGitHub>
29-
// Alexander T. <https://github.com/a-tarasyuk>
30-
// Lishude <https://github.com/islishude>
31-
// Andrew Makarov <https://github.com/r3nya>
32-
// Zane Hannan AU <https://github.com/ZaneHannanAU>
33-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
1+
/*
2+
* Copyright 2012 The Closure Compiler Authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
3416

3517
/**
36-
* @externs
37-
* @fileoverview Definitions for module "assert"
18+
* @fileoverview Definitions for node's assert module
19+
* @see http://nodejs.org/api/assert.html
20+
* @see https://github.com/joyent/node/blob/master/lib/assert.js
3821
*/
3922

4023
/**
4124
* @param {*} value
42-
* @param {string=} message
25+
* @param {string} message
4326
* @return {void}
27+
* @throws {assert.AssertionError}
4428
*/
45-
var internal = function(value, message) {};
46-
47-
var internal = internal || {};
29+
var assert = function(value, message) {};
4830

4931
/**
50-
* @param {{message: string, actual: *, expected: *, operator: string, stackStartFunction: Function}=} options
51-
* @return {internal.AssertionError}
32+
* @param {{message: string, actual: *, expected: *, operator: string}} options
5233
* @constructor
34+
* @extends Error
5335
*/
54-
internal.AssertionError = function(options) {};
55-
56-
/**
57-
* @type {string}
58-
*/
59-
internal.AssertionError.prototype.name;
60-
61-
/**
62-
* @type {string}
63-
*/
64-
internal.AssertionError.prototype.message;
65-
66-
/**
67-
* @type {*}
68-
*/
69-
internal.AssertionError.prototype.actual;
36+
assert.AssertionError = function(options) {};
7037

7138
/**
72-
* @type {*}
39+
* @return {string}
7340
*/
74-
internal.AssertionError.prototype.expected;
41+
assert.AssertionError.prototype.toString;
7542

7643
/**
77-
* @type {string}
78-
*/
79-
internal.AssertionError.prototype.operator;
80-
81-
/**
82-
* @type {boolean}
44+
* @param {*} value
45+
* @param {string=} message
46+
* @return {void}
47+
* @throws {assert.AssertionError}
8348
*/
84-
internal.AssertionError.prototype.generatedMessage;
49+
assert.ok;
8550

8651
/**
8752
* @param {*} actual
8853
* @param {*} expected
8954
* @param {string} message
9055
* @param {string} operator
9156
* @return {void}
57+
* @throws {assert.AssertionError}
9258
*/
93-
internal.fail = function(actual, expected, message, operator) {};
94-
95-
/**
96-
* @param {*} value
97-
* @param {string=} message
98-
* @return {void}
99-
*/
100-
internal.ok = function(value, message) {};
59+
assert.fail;
10160

10261
/**
10362
* @param {*} actual
10463
* @param {*} expected
105-
* @param {string=} message
64+
* @param {string} message
10665
* @return {void}
66+
* @throws {assert.AssertionError}
10767
*/
108-
internal.equal = function(actual, expected, message) {};
68+
assert.equal;
10969

11070
/**
11171
* @param {*} actual
11272
* @param {*} expected
113-
* @param {string=} message
73+
* @param {string} message
11474
* @return {void}
75+
* @throws {assert.AssertionError}
11576
*/
116-
internal.notEqual = function(actual, expected, message) {};
77+
assert.notEqual;
11778

11879
/**
11980
* @param {*} actual
12081
* @param {*} expected
121-
* @param {string=} message
82+
* @param {string} message
12283
* @return {void}
84+
* @throws {assert.AssertionError}
12385
*/
124-
internal.deepEqual = function(actual, expected, message) {};
86+
assert.deepEqual;
12587

12688
/**
127-
* @param {*} acutal
89+
* @param {*} actual
12890
* @param {*} expected
129-
* @param {string=} message
91+
* @param {string} message
13092
* @return {void}
93+
* @throws {assert.AssertionError}
13194
*/
132-
internal.notDeepEqual = function(acutal, expected, message) {};
95+
assert.notDeepEqual;
13396

13497
/**
13598
* @param {*} actual
13699
* @param {*} expected
137-
* @param {string=} message
100+
* @param {string} message
138101
* @return {void}
102+
* @throws {assert.AssertionError}
139103
*/
140-
internal.strictEqual = function(actual, expected, message) {};
104+
assert.strictEqual;
141105

142106
/**
143107
* @param {*} actual
144108
* @param {*} expected
145-
* @param {string=} message
109+
* @param {string} message
146110
* @return {void}
111+
* @throws {assert.AssertionError}
147112
*/
148-
internal.notStrictEqual = function(actual, expected, message) {};
113+
assert.notStrictEqual;
149114

150115
/**
151-
* @param {*} actual
152-
* @param {*} expected
116+
* @name assert.throws
117+
* @function
118+
* @param {function()} block
119+
* @param {Function|RegExp|function(*)} error
153120
* @param {string=} message
154121
* @return {void}
122+
* @throws {assert.AssertionError}
155123
*/
156-
internal.deepStrictEqual = function(actual, expected, message) {};
124+
assert.throws;
157125

158126
/**
159-
* @param {*} actual
160-
* @param {*} expected
127+
* @param {function()} block
128+
* @param {Function|RegExp|function(*)} error
161129
* @param {string=} message
162130
* @return {void}
131+
* @throws {assert.AssertionError}
163132
*/
164-
internal.notDeepStrictEqual = function(actual, expected, message) {};
165-
166-
/**
167-
* @type {(function(Function, string=): void)|(function(Function, Function, string=): void)|(function(Function, RegExp, string=): void)|(function(Function, (function(*): boolean), string=): void)}
168-
*/
169-
internal.throws;
170-
171-
/**
172-
* @type {(function(Function, string=): void)|(function(Function, Function, string=): void)|(function(Function, RegExp, string=): void)|(function(Function, (function(*): boolean), string=): void)}
173-
*/
174-
internal.doesNotThrow;
133+
assert.doesNotThrow;
175134

176135
/**
177136
* @param {*} value
178137
* @return {void}
138+
* @throws {assert.AssertionError}
179139
*/
180-
internal.ifError = function(value) {};
181-
182-
183-
module.exports = internal;
140+
assert.ifError;
184141

142+
module.exports = assert;

0 commit comments

Comments
 (0)