1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

removed regex in if statement

Co-Authored-By: arunnattarayan <arunkumarit02@gmail.com>
This commit is contained in:
Nick O'Leary 2018-12-06 19:20:43 +05:30 committed by GitHub
parent 06a1f30350
commit 7b80ae42e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -447,7 +447,8 @@ RED.library = (function() {
click: function() { click: function() {
//TODO: move this to RED.library //TODO: move this to RED.library
var flowName = $("#node-input-library-filename").val(); var flowName = $("#node-input-library-filename").val();
if(flowName.split(/[\\/]/).pop() === "" || /^\s*$/.test(flowName)) { flowName = flowName.trim();
if(flowName === "" || flowName.endsWith("/")) {
RED.notify(RED._("library.invalidFilename"),"warning"); RED.notify(RED._("library.invalidFilename"),"warning");
} else { } else {
$.ajax({ $.ajax({