ru.coon 3.0.61 → 3.0.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/validator.js CHANGED
@@ -115,11 +115,15 @@ Ext.define('Coon.validator', {
115
115
  },
116
116
 
117
117
  }, function() {
118
+ const fnCache = {};
118
119
  this.assert = new Proxy(this, {
119
120
  get: function(target, name) {
120
121
  if (!name.startsWith('is_')) {
121
122
  return target[name];
122
123
  }
124
+ if (fnCache[name]) {
125
+ return fnCache[name];
126
+ }
123
127
  const tokens = name.slice(3)
124
128
  .split('_')
125
129
  .map((name) => {
@@ -157,10 +161,11 @@ Ext.define('Coon.validator', {
157
161
  return tested;
158
162
  };
159
163
  }
160
- return (value) => Coon.util.chained(
164
+ const validatorHandler = (value) => Coon.util.chained(
161
165
  tokens.map((el) => el.fn),
162
166
  {value, steps: []}
163
167
  );
168
+ return fnCache[name] = validatorHandler;
164
169
  },
165
170
  });
166
171
  });
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '3.0.61',
3
+ number: '3.0.62',
4
4
  });