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

Optimizations #64

Merged
merged 6 commits into from
Feb 22, 2020
Merged
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
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ language: node_js
node_js:
- node
- 12
- 10
- 8

branches:
only:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2019, Jason Mulligan
Copyright (c) 2020, Jason Mulligan
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
23 changes: 2 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Harō is built with ES6+ features, and requires polyfills for ES5 or earlier env
- `Set`
- `Promise`
- `Array.from()` & `Array.is()`
- `Object.fromEntries()`

### How to use
Harō takes two optional arguments, the first is an `Array` of records to set asynchronously, & the second is a
Expand Down Expand Up @@ -813,26 +814,6 @@ store.batch(data, 'set').then(function () {
});
```

**transform(input[, fn])**
_Mixed_

Transforms `Map` to `Object`, `Object` to `Map`, `Set` to `Array`, & `Array` to `Set`. Accepts an optional second parameter to perform the
transformation to simplify cross domain issues.

`haro.transform()` is exposed so that you can either duplicate it into the current context with `toString()` &
`new Function()`, or simply re-implement, for situations where you need to supply the transformation `Function`.

```javascript
const store = haro(null, {key: 'guid', index: ['name']}),
data = [{guid: 'abc', name: 'John Doe', age: 30}, {guid: 'def', name: 'Jane Doe', age: 28}];

store.batch(data, 'set').then(function () {
console.log(store.transform(store.indexes)); // {age: {'28': ['def'], '30': ['abc']}, name: {'John Doe': ['abc'], 'Jane Doe': ['def']}}
}, function (e) {
console.error(e.stack || e.message || e);
});
```

**unload([adapter=mongo, key])**
_Promise_

Expand Down Expand Up @@ -903,5 +884,5 @@ store.batch(data, 'set').then(function () {
```

## License
Copyright (c) 2019 Jason Mulligan
Copyright (c) 2020 Jason Mulligan
Licensed under the BSD-3 license
95 changes: 0 additions & 95 deletions benchmark.js

This file was deleted.

Loading