mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Add _.parseInt.
Former-commit-id: 0c0f10af3dc50a4d1b684523f19d02e423d738f5
This commit is contained in:
@@ -210,6 +210,7 @@
|
||||
'merge',
|
||||
'omit',
|
||||
'pairs',
|
||||
'parseInt',
|
||||
'pick',
|
||||
'values'
|
||||
];
|
||||
@@ -291,6 +292,7 @@
|
||||
'forOwn',
|
||||
'isPlainObject',
|
||||
'merge',
|
||||
'parseInt',
|
||||
'partialRight',
|
||||
'runInContext'
|
||||
]));
|
||||
|
||||
16
test/test.js
16
test/test.js
@@ -1767,6 +1767,22 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.parseInt');
|
||||
|
||||
(function() {
|
||||
test('should parse strings with leading zeros with a `radix` of 10 by default (test in Firefox and Opera)', function() {
|
||||
equal(_.parseInt('08'), 8);
|
||||
});
|
||||
|
||||
test('should internally use a radix of 10 if `radix` is `undefined` or `0`', function() {
|
||||
equal(_.parseInt('10', 0), 10);
|
||||
equal(_.parseInt('10'), 10);
|
||||
equal(_.parseInt('10', undefined), 10);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('partial methods');
|
||||
|
||||
_.each(['partial', 'partialRight'], function(methodName) {
|
||||
|
||||
Reference in New Issue
Block a user