diff --git a/can-validate/can-validate.js b/can-validate/can-validate.js index b505f02a..9aa219e0 100644 --- a/can-validate/can-validate.js +++ b/can-validate/can-validate.js @@ -34,10 +34,12 @@ * */ -import can from 'can'; +import ns from 'can-util/namespace'; +import Construct from 'can-construct'; +import canDev from 'can-util/js/dev/'; // add methods to can -var Validate = can.Construct.extend({ +var Validate = Construct.extend({ /* * @description The current validator ID to use when can.validate methods are called. @@ -96,7 +98,7 @@ var Validate = can.Construct.extend({ isValid: function () { //!steal-remove-start if (!this._validatorId) { - can.dev.warn('A validator library is required for can.validate to work properly.'); + canDev.warn('A validator library is required for can.validate to work properly.'); } //!steal-remove-end return this.validator().isValid.apply(this, arguments); @@ -118,7 +120,7 @@ var Validate = can.Construct.extend({ once: function () { //!steal-remove-start if (!this._validatorId) { - can.dev.warn('A validator library is required for can.validate to work properly.'); + canDev.warn('A validator library is required for can.validate to work properly.'); } //!steal-remove-end return this.validator().once.apply(this, arguments); @@ -139,16 +141,16 @@ var Validate = can.Construct.extend({ var validateArgs = arguments; //!steal-remove-start if (!this._validatorId) { - can.dev.warn('A validator library is required for can.validate to work properly.'); + canDev.warn('A validator library is required for can.validate to work properly.'); } if (typeof arguments[0] !== 'object') { - can.dev.warn('Attempting to pass single value to validate, use can.validator.once instead.'); + canDev.warn('Attempting to pass single value to validate, use can.validator.once instead.'); } //!steal-remove-end return this.validator().validate.apply(this, validateArgs); } }, {}); -can.validate = Validate; +ns.validate = Validate; -export default can; +export default Validate; diff --git a/can-validate/demo.html b/can-validate/demo.html index 7b2eb885..5b7f7953 100644 --- a/can-validate/demo.html +++ b/can-validate/demo.html @@ -13,7 +13,7 @@