Skip to content

Commit

Permalink
Merge pull request #1 from mcwhittemore/master
Browse files Browse the repository at this point in the history
Merge from upstream
  • Loading branch information
jmhummel authored Oct 4, 2018
2 parents 59104a5 + d7a91e1 commit 94d766e
Show file tree
Hide file tree
Showing 5 changed files with 287 additions and 3 deletions.
39 changes: 39 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:7.10

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4

working_directory: ~/repo

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: yarn install

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

# run tests!
- run: yarn test


2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var sizeOfValue = module.exports.sizeOfValue = function(v) {
// (length of attribute name) + sum (size of nested elements) + (3 bytes) .
// The size of an empty List or Map is
// (length of attribute name) + (3 bytes).
else if (typeof v === 'object') {
else if (typeof v === 'object' && !(v instanceof Buffer)) {
s += 3
// List value
// Calulates size of elements by
Expand Down
245 changes: 245 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"mocha": "^3.1.2"
},
"name": "dyno-item-size",
"version": "0.1.0",
"version": "0.3.0",
"description": "compute the size of an item the same way dynamodb does",
"main": "index.js",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion test/basic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var dynoItemSize = require('..');

var items = {
string: { content: 'string', size: 12 },
number: { content: 27, size: 11 },
number: { content: 27, size: 10 },
buffer: { content: new Buffer('hi', 'utf8'), size: 8 }
};

Expand Down

0 comments on commit 94d766e

Please sign in to comment.