@@ -3,8 +3,7 @@ import {ascendingDefined, descendingDefined} from "../defined.js";
33import { arrayify , isDomainSort , isOptions , maybeValue , valueof } from "../options.js" ;
44
55/** @jsdoc transform */
6- export function basic ( options = { } , transform ) {
7- let { filter : f1 , sort : s1 , reverse : r1 , transform : t1 , initializer : i1 , ...remainingOptions } = options ;
6+ export function basic ( { filter : f1 , sort : s1 , reverse : r1 , transform : t1 , initializer : i1 , ...options } = { } , transform ) {
87 // If both t1 and t2 are defined, returns a composite transform that first
98 // applies t1 and then applies t2.
109 if ( t1 === undefined ) {
@@ -15,15 +14,14 @@ export function basic(options = {}, transform) {
1514 }
1615 if ( transform != null && i1 != null ) throw new Error ( "transforms cannot be applied after initializers" ) ;
1716 return {
18- ...remainingOptions ,
17+ ...options ,
1918 ...( ( s1 === null || isDomainSort ( s1 ) ) && { sort : s1 } ) ,
2019 transform : composeTransform ( t1 , transform )
2120 } ;
2221}
2322
2423/** @jsdoc initializer */
25- export function initializer ( options = { } , initializer ) {
26- let { filter : f1 , sort : s1 , reverse : r1 , initializer : i1 , ...remainingOptions } = options ;
24+ export function initializer ( { filter : f1 , sort : s1 , reverse : r1 , initializer : i1 , ...options } = { } , initializer ) {
2725 // If both i1 and i2 are defined, returns a composite initializer that first
2826 // applies i1 and then applies i2.
2927 if ( i1 === undefined ) {
@@ -33,7 +31,7 @@ export function initializer(options = {}, initializer) {
3331 if ( r1 ) i1 = composeInitializer ( i1 , reverseTransform ) ;
3432 }
3533 return {
36- ...remainingOptions ,
34+ ...options ,
3735 ...( ( s1 === null || isDomainSort ( s1 ) ) && { sort : s1 } ) ,
3836 initializer : composeInitializer ( i1 , initializer )
3937 } ;
0 commit comments