Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
build/
packages/
.buildlog
.idea/
.dart_tool/
.packages

# Or the files created by dart2js.
*.dart.js
Expand Down
4 changes: 2 additions & 2 deletions lib/src/sanitizer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ double toFloat(String str) {
try{
return double.parse(str);
} catch (e) {
return double.NAN;
return double.nan;
}
}

Expand All @@ -45,7 +45,7 @@ num toInt(String str, {int radix:10}) {
try {
return double.parse(str).toInt();
} catch (e) {
return double.NAN;
return double.nan;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/validator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ bool isISBN(String str, [version]) {
/// check if the string is valid JSON
bool isJSON(str) {
try {
JSON.decode(str);
json.decode(str);
} catch (e) {
return false;
}
Expand Down
8 changes: 6 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: validator
version: 0.0.7
version: 0.0.8
author: Karan Goel <karan@goel.io>
description: String validation and sanitization for Dart.
homepage: https://github.com/karan/validator.dart
documentation: https://github.com/karan/validator.dart

environment:
sdk: '>= 1.1.0 < 3.0.0'

dependencies:
unittest: any
test: any
1 change: 0 additions & 1 deletion test/packages

This file was deleted.

4 changes: 2 additions & 2 deletions test/sanitizer_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void testToFloat() {
'1': 1.0,
'2.': 2.0,
'-1.4': -1.4,
'foo': double.NAN
'foo': double.nan
}
});
}
Expand All @@ -72,7 +72,7 @@ void testToInt() {
'expect': {
'1.4': 1,
'2.': 2,
'foo': double.NAN
'foo': double.nan
}
});
}
Expand Down
1 change: 0 additions & 1 deletion tool/packages

This file was deleted.