forked from validatorjs/validator.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add isSlug validator, issue validatorjs#952
- Loading branch information
1 parent
5ca54d2
commit 325210e
Showing
8 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = isSlug; | ||
|
||
var _assertString = _interopRequireDefault(require("./util/assertString")); | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
// const numeric = /^[+-]?([0-9]*[.])?[0-9]+$/; | ||
// const numericNoSymbols = /^[0-9]+$/; | ||
function isSlug(str) { | ||
(0, _assertString.default)(str); | ||
return str.indexOf(' ') === -1; | ||
} | ||
|
||
module.exports = exports.default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import assertString from './util/assertString'; | ||
|
||
// const numeric = /^[+-]?([0-9]*[.])?[0-9]+$/; | ||
// const numericNoSymbols = /^[0-9]+$/; | ||
|
||
export default function isSlug(str) { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
assertString(str); | ||
|
||
return str.indexOf(' ') === -1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
1 comment
on commit 325210e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Heydad-Helfer, can you help us get this as a PR in validator.js?
We need to make reviews on the same.
Thanks. Looking forward to your reply.
This work looks good.