Comparing version 6.0.0-alpha.1 to 6.0.0-alpha.2
@@ -7,12 +7,16 @@ var gulp = require('gulp'), | ||
var tsProject = typescript.createProject('tsconfig.json', { | ||
var tsProjectLib = typescript.createProject('tsconfig.json', { | ||
typescript: require('typescript') | ||
}); | ||
var tsProjectTest = typescript.createProject('test/tsconfig.json', { | ||
typescript: require('typescript') | ||
}); | ||
gulp.task('build', ['build-lib', 'build-tests']); | ||
function build(files) { | ||
function build(files, project) { | ||
var tsResult = gulp.src(files, { base: paths.projectRoot }) | ||
.pipe(sourcemaps.init()) | ||
.pipe(typescript(tsProject)); | ||
.pipe(typescript(project)); | ||
@@ -25,7 +29,7 @@ return tsResult.js | ||
gulp.task('build-lib', function () { | ||
return build(paths.buildFiles); | ||
return build(paths.buildFiles, tsProjectLib); | ||
}); | ||
gulp.task('build-tests', function () { | ||
return build(paths.testFiles); | ||
return build(paths.testFiles, tsProjectTest); | ||
}); |
@@ -7,4 +7,4 @@ var path = require('path'); | ||
buildFiles: ["lib/**/*.ts", "index.ts"], | ||
testFiles: ["test/**/*.ts"], | ||
buildFiles: ["typings/DefinitelyTyped/tsd.d.ts", "lib/**/*.ts", "index.ts"], | ||
testFiles: ["typings/DefinitelyTyped/tsd.d.ts", "test/**/*.ts"], | ||
cleanFiles: ["coverage", "dist"], | ||
@@ -17,3 +17,3 @@ | ||
docSourceFiles: [ | ||
"_references.d.ts", | ||
"typings/DefinitelyTyped/tsd.d.ts", | ||
"lib/Core.ts", | ||
@@ -20,0 +20,0 @@ "lib/Model.ts", |
var MongoDB = require('mongodb'); | ||
var _ = require('lodash'); | ||
var skmatc = require('skmatc'); | ||
var Skmatc = require('skmatc'); | ||
/** | ||
@@ -46,3 +46,3 @@ * Specifies the name of the collection to which this instance's documents should be sent. | ||
return function (target) { | ||
target.validators = (target.validators || []).concat(skmatc.create(function (schema) { return schema === forType; }, validate)); | ||
target.validators = (target.validators || []).concat(Skmatc.create(function (schema) { return schema === forType; }, validate)); | ||
}; | ||
@@ -49,0 +49,0 @@ } |
var _ = require('lodash'); | ||
var MongoDB = require('mongodb'); | ||
var Bluebird = require('bluebird'); | ||
var skmatc = require('skmatc'); | ||
var Skmatc = require('skmatc'); | ||
/** | ||
@@ -267,3 +267,3 @@ * The default Iridium Instance implementation which provides methods for saving, refreshing and | ||
Instance.validators = [ | ||
skmatc.create(function (schema) { return schema === MongoDB.ObjectID; }, function (schema, data) { | ||
Skmatc.create(function (schema) { return schema === MongoDB.ObjectID; }, function (schema, data) { | ||
return this.assert(!data || data instanceof MongoDB.ObjectID || (data._bsontype === 'ObjectID' && data.id)); | ||
@@ -270,0 +270,0 @@ }, { name: 'ObjectID validation' }) |
@@ -1,2 +0,2 @@ | ||
var skmatc = require('skmatc'); | ||
var Skmatc = require('skmatc'); | ||
var Omnom_1 = require('./utils/Omnom'); | ||
@@ -14,3 +14,3 @@ var _ = require('lodash'); | ||
this.model = model; | ||
this._validator = new skmatc(model.schema); | ||
this._validator = Skmatc.scope(model.schema); | ||
model.validators.forEach(function (validator) { return _this._validator.register(validator); }); | ||
@@ -17,0 +17,0 @@ } |
import MongoDB = require('mongodb'); | ||
import _ = require('lodash'); | ||
import skmatc = require('skmatc'); | ||
import Skmatc = require('skmatc'); | ||
import {Instance} from './Instance'; | ||
@@ -52,3 +52,3 @@ import {Index, IndexSpecification} from './Index'; | ||
return function(target: InstanceImplementation<any,any>) { | ||
target.validators = (target.validators || []).concat(skmatc.create(schema => schema === forType, validate)); | ||
target.validators = (target.validators || []).concat(Skmatc.create(schema => schema === forType, validate)); | ||
} | ||
@@ -55,0 +55,0 @@ } |
@@ -14,3 +14,3 @@ import {Core} from './Core'; | ||
import Bluebird = require('bluebird'); | ||
import skmatc = require('skmatc'); | ||
import Skmatc = require('skmatc'); | ||
@@ -112,3 +112,3 @@ /** | ||
static validators: Skmatc.Validator[] = [ | ||
skmatc.create(schema => schema === MongoDB.ObjectID, function(schema, data) { | ||
Skmatc.create(schema => schema === MongoDB.ObjectID, function(schema, data) { | ||
return this.assert(!data || data instanceof MongoDB.ObjectID || (data._bsontype === 'ObjectID' && data.id)); | ||
@@ -115,0 +115,0 @@ }, { name: 'ObjectID validation' }) |
@@ -0,1 +1,2 @@ | ||
import Skmatc = require('skmatc'); | ||
import {Schema} from './Schema'; | ||
@@ -2,0 +3,0 @@ import {Model} from './Model'; |
@@ -5,2 +5,3 @@ import MongoDB = require('mongodb'); | ||
import _ = require('lodash'); | ||
import Skmatc = require('skmatc'); | ||
@@ -7,0 +8,0 @@ import {Core} from './Core'; |
@@ -7,2 +7,3 @@ import {Core} from './Core'; | ||
import Skmatc = require('skmatc'); | ||
import _ = require('lodash'); | ||
@@ -9,0 +10,0 @@ import MongoDB = require('mongodb'); |
import MongoDB = require('mongodb'); | ||
import {Model} from './Model'; | ||
import skmatc = require('skmatc'); | ||
import Skmatc = require('skmatc'); | ||
import {Omnom} from './utils/Omnom'; | ||
@@ -16,3 +16,3 @@ import _ = require('lodash'); | ||
constructor(public model: Model<TDocument, TInstance>) { | ||
this._validator = new skmatc(model.schema); | ||
this._validator = Skmatc.scope(model.schema); | ||
model.validators.forEach(validator => this._validator.register(validator)); | ||
@@ -19,0 +19,0 @@ } |
import {Core} from './Core'; | ||
import {Model} from './Model'; | ||
import Skmatc = require('skmatc'); | ||
@@ -4,0 +5,0 @@ export interface Plugin { |
{ | ||
"name": "iridium", | ||
"version": "6.0.0-alpha.1", | ||
"version": "6.0.0-alpha.2", | ||
"author": "Benjamin Pannell <admin@sierrasoftworks.com>", | ||
@@ -27,5 +27,3 @@ "description": "A custom lightweight ORM for MongoDB designed for power-users", | ||
}, | ||
"typescript": { | ||
"definition": "iridium.d.ts" | ||
}, | ||
"typings": "index.d.ts", | ||
"engines": { | ||
@@ -38,3 +36,3 @@ "node": ">= 0.10" | ||
"mongodb": "^2.0.44", | ||
"skmatc": "^1.1.2" | ||
"skmatc": "^1.1.4" | ||
}, | ||
@@ -41,0 +39,0 @@ "devDependencies": { |
@@ -12,5 +12,5 @@ { | ||
"files": [ | ||
"_references.d.ts", | ||
"typings/DefinitelyTyped/tsd.d.ts", | ||
"index.ts" | ||
] | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
1179688
190
5974
Updatedskmatc@^1.1.4