Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Getting rid of underscore dependency.

  • Loading branch information...
commit d2a3b062780c8d8cca1fc16e5626970d847b0fc5 1 parent 5f125cf
@molnarg authored
View
5 lib/Schema.js
@@ -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
}
View
1  lib/extensions/Array.js
@@ -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) {
View
1  lib/patterns/object.js
@@ -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  lib/patterns/or.js
@@ -1,6 +1,5 @@
var Schema = require('../Schema')
, EqualitySchema = require('../patterns/equality')
- , _ = require('underscore')
var OrSchema = module.exports = Schema.extend({
initialize : function(schemas) {
View
3  package.json
@@ -17,8 +17,7 @@
},
"dependencies": {
"def.js" : "*",
- "randexp" : "*",
- "underscore" : "*"
+ "randexp" : "*"
},
"devDependencies": {},
"engines": {
Please sign in to comment.
Something went wrong with that request. Please try again.