-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
01b77bf
commit a415d28
Showing
13 changed files
with
634 additions
and
594 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,8 +35,8 @@ [email protected] | |
[email protected] | ||
[email protected] | ||
[email protected] | ||
meteortesting:browser-tests@1.5.3 | ||
meteortesting:mocha@2.1.0 | ||
meteortesting:browser-tests@1.6.0-beta300.0 | ||
meteortesting:mocha@3.1.0-beta300.0 | ||
meteortesting:[email protected] | ||
[email protected] | ||
[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import Ajv from 'ajv' | ||
import SimpleSchema from 'meteor/aldeed:simple-schema' | ||
import { Collection2 } from 'meteor/aldeed:collection2' | ||
export const ajvImpl = () => ({ | ||
name: 'ajv', | ||
is: schema => schema instanceof Ajv, | ||
create: schema => { | ||
const instance = new Ajv() | ||
instance.definition = schema | ||
return instance | ||
}, | ||
extend: (s1, s2) => { | ||
// not impl | ||
return s2 | ||
}, | ||
clean: ({ doc, modifier, schema, userId, isLocalCollection, type }) => { | ||
// not impl | ||
}, | ||
validate: () => {}, | ||
freeze: false | ||
}) | ||
|
||
export const simpleSchemaImpl = () => ({ | ||
name: 'SimpleSchema', | ||
is: schema => SimpleSchema.isSimpleSchema(schema), | ||
create: schema => new SimpleSchema(schema), | ||
extend: (s1, s2) => { | ||
if (s2.version >= 2) { | ||
const ss = new SimpleSchema(s1); | ||
ss.extend(s2); | ||
return ss; | ||
} else { | ||
return new SimpleSchema([s1, s2]); | ||
} | ||
}, | ||
clean: ({ doc, modifier, schema, userId, isLocalCollection, type }) => { | ||
const isModifier = !Collection2.isInsertType(type); | ||
const target = isModifier ? modifier : doc; | ||
schema.clean(target, { | ||
mutate: true, | ||
isModifier, | ||
// We don't do these here because they are done on the client if desired | ||
filter: false, | ||
autoConvert: false, | ||
removeEmptyStrings: false, | ||
trimStrings: false, | ||
extendAutoValueContext: { | ||
isInsert: Collection2.isInsertType(type), | ||
isUpdate: Collection2.isUpdateType(type), | ||
isUpsert: Collection2.isUpdateType(type), | ||
userId, | ||
isFromTrustedCode: false, | ||
docId: doc?._id, | ||
isLocalCollection | ||
} | ||
}) | ||
}, | ||
validate: ({}) => { | ||
|
||
}, | ||
getErrors: () => { | ||
|
||
}, | ||
freeze: false | ||
}) |
Oops, something went wrong.