follicle
Advanced tools
Comparing version 3.0.0-0 to 3.0.0
@@ -55,4 +55,5 @@ "use strict"; | ||
const isSupportedType = t => t === String || t === Number || t === Boolean || t === Buffer || t === Date || t === Array || isArray(t) || t === Object || t instanceof Object || t.prototype instanceof classes.Document || t.prototype instanceof classes.EmbeddedDocument; | ||
const isSupportedType = t => t === String || t === Number || t === Boolean || t === Buffer || t === Date || t === Array || isArray(t) || t === Object || t instanceof Object || t.prototype instanceof classes.Document || t.prototype instanceof classes.EmbeddedDocument; // TODO: isDocument (and similarly isEmbeddedDocument) tests that the argument is an instance OR a constructor of a class that inherits from Document, testing both in the same function is a bit dirty, but refactoring this would be heavy | ||
const isDocument = m => m && (m instanceof classes.Document || m.prototype instanceof classes.Document); | ||
@@ -59,0 +60,0 @@ |
#Changelog | ||
## [3.0.0] 2022-03-16 | ||
### Changed | ||
- Update to NeDB 3 | ||
- Remove compatibility for Node.js below 12 | ||
- Remove RNLocalMongoClient | ||
- Remove experimental readOnly mode for nedb client | ||
- Use async methods in nedb client | ||
- Remove documentClass method and static method on BaseDocument, EmbeddedDocument and Document | ||
- Change how types are tested with instanceof instead of documentClass method which changes instanciation a bit | ||
Rename _migrateCollection static method to migrateCollection (not private) | ||
- Internalized path.join to avoid dependency with path module polyfill | ||
- Rename CamoError to FollicleError | ||
- Remove depd dependency | ||
## [2.0.1] 2021-10-21 | ||
@@ -4,0 +18,0 @@ ### Fixed |
@@ -12,3 +12,3 @@ { | ||
], | ||
"version": "3.0.0-0", | ||
"version": "3.0.0", | ||
"description": "A class-based ES6 ODM for Mongo-like databases. Forked from camo.", | ||
@@ -50,3 +50,3 @@ "author": { | ||
"@babel/preset-env": "^7.16.8", | ||
"@seald-io/nedb": "^3.0.0-6", | ||
"@seald-io/nedb": "^3.0.0", | ||
"centimaitre": "^1.0.4", | ||
@@ -53,0 +53,0 @@ "chai": "^4.3.4", |
@@ -25,3 +25,3 @@ # Follicle | ||
## Why do we need another ODM? | ||
Short answer, we probably don't. Follicle was created for two reasons: to bring traditional-style classes to [MongoDB](https://www.mongodb.com/) JavaScript, and to support [NeDB](https://github.com/louischatriot/nedb) as a backend (which is much like the SQLite-alternative to Mongo). | ||
Short answer, we probably don't. Follicle was created for two reasons: to bring traditional-style classes to [MongoDB](https://www.mongodb.com/) JavaScript, and to support [NeDB](https://github.com/seald/nedb) as a backend (which is much like the SQLite-alternative to Mongo). | ||
@@ -28,0 +28,0 @@ Throughout development this eventually turned in to a library full of [ES6](https://github.com/lukehoban/es6features) features. Coming from a Java background, its easier for me to design and write code in terms of classes, and I suspect this is true for many JavaScript beginners. While ES6 classes don't bring any new functionality to the language, they certainly do make it much easier to jump in to OOP with JavaScript, which is reason enough to warrent a new library, IMO. |
@@ -24,2 +24,3 @@ export const isString = s => typeof s === 'string' | ||
t.prototype instanceof classes.Document || t.prototype instanceof classes.EmbeddedDocument) | ||
// TODO: isDocument (and similarly isEmbeddedDocument) tests that the argument is an instance OR a constructor of a class that inherits from Document, testing both in the same function is a bit dirty, but refactoring this would be heavy | ||
const isDocument = m => m && (m instanceof classes.Document || m.prototype instanceof classes.Document) | ||
@@ -26,0 +27,0 @@ const isEmbeddedDocument = e => e && (e instanceof classes.EmbeddedDocument || e.prototype instanceof classes.EmbeddedDocument) |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
295792
3800
1