internet-programming/lab3/node_modules/json-server/lib/cli/utils/is.js

16 lines
229 B
JavaScript

"use strict";
module.exports = {
FILE,
JS,
URL
};
function FILE(s) {
return !URL(s) && /\.json$/.test(s);
}
function JS(s) {
return !URL(s) && /\.c?js$/.test(s);
}
function URL(s) {
return /^(http|https):/.test(s);
}