Permalink
Browse files

Getting rid of underscore dependency.

  • Loading branch information...
1 parent 5f125cf commit d2a3b062780c8d8cca1fc16e5626970d847b0fc5 @molnarg committed Aug 18, 2012
Showing with 4 additions and 7 deletions.
  1. +3 −2 lib/Schema.js
  2. +0 −1 lib/extensions/Array.js
  3. +0 −1 lib/patterns/object.js
  4. +0 −1 lib/patterns/or.js
  5. +1 −2 package.json
View
@@ -1,5 +1,4 @@
var def = require('def.js')
- , _ = require('underscore')
var Schema = module.exports = function() {}
@@ -104,7 +103,9 @@ Schema.extend = function(descriptor) {
this.validate.schema = this.validate
}
- constructor.prototype = _.extend(Object.create(Schema.prototype), descriptor)
+ var prototype = Object.create(Schema.prototype)
+ for (var key in descriptor) prototype[key] = descriptor[key]
+ constructor.prototype = prototype
return constructor
}
@@ -1,7 +1,6 @@
var Schema = require('../Schema')
, EqualitySchema = require('../patterns/equality')
, anything = require('../patterns/anything')
- , _ = require('underscore')
var ArraySchema = module.exports = Schema.extend({
initialize : function(itemSchema, max, min) {
@@ -2,7 +2,6 @@ var Schema = require('../Schema')
, RandExp = require('randexp')
, anything = require('./anything')
, nothing = require('./nothing')
- , _ = require('underscore')
var ObjectSchema = module.exports = Schema.extend({
initialize : function(properties, other) {
View
@@ -1,6 +1,5 @@
var Schema = require('../Schema')
, EqualitySchema = require('../patterns/equality')
- , _ = require('underscore')
var OrSchema = module.exports = Schema.extend({
initialize : function(schemas) {
View
@@ -17,8 +17,7 @@
},
"dependencies": {
"def.js" : "*",
- "randexp" : "*",
- "underscore" : "*"
+ "randexp" : "*"
},
"devDependencies": {},
"engines": {

0 comments on commit d2a3b06

Please sign in to comment.