You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit removes the `bifurcateIn` symbol from the `@stdlib/utils`
namespace due to a package migration.
BREAKING CHANGE: remove `bifurcateIn`
To migrate, users should access the same symbol via the
`@stdlib/object` namespace.
Ref: #8755
* Splits an object's own and inherited property values into two groups according to a predicate function.
442
-
*
443
-
* ## Notes
444
-
*
445
-
* - When invoked, the predicate function is provided two arguments:
446
-
*
447
-
* - `value`: object value
448
-
* - `key`: object key
449
-
*
450
-
* - If a predicate function returns a truthy value, a value is placed in the first group; otherwise, a value is placed in the second group.
451
-
*
452
-
* - If provided an empty object with no prototype, the function returns an empty array.
453
-
*
454
-
* - The function iterates over an object's own and inherited properties.
455
-
*
456
-
* - Key iteration order is *not* guaranteed, and, thus, result order is *not* guaranteed.
457
-
*
458
-
* @param obj - input object
459
-
* @param options - function options
460
-
* @param options.thisArg - execution context
461
-
* @param options.returns - if `'values'`, values are returned; if `'keys'`, keys are returned; if `'*'`, both keys and values are returned (default: 'values')
462
-
* @param predicate - predicate function indicating which group an element in the input object belongs to
463
-
* @returns group results
464
-
*
465
-
* @example
466
-
* function predicate( v ) {
467
-
* return v[ 0 ] === 'b';
468
-
* }
469
-
*
470
-
* function Foo() {
471
-
* this.a = 'beep';
472
-
* this.b = 'boop';
473
-
* return this;
474
-
* }
475
-
*
476
-
* Foo.prototype = Object.create( null );
477
-
* Foo.prototype.c = 'foo';
478
-
* Foo.prototype.d = 'bar';
479
-
*
480
-
* var obj = new Foo();
481
-
*
482
-
* var opts = {
483
-
* 'returns': 'keys'
484
-
* };
485
-
* var out = ns.bifurcateIn( obj, opts, predicate );
486
-
* // e.g., returns [ [ 'a', 'b', 'd' ], [ 'c' ] ]
487
-
*
488
-
* @example
489
-
* function predicate( v ) {
490
-
* return v[ 0 ] === 'b';
491
-
* }
492
-
*
493
-
* function Foo() {
494
-
* this.a = 'beep';
495
-
* this.b = 'boop';
496
-
* return this;
497
-
* }
498
-
*
499
-
* Foo.prototype = Object.create( null );
500
-
* Foo.prototype.c = 'foo';
501
-
* Foo.prototype.d = 'bar';
502
-
*
503
-
* var obj = new Foo();
504
-
*
505
-
* var opts = {
506
-
* 'returns': '*'
507
-
* };
508
-
* var out = ns.bifurcateIn( obj, opts, predicate );
0 commit comments