Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
dpinol committed Jun 16, 2021
1 parent 9e59832 commit 69c5a7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/botonic-plugin-contentful-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ jobs:
run: (cd ./packages/$PACKAGE && npm install -D)
- name: Build
run: (cd ./packages/$PACKAGE && npm run build_unit_tests)
- name: Verify lint
run: (cd ./packages/$PACKAGE && npm run lint_ci)
- name: Run tests
env:
CONTENTFUL_TEST_SPACE_ID: ${{ secrets.CONTENTFUL_TEST_SPACE_ID }}
CONTENTFUL_TEST_TOKEN: ${{ secrets.CONTENTFUL_TEST_TOKEN }}
CONTENTFUL_TEST_MANAGE_TOKEN: ${{ secrets.CONTENTFUL_TEST_MANAGE_TOKEN }}
run: (cd ./packages/$PACKAGE && npm run test)
- name: Verify lint
run: (cd ./packages/$PACKAGE && npm run lint_ci)

- name: Upload coverage to codecov
uses: codecov/codecov-action@v1
Expand Down
4 changes: 3 additions & 1 deletion packages/botonic-plugin-contentful/src/util/objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ export function roughSizeOfObject(object: any): number {
bytes = value.length * 2
} else if (typeof value === 'number') {
bytes = 8
} else if (value == null) {
//this branch is required because typeof null = 'object'
bytes = 0
} else if (typeof value === 'object' && objectList.indexOf(value) === -1) {
objectList.push(value)

for (const [k, v] of Object.entries(value)) {
bytes += 8 // an assumed existence overhead
bytes += recurse(k)
Expand Down

0 comments on commit 69c5a7b

Please sign in to comment.