File tree Expand file tree Collapse file tree 4 files changed +20
-10
lines changed Expand file tree Collapse file tree 4 files changed +20
-10
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## 3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - - ** BREAKING CHANGE** : Changed internal properties and methods from ` private ` to ` protected ` to enable inheritance scenarios
8
+ - ` data ` property is now accessible to subclasses for query state management
9
+ - ` qsOptions ` property is now accessible to subclasses for query string options
10
+ - ` config ` property is now accessible to subclasses for configuration settings
11
+ - ` generateKeyName ` method is now accessible to subclasses
12
+ - ` getIndexId ` method is now accessible to subclasses
13
+ - This change affects consumers who subclass ` DrupalJsonApiParams `
14
+
3
15
## 2.3.2
4
16
5
17
### Patch Changes
6
18
7
19
- Fixed return for custom params method [ #44 ] ( https://github.com/d34dman/drupal-jsonapi-params/pull/44 ) .
8
20
9
-
10
21
## 2.3.1
11
22
12
23
### Patch Changes
13
24
14
25
- Dev dependency update.
15
-
26
+
16
27
## 2.3.0
17
28
18
29
### Minor Changes
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " drupal-jsonapi-params" ,
3
- "version" : " 2.3.2 " ,
3
+ "version" : " 3.0.0 " ,
4
4
"description" : " Drupal JSON-API params" ,
5
5
"main" : " lib/index.js" ,
6
6
"types" : " lib/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ test('Custom parameters', () => {
9
9
expect ( api . getQueryString ( { encode : false } ) ) . toBe ( 'foo[bar]=baz&bar[0]=a&bar[1]=b&bar[2]=c' ) ;
10
10
api . clear ( ) ;
11
11
expect ( api . getQueryString ( ) ) . toBe ( '' ) ;
12
- expect ( api . addCustomParam ( { foo : 'bar' } ) ) . toBeInstanceOf ( DrupalJsonApiParams )
12
+ expect ( api . addCustomParam ( { foo : 'bar' } ) ) . toBeInstanceOf ( DrupalJsonApiParams ) ;
13
13
} ) ;
14
14
15
15
test ( "Nova's Ark with custom params" , ( ) => {
Original file line number Diff line number Diff line change @@ -60,7 +60,6 @@ export interface DrupalJsonApiParamsInterface {
60
60
getQueryObject ( ) : object ;
61
61
}
62
62
export class DrupalJsonApiParams implements DrupalJsonApiParamsInterface {
63
-
64
63
protected data : DrupalJsonApiParamsStore = {
65
64
filter : { } ,
66
65
include : [ ] ,
@@ -395,19 +394,19 @@ export class DrupalJsonApiParams implements DrupalJsonApiParamsInterface {
395
394
*/
396
395
public getQueryObject ( ) : ParamBag < any > {
397
396
const foo : ParamBag < any > = JSON . parse ( JSON . stringify ( this . data ) ) ;
398
-
397
+
399
398
if ( this . data . include . length > 0 ) {
400
- foo . include = this . data . include . join ( "," ) ;
399
+ foo . include = this . data . include . join ( ',' ) ;
401
400
} else {
402
401
delete foo . include ;
403
402
}
404
-
403
+
405
404
if ( this . data . sort . length > 0 ) {
406
- foo . sort = this . data . sort . join ( "," ) ;
405
+ foo . sort = this . data . sort . join ( ',' ) ;
407
406
} else {
408
407
delete foo . sort ;
409
408
}
410
-
409
+
411
410
return foo ;
412
411
}
413
412
You can’t perform that action at this time.
0 commit comments