es5-ext
Advanced tools
Comparing version 0.10.6 to 0.10.7
'use strict'; | ||
module.exports = { | ||
'@@iterator': require('./@@iterator'), | ||
binarySearch: require('./binary-search'), | ||
@@ -40,2 +41,1 @@ clear: require('./clear'), | ||
}; | ||
module.exports[require('es6-symbol').iterator] = require('./@@iterator'); |
@@ -11,2 +11,3 @@ 'use strict'; | ||
function: require('./function'), | ||
iterable: require('./iterable'), | ||
math: require('./math'), | ||
@@ -13,0 +14,0 @@ number: require('./number'), |
@@ -6,3 +6,3 @@ 'use strict'; | ||
if (typeof sinh !== 'function') return false; | ||
return sinh(1) === 1.1752011936438014; | ||
return ((sinh(1) === 1.1752011936438014) && (sinh(Number.MIN_VALUE) === 5e-324)); | ||
}; |
@@ -0,5 +1,10 @@ | ||
// Parts of implementation taken from es6-shim project | ||
// See: https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js | ||
'use strict'; | ||
var exp = Math.exp; | ||
var expm1 = require('../expm1') | ||
, abs = Math.abs, exp = Math.exp, e = Math.E; | ||
module.exports = function (x) { | ||
@@ -10,3 +15,4 @@ if (isNaN(x)) return NaN; | ||
if (!isFinite(x)) return x; | ||
return (exp(x) - exp(-x)) / 2; | ||
if (abs(x) < 1) return (expm1(x) - expm1(-x)) / 2; | ||
return (exp(x - 1) - exp(-x - 1)) * e / 2; | ||
}; |
@@ -6,3 +6,3 @@ 'use strict'; | ||
if (typeof tanh !== 'function') return false; | ||
return tanh(1) === 0.7615941559557649; | ||
return ((tanh(1) === 0.7615941559557649) && (tanh(Number.MAX_VALUE) === 1)); | ||
}; |
@@ -13,4 +13,6 @@ 'use strict'; | ||
a = exp(x); | ||
if (a === Infinity) return 1; | ||
b = exp(-x); | ||
if (b === Infinity) return -1; | ||
return (a - b) / (a + b); | ||
}; |
'use strict'; | ||
module.exports = { | ||
assign: require('./assign'), | ||
clear: require('./clear'), | ||
compact: require('./compact'), | ||
compare: require('./compare'), | ||
copy: require('./copy'), | ||
copyDeep: require('./copy-deep'), | ||
count: require('./count'), | ||
create: require('./create'), | ||
eq: require('./eq'), | ||
every: require('./every'), | ||
filter: require('./filter'), | ||
firstKey: require('./first-key'), | ||
flatten: require('./flatten'), | ||
forEach: require('./for-each'), | ||
getPropertyNames: require('./get-property-names'), | ||
is: require('./is'), | ||
isArrayLike: require('./is-array-like'), | ||
isCallable: require('./is-callable'), | ||
isCopy: require('./is-copy'), | ||
isCopyDeep: require('./is-copy-deep'), | ||
isEmpty: require('./is-empty'), | ||
isObject: require('./is-object'), | ||
isPlainObject: require('./is-plain-object'), | ||
keyOf: require('./key-of'), | ||
keys: require('./keys'), | ||
map: require('./map'), | ||
mapKeys: require('./map-keys'), | ||
normalizeOptions: require('./normalize-options'), | ||
mixin: require('./mixin'), | ||
mixinPrototypes: require('./mixin-prototypes'), | ||
primitiveSet: require('./primitive-set'), | ||
safeTraverse: require('./safe-traverse'), | ||
serialize: require('./serialize'), | ||
setPrototypeOf: require('./set-prototype-of'), | ||
some: require('./some'), | ||
toArray: require('./to-array'), | ||
unserialize: require('./unserialize'), | ||
validCallable: require('./valid-callable'), | ||
validObject: require('./valid-object'), | ||
validValue: require('./valid-value') | ||
assign: require('./assign'), | ||
clear: require('./clear'), | ||
compact: require('./compact'), | ||
compare: require('./compare'), | ||
copy: require('./copy'), | ||
copyDeep: require('./copy-deep'), | ||
count: require('./count'), | ||
create: require('./create'), | ||
eq: require('./eq'), | ||
every: require('./every'), | ||
filter: require('./filter'), | ||
firstKey: require('./first-key'), | ||
flatten: require('./flatten'), | ||
forEach: require('./for-each'), | ||
getPropertyNames: require('./get-property-names'), | ||
is: require('./is'), | ||
isArrayLike: require('./is-array-like'), | ||
isCallable: require('./is-callable'), | ||
isCopy: require('./is-copy'), | ||
isCopyDeep: require('./is-copy-deep'), | ||
isEmpty: require('./is-empty'), | ||
isObject: require('./is-object'), | ||
isPlainObject: require('./is-plain-object'), | ||
keyOf: require('./key-of'), | ||
keys: require('./keys'), | ||
map: require('./map'), | ||
mapKeys: require('./map-keys'), | ||
normalizeOptions: require('./normalize-options'), | ||
mixin: require('./mixin'), | ||
mixinPrototypes: require('./mixin-prototypes'), | ||
primitiveSet: require('./primitive-set'), | ||
safeTraverse: require('./safe-traverse'), | ||
serialize: require('./serialize'), | ||
setPrototypeOf: require('./set-prototype-of'), | ||
some: require('./some'), | ||
toArray: require('./to-array'), | ||
unserialize: require('./unserialize'), | ||
validateArrayLike: require('./validate-array-like'), | ||
validateArrayLikeObject: require('./validate-array-like-object'), | ||
validCallable: require('./valid-callable'), | ||
validObject: require('./valid-object'), | ||
validateStringifiable: require('./validate-stringifiable'), | ||
validateStringifiableValue: require('./validate-stringifiable-value'), | ||
validValue: require('./valid-value') | ||
}; |
{ | ||
"name": "es5-ext", | ||
"version": "0.10.6", | ||
"version": "0.10.7", | ||
"description": "ECMAScript 5 extensions and ES6 shims", | ||
@@ -33,3 +33,3 @@ "author": "Mariusz Nowak <medyk@medikoo.com> (http://www.medikoo.com/)", | ||
"devDependencies": { | ||
"tad": "~0.2.1", | ||
"tad": "~0.2.2", | ||
"xlint": "~0.2.2", | ||
@@ -36,0 +36,0 @@ "xlint-jslint-medikoo": "~0.1.2" |
'use strict'; | ||
var replace = String.prototype.replace | ||
, re = /([a-z\d])([A-Z])/g; | ||
, re = /([A-Z])/g; | ||
module.exports = function () { | ||
return replace.call(this, re, "$1-$2").toLowerCase(); | ||
var str = replace.call(this, re, "-$1").toLowerCase(); | ||
if (str[0] === '-') str = str.slice(1); | ||
return str; | ||
}; |
'use strict'; | ||
module.exports = { | ||
'@@iterator': require('./@@iterator'), | ||
at: require('./at'), | ||
@@ -21,2 +22,1 @@ camelToHyphen: require('./camel-to-hyphen'), | ||
}; | ||
module.exports[require('es6-symbol').iterator] = require('./@@iterator'); |
@@ -11,3 +11,3 @@ // Based on: | ||
module.exports = function (/* …codePoints*/) { | ||
module.exports = function (codePoint/*, …codePoints*/) { | ||
var chars = [], l = arguments.length, i, c, result = ''; | ||
@@ -14,0 +14,0 @@ for (i = 0; i < l; ++i) { |
@@ -27,4 +27,4 @@ 'use strict'; | ||
a.h1("Array-likes"); | ||
args = (function () { return arguments; }(1, 2, 3)); | ||
a.deep(t.call(args, -2, 0), [1, 1, 2]); | ||
args = { 0: 1, 1: 2, 2: 3, length: 3 }; | ||
a.deep(t.call(args, -2, 0), { '0': 1, '1': 1, '2': 2, length: 3 }); | ||
}; |
@@ -9,2 +9,6 @@ 'use strict'; | ||
a(t(1), 1.5430806348152437, "1"); | ||
a(t(Number.MAX_VALUE), Infinity); | ||
a(t(-Number.MAX_VALUE), Infinity); | ||
a(t(Number.MIN_VALUE), 1); | ||
a(t(-Number.MIN_VALUE), 1); | ||
}; |
@@ -9,2 +9,6 @@ 'use strict'; | ||
a(t(1), 1.1752011936438014, "1"); | ||
a(t(Number.MAX_VALUE), Infinity); | ||
a(t(-Number.MAX_VALUE), -Infinity); | ||
a(t(Number.MIN_VALUE), 5e-324); | ||
a(t(-Number.MIN_VALUE), -5e-324); | ||
}; |
@@ -9,2 +9,4 @@ 'use strict'; | ||
a(t(1), 0.7615941559557649, "1"); | ||
a(t(Number.MAX_VALUE), 1); | ||
a(t(-Number.MAX_VALUE), -1); | ||
}; |
'use strict'; | ||
module.exports = function (t, a) { | ||
a(t.call('razDwaTRzy4yFoo45My'), 'raz-dwa-trzy4y-foo45-my'); | ||
a(t.call('razDwaTRzy4yFoo45My'), 'raz-dwa-t-rzy4y-foo45-my'); | ||
}; |
@@ -11,3 +11,3 @@ // Taken from: https://github.com/mathiasbynens/String.fromCodePoint/blob/master | ||
a(t.length, 0, "Length"); | ||
a(t.length, 1, "Length"); | ||
a(String.propertyIsEnumerable('fromCodePoint'), false, "Not enumerable"); | ||
@@ -14,0 +14,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
417343
740
7124