diff --git a/examples/custom-validation/app.js b/examples/custom-validation/app.js index 6262315..72ad9fe 100644 --- a/examples/custom-validation/app.js +++ b/examples/custom-validation/app.js @@ -1,5 +1,5 @@ var React = require('react'); -var Formsy = require('./../..'); +var Formsy = require('formsy-react'); var currentYear = new Date().getFullYear(); @@ -120,4 +120,4 @@ var Validations = React.createClass({ } }); -React.render(, document.getElementById('example')); \ No newline at end of file +React.render(, document.getElementById('example')); diff --git a/examples/login/app.js b/examples/login/app.js index 8b1a4f7..24439c2 100644 --- a/examples/login/app.js +++ b/examples/login/app.js @@ -1,5 +1,5 @@ var React = require('react'); -var Formsy = require('./../..'); +var Formsy = require('formsy-react'); var App = React.createClass({ getInitialState: function() { @@ -34,7 +34,7 @@ var MyOwnInput = React.createClass({ // Add the Formsy Mixin mixins: [Formsy.Mixin], - // setValue() will set the value of the component, which in + // setValue() will set the value of the component, which in // turn will validate it and the rest of the form changeValue: function (event) { this.setValue(event.currentTarget.value); @@ -42,9 +42,9 @@ var MyOwnInput = React.createClass({ render: function () { // Set a specific className based on the validation - // state of this component. showRequired() is true - // when the value is empty and the required prop is - // passed to the input. showError() is true when the + // state of this component. showRequired() is true + // when the value is empty and the required prop is + // passed to the input. showError() is true when the // value typed is invalid var className = this.props.className + ' ' + (this.showRequired() ? 'required' : this.showError() ? 'error' : null); @@ -62,4 +62,4 @@ var MyOwnInput = React.createClass({ } }); -React.render(, document.getElementById('example')); \ No newline at end of file +React.render(, document.getElementById('example')); diff --git a/examples/webpack.config.js b/examples/webpack.config.js index eb06ae3..d306e49 100644 --- a/examples/webpack.config.js +++ b/examples/webpack.config.js @@ -13,8 +13,9 @@ module.exports = { entry: fs.readdirSync(__dirname).reduce(function (entries, dir) { var isDraft = dir.charAt(0) === '_'; - if (!isDraft && isDirectory(path.join(__dirname, dir))) + if (!isDraft && isDirectory(path.join(__dirname, dir))) { entries[dir] = path.join(__dirname, dir, 'app.js'); + } return entries; }, {}), @@ -34,7 +35,7 @@ module.exports = { resolve: { alias: { - 'react-router': '../../modules/index' + 'formsy-react': '../../src/main' } }, @@ -45,4 +46,4 @@ module.exports = { }) ] -}; \ No newline at end of file +}; diff --git a/src/utils.js b/src/utils.js index c034989..074885d 100644 --- a/src/utils.js +++ b/src/utils.js @@ -12,6 +12,7 @@ module.exports = { } return isDifferent; }, + objectsDiffer: function (a, b) { var isDifferent = false; if (Object.keys(a).length !== Object.keys(b).length) { @@ -23,10 +24,10 @@ module.exports = { } }, this); } - return isDifferent; + return isDifferent; }, - isSame: function (a, b) { + isSame: function (a, b) { if (typeof a !== typeof b) { return false; } else if (Array.isArray(a)) {