Skip to content

Commit 9c222dd

Browse files
committed
3.0.0
1 parent 6e9a50b commit 9c222dd

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

CHANGELOG.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
11
# Changelog
22

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+
315
## 2.3.2
416

517
### Patch Changes
618

719
- Fixed return for custom params method [#44](https://github.com/d34dman/drupal-jsonapi-params/pull/44).
820

9-
1021
## 2.3.1
1122

1223
### Patch Changes
1324

1425
- Dev dependency update.
15-
26+
1627
## 2.3.0
1728

1829
### Minor Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "drupal-jsonapi-params",
3-
"version": "2.3.2",
3+
"version": "3.0.0",
44
"description": "Drupal JSON-API params",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",

src/__tests__/CustomParam.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test('Custom parameters', () => {
99
expect(api.getQueryString({ encode: false })).toBe('foo[bar]=baz&bar[0]=a&bar[1]=b&bar[2]=c');
1010
api.clear();
1111
expect(api.getQueryString()).toBe('');
12-
expect(api.addCustomParam({ foo: 'bar' })).toBeInstanceOf(DrupalJsonApiParams)
12+
expect(api.addCustomParam({ foo: 'bar' })).toBeInstanceOf(DrupalJsonApiParams);
1313
});
1414

1515
test("Nova's Ark with custom params", () => {

src/index.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export interface DrupalJsonApiParamsInterface {
6060
getQueryObject(): object;
6161
}
6262
export class DrupalJsonApiParams implements DrupalJsonApiParamsInterface {
63-
6463
protected data: DrupalJsonApiParamsStore = {
6564
filter: {},
6665
include: [],
@@ -395,19 +394,19 @@ export class DrupalJsonApiParams implements DrupalJsonApiParamsInterface {
395394
*/
396395
public getQueryObject(): ParamBag<any> {
397396
const foo: ParamBag<any> = JSON.parse(JSON.stringify(this.data));
398-
397+
399398
if (this.data.include.length > 0) {
400-
foo.include = this.data.include.join(",");
399+
foo.include = this.data.include.join(',');
401400
} else {
402401
delete foo.include;
403402
}
404-
403+
405404
if (this.data.sort.length > 0) {
406-
foo.sort = this.data.sort.join(",");
405+
foo.sort = this.data.sort.join(',');
407406
} else {
408407
delete foo.sort;
409408
}
410-
409+
411410
return foo;
412411
}
413412

0 commit comments

Comments
 (0)