Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/is-relative/index.js')
-rw-r--r--node_modules/is-relative/index.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/node_modules/is-relative/index.js b/node_modules/is-relative/index.js
new file mode 100644
index 000000000..ffc760a82
--- /dev/null
+++ b/node_modules/is-relative/index.js
@@ -0,0 +1,21 @@
+'use strict';
+
+/**
+ * ```js
+ * var isRelative = require('is-relative');
+ * isRelative('README.md');
+ * //=> true
+ * ```
+ *
+ * @name isRelative
+ * @param {String} `filepath` Path to test.
+ * @return {Boolean}
+ * @api public
+ */
+
+module.exports = function isRelative(filepath) {
+ if (typeof filepath !== 'string') {
+ throw new Error('isRelative expects a string.');
+ }
+ return !/^([a-z]+:)?[\\\/]/i.test(filepath);
+}; \ No newline at end of file