Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Feb 10, 2024
1 parent 550e93d commit c9cf45c
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 48 deletions.
74 changes: 37 additions & 37 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/index.js.map

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions lib/ctor.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
* Returns a trap for constructing new array instances.
*
* @private
* @param {Object} ctx - context object
* @param {Function} ctx.array2fancy - function for creating a proxied array
* @param {Function} array2fancy - function for creating a proxied array
* @param {Object} opts - options
* @param {boolean} opts.strict - boolean indicating whether to perform strict bounds checking
* @returns {Function} handler
*/
function factory( ctx ) {
function factory( array2fancy, opts ) {
return constructor;

/**
Expand Down Expand Up @@ -83,7 +84,7 @@ function factory( ctx ) {
// Fallback to using `apply`; however, some constructors may error if the constructor is not callable (i.e., if a constructor always requires `new`):
x = target.apply( null, a );
}
return ctx.array2fancy( x );
return array2fancy( x, opts );
}
}

Expand Down
7 changes: 3 additions & 4 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,10 @@ function array2fancy( x ) {
'strict': opts.strict,
'validator': validator( dt ),
'array2fancy': array2fancy,
'ctor': null
'ctor': new Proxy( x.constructor || Array, {
'construct': ctor( array2fancy, opts )
})
};
o.ctor = new Proxy( x.constructor || Array, {
'construct': ctor( o )
});
return new Proxy( x, {
'get': get( o ),
'set': set( o )
Expand Down

0 comments on commit c9cf45c

Please sign in to comment.