can-validate-legacy
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -60,4 +60,6 @@ var dev = require("can-util/js/dev/dev"); | ||
//!steal-remove-start | ||
if (!this._validatorId) { | ||
dev.warn('A validator library is required for can.validate to work properly.'); | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (!this._validatorId) { | ||
dev.warn('A validator library is required for can.validate to work properly.'); | ||
} | ||
} | ||
@@ -82,4 +84,6 @@ //!steal-remove-end | ||
//!steal-remove-start | ||
if (!this._validatorId) { | ||
dev.warn('A validator library is required for can.validate to work properly.'); | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (!this._validatorId) { | ||
dev.warn('A validator library is required for can.validate to work properly.'); | ||
} | ||
} | ||
@@ -102,8 +106,10 @@ //!steal-remove-end | ||
//!steal-remove-start | ||
if (!this._validatorId) { | ||
dev.warn('A validator library is required for can.validate to work properly.'); | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (!this._validatorId) { | ||
dev.warn('A validator library is required for can.validate to work properly.'); | ||
} | ||
if (typeof arguments[0] !== 'object') { | ||
dev.warn('Attempting to pass single value to validate, use can.validator.once instead.'); | ||
} | ||
} | ||
if (typeof arguments[0] !== 'object') { | ||
dev.warn('Attempting to pass single value to validate, use can.validator.once instead.'); | ||
} | ||
//!steal-remove-end | ||
@@ -110,0 +116,0 @@ return this.validator().validate.apply(this, validateArgs); |
@@ -1,2 +0,2 @@ | ||
/*can-validate-legacy@1.2.0#can-validate*/ | ||
/*can-validate-legacy@1.2.1#can-validate*/ | ||
define([ | ||
@@ -3,0 +3,0 @@ 'require', |
@@ -1,2 +0,2 @@ | ||
/*can-validate-legacy@1.2.0#map/validate/validate*/ | ||
/*can-validate-legacy@1.2.1#map/validate/validate*/ | ||
define([ | ||
@@ -6,3 +6,3 @@ 'require', | ||
'module', | ||
'jquery', | ||
'can-assign', | ||
'can-util/namespace', | ||
@@ -15,3 +15,3 @@ 'can-map', | ||
], function (require, exports, module) { | ||
var $ = require('jquery'); | ||
var assign = require('can-assign'); | ||
var namespace = require('can-util/namespace'); | ||
@@ -23,2 +23,10 @@ var Map = require('can-map'); | ||
var compute = require('can-compute'); | ||
var deepAssign = function () { | ||
var objects = [].slice.call(arguments); | ||
var out = {}; | ||
for (var i = 0; i < objects.length; i++) { | ||
assign(out, objects[i]); | ||
} | ||
return out; | ||
}; | ||
var proto = Map.prototype; | ||
@@ -83,3 +91,3 @@ var oldSet = proto.__set; | ||
} else { | ||
validateOpts = $.extend({}, getPropDefineBehavior('validate', key, this.define)); | ||
validateOpts = assign({}, getPropDefineBehavior('validate', key, this.define)); | ||
propIniting = true; | ||
@@ -89,3 +97,3 @@ } | ||
if (propIniting) { | ||
validateOpts = $.extend({}, defaultValidationOpts, validateOpts, this._processValidateOpts({ | ||
validateOpts = deepAssign(defaultValidationOpts, validateOpts, this._processValidateOpts({ | ||
key: key, | ||
@@ -113,3 +121,3 @@ value: value | ||
}; | ||
$.extend(Map.prototype, { | ||
assign(Map.prototype, { | ||
_initValidation: function () { | ||
@@ -146,3 +154,3 @@ var self = this; | ||
var allowSet = true; | ||
errors = validate.once(item.value, $.extend({}, opts), item.key); | ||
errors = validate.once(item.value, assign({}, opts), item.key); | ||
if (errors && errors.length > 0) { | ||
@@ -170,3 +178,3 @@ if (!this.attr('errors')) { | ||
if (typeof item === 'function') { | ||
var newCompute = compute($.proxy(item, self)); | ||
var newCompute = compute(item.bind(self)); | ||
computes.push({ | ||
@@ -173,0 +181,0 @@ key: key, |
@@ -1,2 +0,2 @@ | ||
/*can-validate-legacy@1.2.0#shims/validatejs*/ | ||
/*can-validate-legacy@1.2.1#shims/validatejs*/ | ||
define([ | ||
@@ -3,0 +3,0 @@ 'require', |
@@ -1,2 +0,2 @@ | ||
/*can-validate-legacy@1.2.0#can-validate*/ | ||
/*can-validate-legacy@1.2.1#can-validate*/ | ||
var dev = require('can-util/js/dev/dev'); | ||
@@ -3,0 +3,0 @@ var namespace = require('can-util/namespace'); |
@@ -1,3 +0,3 @@ | ||
/*can-validate-legacy@1.2.0#map/validate/validate*/ | ||
var $ = require('jquery'); | ||
/*can-validate-legacy@1.2.1#map/validate/validate*/ | ||
var assign = require('can-assign'); | ||
var namespace = require('can-util/namespace'); | ||
@@ -9,2 +9,10 @@ var Map = require('can-map'); | ||
var compute = require('can-compute'); | ||
var deepAssign = function () { | ||
var objects = [].slice.call(arguments); | ||
var out = {}; | ||
for (var i = 0; i < objects.length; i++) { | ||
assign(out, objects[i]); | ||
} | ||
return out; | ||
}; | ||
var proto = Map.prototype; | ||
@@ -69,3 +77,3 @@ var oldSet = proto.__set; | ||
} else { | ||
validateOpts = $.extend({}, getPropDefineBehavior('validate', key, this.define)); | ||
validateOpts = assign({}, getPropDefineBehavior('validate', key, this.define)); | ||
propIniting = true; | ||
@@ -75,3 +83,3 @@ } | ||
if (propIniting) { | ||
validateOpts = $.extend({}, defaultValidationOpts, validateOpts, this._processValidateOpts({ | ||
validateOpts = deepAssign(defaultValidationOpts, validateOpts, this._processValidateOpts({ | ||
key: key, | ||
@@ -99,3 +107,3 @@ value: value | ||
}; | ||
$.extend(Map.prototype, { | ||
assign(Map.prototype, { | ||
_initValidation: function () { | ||
@@ -132,3 +140,3 @@ var self = this; | ||
var allowSet = true; | ||
errors = validate.once(item.value, $.extend({}, opts), item.key); | ||
errors = validate.once(item.value, assign({}, opts), item.key); | ||
if (errors && errors.length > 0) { | ||
@@ -156,3 +164,3 @@ if (!this.attr('errors')) { | ||
if (typeof item === 'function') { | ||
var newCompute = compute($.proxy(item, self)); | ||
var newCompute = compute(item.bind(self)); | ||
computes.push({ | ||
@@ -159,0 +167,0 @@ key: key, |
@@ -1,2 +0,2 @@ | ||
/*can-validate-legacy@1.2.0#shims/validatejs*/ | ||
/*can-validate-legacy@1.2.1#shims/validatejs*/ | ||
var validate = require('../can-validate.js'); | ||
@@ -3,0 +3,0 @@ var validatejs = require('validate.js'); |
@@ -0,1 +1,33 @@ | ||
/*[process-shim]*/ | ||
(function(global, env) { | ||
// jshint ignore:line | ||
if (typeof process === "undefined") { | ||
global.process = { | ||
argv: [], | ||
cwd: function() { | ||
return ""; | ||
}, | ||
browser: true, | ||
env: { | ||
NODE_ENV: env || "development" | ||
}, | ||
version: "", | ||
platform: | ||
global.navigator && | ||
global.navigator.userAgent && | ||
/Windows/.test(global.navigator.userAgent) | ||
? "win" | ||
: "" | ||
}; | ||
} | ||
})( | ||
typeof self == "object" && self.Object == Object | ||
? self | ||
: typeof process === "object" && | ||
Object.prototype.toString.call(process) === "[object process]" | ||
? global | ||
: window, | ||
"development" | ||
); | ||
/*[global-shim-start]*/ | ||
@@ -123,3 +155,8 @@ (function(exports, global, doEval) { | ||
{}, | ||
typeof self == "object" && self.Object == Object ? self : window, | ||
typeof self == "object" && self.Object == Object | ||
? self | ||
: typeof process === "object" && | ||
Object.prototype.toString.call(process) === "[object process]" | ||
? global | ||
: window, | ||
function(__$source__, __$global__) { | ||
@@ -131,3 +168,3 @@ // jshint ignore:line | ||
/*can-validate-legacy@1.2.0#can-validate*/ | ||
/*can-validate-legacy@1.2.1#can-validate*/ | ||
define('can-validate-legacy', [ | ||
@@ -166,3 +203,3 @@ 'require', | ||
}); | ||
/*can-validate-legacy@1.2.0#map/validate/validate*/ | ||
/*can-validate-legacy@1.2.1#map/validate/validate*/ | ||
define('can-validate-legacy/map/validate/validate', [ | ||
@@ -172,3 +209,3 @@ 'require', | ||
'module', | ||
'jquery', | ||
'can-assign', | ||
'can-util/namespace', | ||
@@ -181,3 +218,3 @@ 'can-map', | ||
], function (require, exports, module) { | ||
var $ = require('jquery'); | ||
var assign = require('can-assign'); | ||
var namespace = require('can-util/namespace'); | ||
@@ -189,2 +226,10 @@ var Map = require('can-map'); | ||
var compute = require('can-compute'); | ||
var deepAssign = function () { | ||
var objects = [].slice.call(arguments); | ||
var out = {}; | ||
for (var i = 0; i < objects.length; i++) { | ||
assign(out, objects[i]); | ||
} | ||
return out; | ||
}; | ||
var proto = Map.prototype; | ||
@@ -249,3 +294,3 @@ var oldSet = proto.__set; | ||
} else { | ||
validateOpts = $.extend({}, getPropDefineBehavior('validate', key, this.define)); | ||
validateOpts = assign({}, getPropDefineBehavior('validate', key, this.define)); | ||
propIniting = true; | ||
@@ -255,3 +300,3 @@ } | ||
if (propIniting) { | ||
validateOpts = $.extend({}, defaultValidationOpts, validateOpts, this._processValidateOpts({ | ||
validateOpts = deepAssign(defaultValidationOpts, validateOpts, this._processValidateOpts({ | ||
key: key, | ||
@@ -279,3 +324,3 @@ value: value | ||
}; | ||
$.extend(Map.prototype, { | ||
assign(Map.prototype, { | ||
_initValidation: function () { | ||
@@ -312,3 +357,3 @@ var self = this; | ||
var allowSet = true; | ||
errors = validate.once(item.value, $.extend({}, opts), item.key); | ||
errors = validate.once(item.value, assign({}, opts), item.key); | ||
if (errors && errors.length > 0) { | ||
@@ -336,3 +381,3 @@ if (!this.attr('errors')) { | ||
if (typeof item === 'function') { | ||
var newCompute = compute($.proxy(item, self)); | ||
var newCompute = compute(item.bind(self)); | ||
computes.push({ | ||
@@ -376,3 +421,3 @@ key: key, | ||
}); | ||
/*can-validate-legacy@1.2.0#shims/validatejs*/ | ||
/*can-validate-legacy@1.2.1#shims/validatejs*/ | ||
define('can-validate-legacy/shims/validatejs', [ | ||
@@ -458,3 +503,3 @@ 'require', | ||
} | ||
)(typeof self == "object" && self.Object == Object ? self : window); | ||
)(typeof self == "object" && self.Object == Object ? self : (typeof process === "object" && Object.prototype.toString.call(process) === "[object process]") ? global : window); | ||
//# sourceMappingURL=can-validate-build.js.map |
@@ -57,3 +57,3 @@ @module {Object} can-validate-legacy | ||
```javascript | ||
import 'can-validate-legacy/map/validate'; | ||
import 'can-validate-legacy/map/validate/validate'; | ||
import 'can/map/define/define'; | ||
@@ -60,0 +60,0 @@ ``` |
@@ -1,2 +0,2 @@ | ||
var $ = require("jquery"); | ||
var assign = require("can-assign"); | ||
var namespace = require("can-util/namespace"); | ||
@@ -9,2 +9,13 @@ var Map = require("can-map"); | ||
var deepAssign = function() { | ||
var objects = [].slice.call(arguments); | ||
var out = {}; | ||
for (var i=0; i<objects.length; i++) { | ||
assign(out, objects[i]); | ||
} | ||
return out; | ||
}; | ||
var proto = Map.prototype; | ||
@@ -92,3 +103,3 @@ var oldSet = proto.__set; | ||
// Copy current prop"s validation properties to cache | ||
validateOpts = $.extend({}, getPropDefineBehavior("validate", key, this.define)); | ||
validateOpts = assign({}, getPropDefineBehavior("validate", key, this.define)); | ||
// Need to build computes in the next step | ||
@@ -102,3 +113,3 @@ propIniting = true; | ||
if (propIniting) { | ||
validateOpts = $.extend({}, | ||
validateOpts = deepAssign( | ||
defaultValidationOpts, | ||
@@ -132,3 +143,3 @@ validateOpts, | ||
}; | ||
$.extend(Map.prototype, { | ||
assign(Map.prototype, { | ||
_initValidation: function () { | ||
@@ -202,3 +213,3 @@ var self = this; | ||
// run validation | ||
errors = validate.once(item.value, $.extend({}, opts), item.key); | ||
errors = validate.once(item.value, assign({}, opts), item.key); | ||
@@ -251,3 +262,3 @@ // Process errors if we got them | ||
// create compute and add it to computes array | ||
var newCompute = compute($.proxy(item, self)); | ||
var newCompute = compute(item.bind(self)); | ||
computes.push({key: key, compute: newCompute}); | ||
@@ -254,0 +265,0 @@ processedObj[key] = newCompute; |
{ | ||
"name": "can-validate-legacy", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"main": "can-validate.js", | ||
@@ -12,3 +12,3 @@ "description": "Validation plugin for CanJS that provides an abstraction layer to your validation library of choice (Shim may be required).", | ||
"test": "npm run detect-cycle && npm run jshint && npm run testee", | ||
"jshint": "jshint *.js --config", | ||
"jshint": "jshint *.js map/**/*.js --config", | ||
"release:pre": "npm version prerelease && npm run build && npm publish --tag=pre", | ||
@@ -74,2 +74,3 @@ "release:patch": "npm version patch && npm run build && npm publish", | ||
"dependencies": { | ||
"can-assign": "^1.1.1", | ||
"can-util": "^3.9.0", | ||
@@ -76,0 +77,0 @@ "validate.js": "<0.12.0" |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
122559
1771
1
3
42
3
+ Addedcan-assign@^1.1.1