Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating vulnerable packages #272

Open
wants to merge 3 commits into
base: v2.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var_1: &cache_key yarn-cache-{{ checksum "yarn.lock" }}
jobs:
lint:
docker:
- image: circleci/node:8.11.4
- image: circleci/node:10.0.0
steps:
- checkout
- restore_cache:
Expand All @@ -23,7 +23,7 @@ jobs:

test:
docker:
- image: circleci/node:8.11.4
- image: circleci/node:10.0.0
steps:
- checkout
- restore_cache:
Expand All @@ -45,7 +45,7 @@ jobs:

build:
docker:
- image: circleci/node:8.11.4
- image: circleci/node:10.0.0
working_directory: ~/repo
steps:
- run: yarn
Expand Down
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"prettier-md": "yarn prettier-md:show --write",
"prettier-md:show": "prettier --parser markdown --single-quote es5 --tab-width 4 --print-width 140 --single-quote true --prose-wrap never \"**/*.md\"",
"prettier-scss": "yarn prettier-scss:show --write",
"prettier-scss:show": "prettier --parser scss --single-quote es5 --tab-width 4 --print-width 140 --single-quote true \"**/*.scss\"",
"precommit": "lint-staged"
"prettier-scss:show": "prettier --parser scss --single-quote es5 --tab-width 4 --print-width 140 --single-quote true \"**/*.scss\""
},
"lint-staged": {
"*.ts": [
Expand All @@ -52,7 +51,8 @@
"package.json": [
"node ./scripts/yarn-install.js",
"git add yarn.lock"
]
],
"*.{js,css,md}": "prettier --write"
},
"engines": {
"node": ">=8.6.0",
Expand Down Expand Up @@ -125,14 +125,15 @@
"gh-pages": "^1.1.0",
"glob": "^7.1.2",
"hammerjs": "^2.0.8",
"husky": ">=4",
"jasmine": "^2.5.3",
"jasmine-core": "~2.5.2",
"jasmine-marbles": "^0.0.2",
"jasmine-spec-reporter": "~3.2.0",
"jest": "^24.9.0",
"jest-preset-angular": "^7.1.1",
"jest-zone-patch": "^0.0.10",
"lint-staged": "7.2.2",
"lint-staged": ">=10",
"module-alias": "^2.0.0",
"ncp": "^2.0.0",
"nyc": "^14.1.1",
Expand All @@ -156,5 +157,10 @@
"dexie": "^2.0.4",
"lodash": "^4.17.15",
"rxjs": "^6.2"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}
11 changes: 8 additions & 3 deletions src/cloned-document-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,20 @@ export class ClonedDocumentResource {
}
let parent_included = this.parent_resource_object.included;
this.resource_object.included = this.resource_object.included.filter(included_resource => {
return !isEqual(included_resource, parent_included.find(include => include.id === included_resource.id));
return !isEqual(
included_resource,
parent_included.find(include => include.id === included_resource.id)
);
});
this.resource_object.included = this.resource_object.included.map(included => {
if (!parent_included.find(include => include.id === included.id)) {
return included;
}

return new ClonedDocumentResource(included, parent_included.find(include => include.id === included.id)).getResourceObject()
.data;
return new ClonedDocumentResource(
included,
parent_included.find(include => include.id === included.id)
).getResourceObject().data;
});

return this;
Expand Down
5 changes: 4 additions & 1 deletion src/cloned-resource.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ describe('ClonedResource save', () => {
id: '123456',
relationships: {
books: {
data: [{ id: '1', type: 'books' }, { id: '2', type: 'books' }]
data: [
{ id: '1', type: 'books' },
{ id: '2', type: 'books' }
]
}
},
type: 'authors'
Expand Down
5 changes: 4 additions & 1 deletion src/service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,10 @@ describe('service.get()', () => {
});

it(`no cached resource emits source ^new-server|`, async () => {
let expected = [{ loaded: false, source: 'new' }, { loaded: true, source: 'server' }];
let expected = [
{ loaded: false, source: 'new' },
{ loaded: true, source: 'server' }
];

test_response_subject.next(new HttpResponse({ body: TestFactory.getResourceDocumentData(Book) }));
let book_emits = await booksService
Expand Down
7 changes: 4 additions & 3 deletions src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,10 @@ export class Service<R extends Resource = Resource> {
json_ripper.saveCollection(path.getForCache(), temporary_collection, path.includes);
if (Core.injectedServices.rsJsonapiConfig.cachestore_support && params.store_cache_method === 'compact') {
// @todo migrate to dexie
Core.injectedServices.JsonapiStoreService.saveCollection(path.getForCache() + '.compact', <ICacheableDataCollection>(
success
));
Core.injectedServices.JsonapiStoreService.saveCollection(
path.getForCache() + '.compact',
<ICacheableDataCollection>success
);
}
subject.next(temporary_collection);
setTimeout(() => subject.complete(), 0);
Expand Down
5 changes: 4 additions & 1 deletion src/services/json-ripper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,10 @@ describe('JsonRipper for collections', () => {
type: 'authors',
relationships: {
books: {
data: [{ id: '1', type: 'books' }, { id: '2', type: 'books' }]
data: [
{ id: '1', type: 'books' },
{ id: '2', type: 'books' }
]
}
}
});
Expand Down
6 changes: 3 additions & 3 deletions src/tests/factories/test-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ export class TestFactory {
}

// NOTE: add photos
author.relationships.photos.data = author.relationships.photos.data.concat(<Array<Photo>>(
this.getDataResourcesWithType('photos', 2)
));
author.relationships.photos.data = author.relationships.photos.data.concat(
<Array<Photo>>this.getDataResourcesWithType('photos', 2)
);
if (include.includes('photos')) {
this.includeFromService(author, 'photos', Photo);
}
Expand Down
10 changes: 8 additions & 2 deletions src/tests/get-resource.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ describe('core methods', () => {
test_resource.id = '1';
test_resource.attributes = { name: 'test_name' };
test_resource.relationships.test_resource.data = { id: '2', type: 'test_resources' };
test_resource.relationships.test_resources.data = [{ id: '3', type: 'test_resources' }, { id: '4', type: 'test_resources' }];
test_resource.relationships.test_resources.data = [
{ id: '3', type: 'test_resources' },
{ id: '4', type: 'test_resources' }
];

// nested relationship
let test_resource_nested_relationship = new TestResource();
Expand Down Expand Up @@ -167,7 +170,10 @@ describe('core methods', () => {
test_resource.id = '1';
test_resource.attributes = { name: 'test_name' };
test_resource.relationships.test_resource.data = { id: '2', type: 'test_resources' };
test_resource.relationships.test_resources.data = [{ id: '3', type: 'test_resources' }, { id: '4', type: 'test_resources' }];
test_resource.relationships.test_resources.data = [
{ id: '3', type: 'test_resources' },
{ id: '4', type: 'test_resources' }
];

// format has_one relationship to include
let test_resource_has_one_relationship = new TestResource();
Expand Down
Loading