Skip to content

Commit d26812b

Browse files
committed
Add xxxOrThrow functions to specialised Belt Map and Set data structures
1 parent e1d0104 commit d26812b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+132
-56
lines changed

lib/es6/Belt_MapInt.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ let getUndefined = Belt_internalMapInt.getUndefined;
218218

219219
let getWithDefault = Belt_internalMapInt.getWithDefault;
220220

221-
let getExn = Belt_internalMapInt.getExn;
221+
let getExn = Belt_internalMapInt.getOrThrow;
222+
223+
let getOrThrow = Belt_internalMapInt.getOrThrow;
222224

223225
let checkInvariantInternal = Belt_internalAVLtree.checkInvariantInternal;
224226

@@ -282,6 +284,7 @@ export {
282284
getUndefined,
283285
getWithDefault,
284286
getExn,
287+
getOrThrow,
285288
checkInvariantInternal,
286289
remove,
287290
removeMany,

lib/es6/Belt_MapString.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ let getUndefined = Belt_internalMapString.getUndefined;
218218

219219
let getWithDefault = Belt_internalMapString.getWithDefault;
220220

221-
let getExn = Belt_internalMapString.getExn;
221+
let getExn = Belt_internalMapString.getOrThrow;
222+
223+
let getOrThrow = Belt_internalMapString.getOrThrow;
222224

223225
let checkInvariantInternal = Belt_internalAVLtree.checkInvariantInternal;
224226

@@ -282,6 +284,7 @@ export {
282284
getUndefined,
283285
getWithDefault,
284286
getExn,
287+
getOrThrow,
285288
checkInvariantInternal,
286289
remove,
287290
removeMany,

lib/es6/Belt_MutableMapInt.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ function getWithDefault(d, x, def) {
272272
return Belt_internalMapInt.getWithDefault(d.data, x, def);
273273
}
274274

275-
function getExn(d, x) {
276-
return Belt_internalMapInt.getExn(d.data, x);
275+
function getOrThrow(d, x) {
276+
return Belt_internalMapInt.getOrThrow(d.data, x);
277277
}
278278

279279
let cmpU = cmp;
@@ -288,6 +288,8 @@ let everyU = every;
288288

289289
let someU = some;
290290

291+
let getExn = getOrThrow;
292+
291293
let updateU = update;
292294

293295
let mapU = map;
@@ -329,6 +331,7 @@ export {
329331
getUndefined,
330332
getWithDefault,
331333
getExn,
334+
getOrThrow,
332335
checkInvariantInternal,
333336
remove,
334337
removeMany,

lib/es6/Belt_MutableMapString.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ function getWithDefault(d, x, def) {
272272
return Belt_internalMapString.getWithDefault(d.data, x, def);
273273
}
274274

275-
function getExn(d, x) {
276-
return Belt_internalMapString.getExn(d.data, x);
275+
function getOrThrow(d, x) {
276+
return Belt_internalMapString.getOrThrow(d.data, x);
277277
}
278278

279279
let cmpU = cmp;
@@ -288,6 +288,8 @@ let everyU = every;
288288

289289
let someU = some;
290290

291+
let getExn = getOrThrow;
292+
291293
let updateU = update;
292294

293295
let mapU = map;
@@ -329,6 +331,7 @@ export {
329331
getUndefined,
330332
getWithDefault,
331333
getExn,
334+
getOrThrow,
332335
checkInvariantInternal,
333336
remove,
334337
removeMany,

lib/es6/Belt_MutableSetInt.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ function getUndefined(d, x) {
270270
return Belt_internalSetInt.getUndefined(d.data, x);
271271
}
272272

273-
function getExn(d, x) {
274-
return Belt_internalSetInt.getExn(d.data, x);
273+
function getOrThrow(d, x) {
274+
return Belt_internalSetInt.getOrThrow(d.data, x);
275275
}
276276

277277
function split(d, key) {
@@ -442,6 +442,8 @@ let keepU = keep;
442442

443443
let partitionU = partition;
444444

445+
let getExn = getOrThrow;
446+
445447
export {
446448
make,
447449
fromArray,
@@ -483,6 +485,7 @@ export {
483485
get,
484486
getUndefined,
485487
getExn,
488+
getOrThrow,
486489
split,
487490
checkInvariantInternal,
488491
}

lib/es6/Belt_MutableSetString.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ function getUndefined(d, x) {
270270
return Belt_internalSetString.getUndefined(d.data, x);
271271
}
272272

273-
function getExn(d, x) {
274-
return Belt_internalSetString.getExn(d.data, x);
273+
function getOrThrow(d, x) {
274+
return Belt_internalSetString.getOrThrow(d.data, x);
275275
}
276276

277277
function split(d, key) {
@@ -442,6 +442,8 @@ let keepU = keep;
442442

443443
let partitionU = partition;
444444

445+
let getExn = getOrThrow;
446+
445447
export {
446448
make,
447449
fromArray,
@@ -483,6 +485,7 @@ export {
483485
get,
484486
getUndefined,
485487
getExn,
488+
getOrThrow,
486489
split,
487490
checkInvariantInternal,
488491
}

lib/es6/Belt_SetInt.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@ let get = Belt_internalSetInt.get;
311311

312312
let getUndefined = Belt_internalSetInt.getUndefined;
313313

314-
let getExn = Belt_internalSetInt.getExn;
314+
let getExn = Belt_internalSetInt.getOrThrow;
315+
316+
let getOrThrow = Belt_internalSetInt.getOrThrow;
315317

316318
let checkInvariantInternal = Belt_internalAVLset.checkInvariantInternal;
317319

@@ -353,6 +355,7 @@ export {
353355
get,
354356
getUndefined,
355357
getExn,
358+
getOrThrow,
356359
split,
357360
checkInvariantInternal,
358361
}

lib/es6/Belt_SetString.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@ let get = Belt_internalSetString.get;
311311

312312
let getUndefined = Belt_internalSetString.getUndefined;
313313

314-
let getExn = Belt_internalSetString.getExn;
314+
let getExn = Belt_internalSetString.getOrThrow;
315+
316+
let getOrThrow = Belt_internalSetString.getOrThrow;
315317

316318
let checkInvariantInternal = Belt_internalAVLset.checkInvariantInternal;
317319

@@ -353,6 +355,7 @@ export {
353355
get,
354356
getUndefined,
355357
getExn,
358+
getOrThrow,
356359
split,
357360
checkInvariantInternal,
358361
}

lib/es6/Belt_internalMapInt.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function getUndefined(_n, x) {
5151
};
5252
}
5353

54-
function getExn(_n, x) {
54+
function getOrThrow(_n, x) {
5555
while (true) {
5656
let n = _n;
5757
if (n !== undefined) {
@@ -336,7 +336,7 @@ export {
336336
add,
337337
get,
338338
getUndefined,
339-
getExn,
339+
getOrThrow,
340340
getWithDefault,
341341
has,
342342
remove,

lib/es6/Belt_internalMapString.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function getUndefined(_n, x) {
5151
};
5252
}
5353

54-
function getExn(_n, x) {
54+
function getOrThrow(_n, x) {
5555
while (true) {
5656
let n = _n;
5757
if (n !== undefined) {
@@ -336,7 +336,7 @@ export {
336336
add,
337337
get,
338338
getUndefined,
339-
getExn,
339+
getOrThrow,
340340
getWithDefault,
341341
has,
342342
remove,

0 commit comments

Comments
 (0)