jsharmony 1.40.10 → 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 +4 -1
- package/lib/Helper.js +4 -1
- package/package.json +1 -1
- package/public/js/jsHarmony.js +1 -1
package/clientjs/XExt.js
CHANGED
|
@@ -412,7 +412,10 @@ exports = module.exports = function(jsh){
|
|
|
412
412
|
};
|
|
413
413
|
|
|
414
414
|
XExt.endsWith = function (str, suffix) {
|
|
415
|
-
|
|
415
|
+
str = (str || '').toString();
|
|
416
|
+
suffix = (suffix || '').toString();
|
|
417
|
+
var idx = str.lastIndexOf(suffix);
|
|
418
|
+
return (idx >= 0) && (idx == (str.length - suffix.length));
|
|
416
419
|
};
|
|
417
420
|
XExt.beginsWith = function (str, prefix) {
|
|
418
421
|
return (str||'').toString().indexOf(prefix) === 0;
|
package/lib/Helper.js
CHANGED
|
@@ -314,7 +314,10 @@ exports.js_proxy_error = function (err) {
|
|
|
314
314
|
</script>';
|
|
315
315
|
};
|
|
316
316
|
exports.endsWith = function(str, suffix) {
|
|
317
|
-
|
|
317
|
+
str = (str || '').toString();
|
|
318
|
+
suffix = (suffix || '').toString();
|
|
319
|
+
var idx = str.lastIndexOf(suffix);
|
|
320
|
+
return (idx >= 0) && (idx == (str.length - suffix.length));
|
|
318
321
|
};
|
|
319
322
|
exports.beginsWith = function (str, prefix) {
|
|
320
323
|
return str.indexOf(prefix) === 0;
|