Skip to content

Commit

Permalink
release 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jankapunkt committed Feb 24, 2025
1 parent 04a0a13 commit eecbe1c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 27 deletions.
39 changes: 19 additions & 20 deletions .versions
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
allow-deny@2.0.0
babel-compiler@7.11.0
allow-deny@2.1.0
babel-compiler@7.11.3
babel-runtime@1.5.2
base64@1.0.13
binary-heap@1.0.12
boilerplate-generator@2.0.0
callback-hook@1.6.0
check@1.4.2
check@1.4.4
core-runtime@1.0.0
ddp@1.4.2
ddp-client@3.0.1
ddp-client@3.1.0
ddp-common@1.4.4
ddp-server@3.0.1
ddp-server@3.1.0
diff-sequence@1.1.3
dynamic-import@0.7.4
ecmascript@0.16.9
ecmascript-runtime@0.8.2
ecmascript@0.16.10
ecmascript-runtime@0.8.3
ecmascript-runtime-client@0.12.2
ecmascript-runtime-server@0.11.1
ejson@1.1.4
Expand All @@ -23,21 +23,21 @@ fetch@0.1.5
geojson-utils@1.0.12
id-map@1.2.0
inter-process-messaging@0.1.2
leaonline:collection-factory@2.0.0
local-test:leaonline:collection-factory@2.0.0
leaonline:collection-factory@2.1.0
local-test:leaonline:collection-factory@2.1.0
logging@1.3.5
meteor@2.0.1
meteor@2.1.0
meteortesting:browser-tests@0.1.2
meteortesting:mocha@0.4.4
minimongo@2.0.1
modern-browsers@0.1.11
modules@0.20.1
minimongo@2.0.2
modern-browsers@0.2.0
modules@0.20.3
modules-runtime@0.13.2
mongo@2.0.1
mongo-decimal@0.1.4-beta300.7
mongo@2.1.0
mongo-decimal@0.2.0
mongo-dev-server@1.1.1
mongo-id@1.0.9
npm-mongo@4.17.4
npm-mongo@6.10.2
ordered-dict@1.2.0
practicalmeteor:mocha-core@1.0.1
promise@1.0.0
Expand All @@ -46,9 +46,8 @@ react-fast-refresh@0.2.9
reload@1.3.2
retry@1.1.1
routepolicy@1.1.2
socket-stream-client@0.5.3
socket-stream-client@0.6.0
tracker@1.3.4
typescript@5.4.3
underscore@1.6.4
webapp@2.0.1
typescript@5.6.3
webapp@2.0.5
webapp-hashing@1.1.2
15 changes: 9 additions & 6 deletions collection-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const allModifications = {
remove: () => false
}

const defined = x => typeof x !== 'undefined'

/**
* Creates a new collection factory function by given options.
* @param custom {Mongo.Collection?} a custom class extending Mongo.Collection
Expand Down Expand Up @@ -72,19 +74,20 @@ export const createCollectionFactory = ({ custom, schemaFactory } = {}) => {
defineMutationMethods
} = options

const collectionOptions = {}
if (defined(connection)) collectionOptions.connection = connection
if (defined(idGeneration)) collectionOptions.idGeneration = idGeneration
if (defined(transform)) collectionOptions.transform = transform
if (defined(defineMutationMethods)) collectionOptions.defineMutationMethods = defineMutationMethods

// 1. this is the most basic creation of the collection
// as shown in the Meteor documentation:
// https://docs.meteor.com/api/collections.html#Mongo-Collection
//
// 2. if we pass an already existing collection, we do not create
// a new collection but use it to attach schema etc. which
// can be required for collections, such as Meteor.users
const product = collection || new ProductConstructor(name, {
connection,
idGeneration,
transform,
defineMutationMethods
})
const product = collection || new ProductConstructor(name, collectionOptions)

// by default every client modification is denied
product.deny(allModifications)
Expand Down
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env meteor */
Package.describe({
name: 'leaonline:collection-factory',
version: '2.0.0',
version: '2.1.0',
// Brief, one-line summary of the package.
summary: 'Create Mongo collections. Isomorphic. Lightweight. Simple.',
// URL to the Git repository containing the source code for this package.
Expand Down

0 comments on commit eecbe1c

Please sign in to comment.