Comparing version 0.15.5 to 0.16.0
@@ -1,2 +0,2 @@ | ||
/*! lowdb v0.15.5 */ | ||
/*! lowdb v0.16.0 */ | ||
var low = | ||
@@ -3,0 +3,0 @@ /******/ (function(modules) { // webpackBootstrap |
@@ -1,2 +0,2 @@ | ||
/*! lowdb v0.15.5 */ | ||
/*! lowdb v0.16.0 */ | ||
var low=function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=5)}([function(t,e,r){"use strict";var n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},o=r(4),i=r(3),u=r(2),a=function(t,e,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=a.storage,f=void 0===c?u:c,s=a.format,l=void 0===s?{}:s;return t.source=r,t.storage=n({},i,t.source&&f),t.read=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,n=t.storage.read(e,l.deserialize);return o(n)?n.then(t.plant):t.plant(n)},t.write=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,n=(arguments.length<=1?0:arguments.length-1)?arguments.length<=1?void 0:arguments[1]:t.getState(),i=t.storage.write(e,t.getState(),l.serialize);return o(i)?i.then(function(){return n}):n},t.plant=function(r){return t[e]=r,t},t.getState=function(){return t[e]},t.setState=function(e){return t.plant(e),t.write()},t.read()};t.exports={init:a}},function(t,e){t.exports=_},function(t,e,r){"use strict";t.exports={read:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JSON.parse,r=localStorage.getItem(t);return r?e(r):(localStorage.setItem(t,"{}"),{})},write:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:JSON.stringify;localStorage.setItem(t,r(e))}}},function(t,e,r){"use strict";t.exports={read:function(){return{}},write:function(){return{}}}},function(t,e){function r(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then}t.exports=r},function(t,e,r){"use strict";var n=r(1),o=r(0);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.runInContext(),i=r.chain({});return i._=r,r.prototype.write=r.wrap(r.prototype.value,function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=e.apply(this);return i.write(r,n)}),o.init(i,"__wrapped__",t,e)}}]); |
@@ -126,3 +126,3 @@ # Examples | ||
This particular mode lets you use [lodash/fp](https://github.com/lodash/lodash/wiki/FP-Guide), [Ramda](https://github.com/ramda/ramda) or simple JavaScript functions with lowdb. If you're using Lowdb with a bundler like Webpack or Browserify it can help reducing the size of your bundle.js. | ||
This particular mode lets you use [lodash/fp](https://github.com/lodash/lodash/wiki/FP-Guide), [Ramda](https://github.com/ramda/ramda) or simple JavaScript functions with lowdb. If you're using Lowdb with a bundler like Webpack or Browserify it can help reduce the size of your bundle.js. | ||
@@ -138,2 +138,4 @@ ```js | ||
// replace posts with a new array resulting from concat | ||
// and persist database | ||
posts.write( | ||
@@ -143,5 +145,6 @@ concat({ title: 'lowdb is awesome' }) | ||
// Find post by id | ||
const post = posts( | ||
find({ id: 1 }) | ||
) | ||
``` | ||
``` |
@@ -5,9 +5,6 @@ 'use strict'; | ||
var _require = require('./_json'), | ||
stringify = _require.stringify; | ||
module.exports = { | ||
read: require('./file-sync').read, | ||
write: function fileAsyncWrite(dest, obj) { | ||
var serialize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringify; | ||
var serialize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : JSON.stringify; | ||
@@ -14,0 +11,0 @@ return new Promise(function (resolve, reject) { |
@@ -5,9 +5,5 @@ 'use strict'; | ||
var _require = require('./_json'), | ||
parse = _require.parse, | ||
stringify = _require.stringify; | ||
module.exports = { | ||
read: function fileSyncRead(source) { | ||
var deserialize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : parse; | ||
var deserialize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : JSON.parse; | ||
@@ -33,3 +29,3 @@ if (fs.existsSync(source)) { | ||
write: function fileSyncWrite(dest, obj) { | ||
var serialize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringify; | ||
var serialize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : JSON.stringify; | ||
@@ -36,0 +32,0 @@ var data = serialize(obj); |
{ | ||
"name": "lowdb", | ||
"version": "0.15.5", | ||
"version": "0.16.0", | ||
"description": "JSON database for Node and the browser powered by lodash API", | ||
@@ -24,3 +24,3 @@ "keywords": [ | ||
"tape": "tape -r babel-register -r babel-polyfill test/*.js | tap-spec", | ||
"prepublish": "npm run build", | ||
"prepublish": "npm run build && pkg-ok", | ||
"precommit": "npm test", | ||
@@ -57,2 +57,4 @@ "build": "npm run build:lib && npm run build:dist", | ||
"husky": "^0.13.0", | ||
"lodash-id": "^0.13.0", | ||
"pkg-ok": "^1.0.1", | ||
"ramda": "^0.23.0", | ||
@@ -65,3 +67,2 @@ "rimraf": "^2.5.4", | ||
"tempfile": "^1.1.1", | ||
"underscore-db": "^0.12.0", | ||
"webpack": "^2.2.1" | ||
@@ -68,0 +69,0 @@ }, |
@@ -70,3 +70,3 @@ # Lowdb [![NPM version](https://badge.fury.io/js/lowdb.svg)](http://badge.fury.io/js/lowdb) [![Build Status](https://travis-ci.org/typicode/lowdb.svg?branch=master)](https://travis-ci.org/typicode/lowdb) | ||
* [felony](https://github.com/henryboldi/felony) | ||
* [felony](https://github.com/henryboldi/felony) | ||
* [googlesamples/md2googleslides](https://github.com/googlesamples/md2googleslides) | ||
@@ -145,3 +145,3 @@ * [fb-sleep-stats](https://github.com/sqren/fb-sleep-stats) | ||
Database lodash instance. Use it to add your own utility functions or third-party mixins like [underscore-contrib](https://github.com/documentcloud/underscore-contrib) or [underscore-db](https://github.com/typicode/underscore-db). | ||
Database lodash instance. Use it to add your own utility functions or third-party mixins like [underscore-contrib](https://github.com/documentcloud/underscore-contrib) or [lodash-id](https://github.com/typicode/lodash-id). | ||
@@ -295,3 +295,3 @@ ```js | ||
[underscore-db](https://github.com/typicode/underscore-db) provides a set of helpers for creating and manipulating id-based resources. | ||
[lodash-id](https://github.com/typicode/lodash-id) provides a set of helpers for creating and manipulating id-based resources. | ||
@@ -301,3 +301,3 @@ ```js | ||
db._.mixin(require('underscore-db')) | ||
db._.mixin(require('lodash-id')) | ||
@@ -304,0 +304,0 @@ const postId = db.get('posts').insert({ title: 'low!' }).write().id |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29784
18
17
347