jsharmony 1.40.11 → 1.40.12

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/clientjs/XExt.js CHANGED
@@ -414,7 +414,8 @@ exports = module.exports = function(jsh){
414
414
  XExt.endsWith = function (str, suffix) {
415
415
  str = (str || '').toString();
416
416
  suffix = (suffix || '').toString();
417
- return str.lastIndexOf(suffix) == (str.length - suffix.length);
417
+ var idx = str.lastIndexOf(suffix);
418
+ return (idx >= 0) && (idx == (str.length - suffix.length));
418
419
  };
419
420
  XExt.beginsWith = function (str, prefix) {
420
421
  return (str||'').toString().indexOf(prefix) === 0;
package/lib/Helper.js CHANGED
@@ -316,7 +316,8 @@ exports.js_proxy_error = function (err) {
316
316
  exports.endsWith = function(str, suffix) {
317
317
  str = (str || '').toString();
318
318
  suffix = (suffix || '').toString();
319
- return str.lastIndexOf(suffix) == (str.length - suffix.length);
319
+ var idx = str.lastIndexOf(suffix);
320
+ return (idx >= 0) && (idx == (str.length - suffix.length));
320
321
  };
321
322
  exports.beginsWith = function (str, prefix) {
322
323
  return str.indexOf(prefix) === 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsharmony",
3
- "version": "1.40.11",
3
+ "version": "1.40.12",
4
4
  "description": "Rapid Application Development (RAD) Platform for Node.js Database Application Development",
5
5
  "main": "index.js",
6
6
  "scripts": {