HISTORY.md (6780B)
1 # History 2 3 4 ## 2022-03-11, version 2.1.0 5 6 - Implemented configurable callbacks `typed.createError` and `typed.onMismatch`. 7 Thanks @gwhitney. 8 9 10 ## 2020-07-03, version 2.0.0 11 12 - Drop official support for node.js 6 and 8, though no breaking changes 13 at this point. 14 - Implemented support for recursion using the `this` keyword. Thanks @nickewing. 15 16 17 ## 2019-08-22, version 1.1.1 18 19 - Fix #15: passing `null` to an `Object` parameter throws wrong error. 20 21 22 ## 2018-07-28, version 1.1.0 23 24 - Implemented support for creating typed functions from a plain function 25 having a property `signature`. 26 - Implemented providing a name when merging multiple typed functions. 27 28 29 ## 2018-07-04, version 1.0.4 30 31 - By default, `addType` will insert new types before the `Object` test 32 since the `Object` test also matches arrays and classes. 33 - Upgraded `devDependencies`. 34 35 36 ## 2018-03-17, version 1.0.3 37 38 - Dropped usage of ES6 feature `Array.find`, so typed-function is 39 directly usable on any ES5 compatible JavaScript engine (like IE11). 40 41 42 ## 2018-03-17, version 1.0.2 43 44 - Fixed typed-function not working on browsers that don't allow 45 setting the `name` property of a function. 46 47 48 ## 2018-02-21, version 1.0.1 49 50 - Upgraded dev dependencies. 51 52 53 ## 2018-02-20, version 1.0.0 54 55 Version 1.0.0 is rewritten from scratch. The API is the same, 56 though generated error messages may differ slightly. 57 58 Version 1.0.0 no longer uses `eval` under the hood to achieve good 59 performance. This reduces security risks and makes typed-functions 60 easier to debug. 61 62 Type `Object` is no longer treated specially from other types. This 63 means that the test for `Object` must not give false positives for 64 types like `Array`, `Date`, or class instances. 65 66 In version 1.0.0, support for browsers like IE9, IE10 is dropped, 67 though typed-function can still work when using es5 and es6 polyfills. 68 69 70 ## 2018-01-24, version 0.10.7 71 72 - Fixed the field `data.actual` in a `TypeError` message containing 73 the type index instead of the actual type of the argument. 74 75 76 ## 2017-11-18, version 0.10.6 77 78 - Fixed a security issue allowing to execute arbitrary JavaScript 79 code via a specially prepared function name of a typed function. 80 Thanks Masato Kinugawa. 81 82 83 ## 2016-11-18, version 0.10.5 84 85 - Fixed the use of multi-layered use of `any` type. See #8. 86 87 88 ## 2016-04-09, version 0.10.4 89 90 - Typed functions can only inherit names from other typed functions and no 91 longer from regular JavaScript functions since these names are unreliable: 92 they can be manipulated by minifiers and browsers. 93 94 95 ## 2015-10-07, version 0.10.3 96 97 - Reverted the fix of v0.10.2 until the introduced issue with variable 98 arguments is fixed too. Added unit test for the latter case. 99 100 101 ## 2015-10-04, version 0.10.2 102 103 - Fixed support for using `any` multiple times in a single signture. 104 Thanks @luke-gumbley. 105 106 107 ## 2015-07-27, version 0.10.1 108 109 - Fixed functions `addType` and `addConversion` not being robust against 110 replaced arrays `typed.types` and `typed.conversions`. 111 112 113 ## 2015-07-26, version 0.10.0 114 115 - Dropped support for the following construction signatures in order to simplify 116 the API: 117 - `typed(signature: string, fn: function)` 118 - `typed(name: string, signature: string, fn: function)` 119 - Implemented convenience methods `typed.addType` and `typed.addConversion`. 120 - Changed the casing of the type `'function'` to `'Function'`. Breaking change. 121 - `typed.types` is now an ordered Array containing objects 122 `{name: string, test: function}`. Breaking change. 123 - List with expected types in error messages no longer includes converted types. 124 125 126 ## 2015-05-17, version 0.9.0 127 128 - `typed.types` is now an ordered Array containing objects 129 `{type: string, test: function}` instead of an object. Breaking change. 130 - `typed-function` now allows merging typed functions with duplicate signatures 131 when they point to the same function. 132 133 134 ## 2015-05-16, version 0.8.3 135 136 - Function `typed.find` now throws an error instead of returning `null` when a 137 signature is not found. 138 - Fixed: the attached signatures no longer contains signatures with conversions. 139 140 141 ## 2015-05-09, version 0.8.2 142 143 - Fixed function `typed.convert` not handling the case where the value already 144 has the requested type. Thanks @rjbaucells. 145 146 147 ## 2015-05-09, version 0.8.1 148 149 - Implemented option `typed.ignore` to ignore/filter signatures of a typed 150 function. 151 152 153 ## 2015-05-09, version 0.8.0 154 155 - Implemented function `create` to create a new instance of typed-function. 156 - Implemented a utility function `convert(value, type)` (#1). 157 - Implemented a simple `typed.find` function to find the implementation of a 158 specific function signature. 159 - Extended the error messages to denote the function name, like `"Too many 160 arguments in function foo (...)"`. 161 162 163 ## 2015-04-17, version 0.7.0 164 165 - Performance improvements. 166 167 168 ## 2015-03-08, version 0.6.3 169 170 - Fixed generated internal Signature and Param objects not being cleaned up 171 after the typed function has been generated. 172 173 174 ## 2015-02-26, version 0.6.2 175 176 - Fixed a bug sometimes not ordering the handling of any type arguments last. 177 - Fixed a bug sometimes not choosing the signature with the lowest number of 178 conversions. 179 180 181 ## 2015-02-07, version 0.6.1 182 183 - Large code refactoring. 184 - Fixed bugs related to any type parameters. 185 186 187 ## 2015-01-16, version 0.6.0 188 189 - Removed the configuration option `minify` 190 (it's not clear yet whether minifying really improves the performance). 191 - Internal code simplifications. 192 - Bug fixes. 193 194 195 ## 2015-01-07, version 0.5.0 196 197 - Implemented support for merging typed functions. 198 - Typed functions inherit the name of the function in case of one signature. 199 - Fixed a bug where a regular argument was not matched when there was a 200 signature with variable arguments too. 201 - Slightly changed the error messages. 202 203 204 ## 2014-12-17, version 0.4.0 205 206 - Introduced new constructor options, create a typed function as 207 `typed([name,] signature, fn)` or `typed([name,] signatures)`. 208 - Support for multiple types per parameter like `number | string, number'`. 209 - Support for variable parameters like `sting, ...number'`. 210 - Changed any type notation `'*'` to `'any'`. 211 - Implemented detailed error messages. 212 - Implemented option `typed.config.minify`. 213 214 215 ## 2014-11-05, version 0.3.1 216 217 - Renamed module to `typed-function`. 218 219 220 ## 2014-11-05, version 0.3.0 221 222 - Implemented support for any type arguments (denoted with `*`). 223 224 225 ## 2014-10-23, version 0.2.0 226 227 - Implemented support for named functions. 228 - Implemented support for type conversions. 229 - Implemented support for custom types. 230 - Library packaged as UMD, usable with CommonJS (node.js), AMD, and browser globals. 231 232 233 ## 2014-10-21, version 0.1.0 234 235 - Implemented support for functions with zero, one, or multiple arguments. 236 237 238 ## 2014-10-19, version 0.0.1 239 240 - First release (no functionality yet)