2 * Fix handling of infinite values in Math.trunc
3 * Fix handling of getters in Object.normalizeOptions
6 * Add Function#toStringTokens
7 * Add Object.serialize and Object.unserialize
8 * Add String.randomUniq
9 * Fix Strin#camelToHyphen issue with tokens that end with digit
10 * Optimise Number.isInteger logic
11 * Improve documentation
12 * Configure lint scripts
13 * Fix spelling of LICENSE
16 * Assure maximum spec compliance of Array.of and Array.from (thanks @mathiasbynens)
17 * Improve documentations
20 Provide accurate iterators handling:
21 * Array.from improvements:
22 * Assure right unicode symbols resolution when processing strings in Array.from
23 * Rely on ES6 symbol shim and use native @@iterator Symbol if provided by environment
25 * Array.prototype.entries
26 * Array.prototype.keys
27 * Array.prototype.values
28 * Array.prototype[@@iterator]
29 * String.prototype[@@iterator]
34 - Simplify and deprecate `isCallable`. It seems in ES5 based engines there are
35 no callable objects which are `typeof obj !== 'function'`
36 - Update Array.from map callback signature (up to latest resolution of TC39)
37 - Improve documentation
41 (Workaround for accidental premature publish & unpublish of v0.10.0 a while ago)
45 - All methods and function specified for ECMAScript 6 are now introduced as
46 shims accompanied with functions through which (optionally) they can be
47 implementend on native objects
48 - Filename convention was changed to shorter and strictly lower case names. e.g.
49 `lib/String/prototype/starts-with` became `string/#/starts-with`
50 - Generated functions are guaranteed to have expected length
51 - Objects with null prototype (created via `Object.create(null)`) are widely
52 supported (older version have crashed due to implied `obj.hasOwnProperty` and
54 - Support array subclasses
55 - When handling lists do not limit its length to Uint32 range
56 - Use newly introduced `Object.eq` for strict equality in place of `Object.is`
57 - Iteration of Object have been improved so properties that were hidden or
58 removed after iteration started are not iterated.
61 - `Array.isPlainArray`
63 - `Array.prototype.concat` (as updated with ES6)
64 - `Array.prototype.copyWithin` (as introduced with ES6)
65 - `Array.prototype.fill` (as introduced with ES6)
66 - `Array.prototype.filter` (as updated with ES6)
67 - `Array.prototype.findIndex` (as introduced with ES6)
68 - `Array.prototype.map` (as updated with ES6)
69 - `Array.prototype.separate`
70 - `Array.prototype.slice` (as updated with ES6)
71 - `Array.prototype.splice` (as updated with ES6)
72 - `Function.prototype.copy`
73 - `Math.acosh` (as introduced with ES6)
74 - `Math.atanh` (as introduced with ES6)
75 - `Math.cbrt` (as introduced with ES6)
76 - `Math.clz32` (as introduced with ES6)
77 - `Math.cosh` (as introduced with ES6)
78 - `Math.expm1` (as introduced with ES6)
79 - `Math.fround` (as introduced with ES6)
80 - `Math.hypot` (as introduced with ES6)
81 - `Math.imul` (as introduced with ES6)
82 - `Math.log2` (as introduced with ES6)
83 - `Math.log10` (as introduced with ES6)
84 - `Math.log1p` (as introduced with ES6)
85 - `Math.sinh` (as introduced with ES6)
86 - `Math.tanh` (as introduced with ES6)
87 - `Math.trunc` (as introduced with ES6)
88 - `Number.EPSILON` (as introduced with ES6)
89 - `Number.MIN_SAFE_INTEGER` (as introduced with ES6)
90 - `Number.MAX_SAFE_INTEGER` (as introduced with ES6)
91 - `Number.isFinite` (as introduced with ES6)
92 - `Number.isInteger` (as introduced with ES6)
93 - `Number.isSafeInteger` (as introduced with ES6)
94 - `Object.create` (with fix for V8 issue which disallows prototype turn of
95 objects derived from null
96 - `Object.eq` - Less restrictive version of `Object.is` based on SameValueZero
99 - `Object.keys` (as updated with ES6)
100 - `Object.mixinPrototypes`
101 - `Object.primitiveSet`
102 - `Object.setPrototypeOf` (as introduced with ES6)
103 - `Object.validObject`
105 - `RegExp.prototype.match` (as introduced with ES6)
106 - `RegExp.prototype.replace` (as introduced with ES6)
107 - `RegExp.prototype.search` (as introduced with ES6)
108 - `RegExp.prototype.split` (as introduced with ES6)
109 - `RegExp.prototype.sticky` (as introduced with ES6)
110 - `RegExp.prototype.unicode` (as introduced with ES6)
111 - `String.fromCodePoint` (as introduced with ES6)
112 - `String.raw` (as introduced with ES6)
113 - `String.prototype.at`
114 - `String.prototype.codePointAt` (as introduced with ES6)
115 - `String.prototype.normalize` (as introduced with ES6)
116 - `String.prototype.plainReplaceAll`
120 - `Array.prototype.commonLeft`
123 - `Function.prototype.silent`
124 - `Function.prototype.wrap`
125 - `Object.descriptor` Move to external `d` project.
126 See: https://github.com/medikoo/d
128 - `Object.extendDeep`
131 - `String.prototype.trimCommonLeft`
134 - `Function.i` into `Function.identity`
135 - `Function.k` into `Function.constant`
136 - `Number.toInt` into `Number.toInteger`
137 - `Number.toUint` into `Number.toPosInteger`
138 - `Object.extend` into `Object.assign` (as introduced in ES 6)
139 - `Object.extendProperties` into `Object.mixin`, with improved internal
140 handling, so it matches temporarily specified `Object.mixin` for ECMAScript 6
141 - `Object.isList` into `Object.isArrayLike`
142 - `Object.mapToArray` into `Object.toArray` (with fixed function length)
143 - `Object.toPlainObject` into `Object.normalizeOptions` (as this is the real
144 use case where we use this function)
145 - `Function.prototype.chain` into `Function.prototype.compose`
146 - `Function.prototype.match` into `Function.prototype.spread`
147 - `String.prototype.format` into `String.formatMethod`
149 Improvements & Fixes:
150 - Remove workaround for primitive values handling in object iterators
151 - `Array.from`: Update so it follows ES 6 spec
152 - `Array.prototype.compact`: filters just null and undefined values
154 - `Array.prototype.eIndexOf` and `Array.prototype.eLastIndexOf`: fix position
155 handling, improve internals
156 - `Array.prototype.find`: return undefined not null, in case of not found
158 - `Array.prototype.remove` fix function length
159 - `Error.custom`: simplify, Custom class case is addressed by outer
160 `error-create` project -> https://github.com/medikoo/error-create
161 - `Error.isError` true only for Error instances (remove detection of host
163 - `Number.prototype.pad`: Normalize negative pad
164 - `Object.clear`: Handle errors same way as in `Object.assign`
165 - `Object.compact`: filters just null and undefined values (not all falsies)
166 - `Object.compare`: Take into account NaN values
167 - `Object.copy`: Split into `Object.copy` and `Object.copyDeep`
168 - `Object.isCopy`: Separate into `Object.isCopy` and `Object.isCopyDeep`, where
169 `isCopyDeep` handles nested plain objects and plain arrays only
170 - `String.prototype.endsWith`: Adjust up to ES6 specification
171 - `String.prototype.repeat`: Adjust up to ES6 specification and improve algorithm
172 - `String.prototype.simpleReplace`: Rename into `String.prototype.plainReplace`
173 - `String.prototype.startsWith`: Adjust up to ES6 specification
174 - Update lint rules, and adjust code to that
175 - Update Travis CI configuration
176 - Remove Makefile (it's cross-env utility)
180 * Array.prototype.isCopy
181 * Array.prototype.isUniq
183 * Function.validFunction
185 * Object.descriptor.binder
186 * Object.safeTraverse
188 * String.prototype.capitalize
189 * String.prototype.simpleReplace
192 * Fix Array.prototype.diff for sparse arrays
193 * Accept primitive objects as input values in Object iteration methods and
194 Object.clear, Object.count, Object.diff, Object.extend,
195 Object.getPropertyNames, Object.values
196 * Pass expected arguments to callbacks of Object.filter, Object.mapKeys,
197 Object.mapToArray, Object.map
198 * Improve callable callback support in Object.mapToArray
201 * Object.reduce - reduce for hash-like collections
202 * Accapt any callable object as callback in Object.filter, mapKeys and map
206 We're getting to real solid API
209 * Function#memoize - it's grown up to be external package, to be soon published
211 * String.guid - it doesn't fit es5-ext (extensions) concept, will be provided as
213 # Function.arguments - obsolete
214 # Function.context - obsolete
215 # Function#flip - not readable when used, so it was never used
216 # Object.clone - obsolete and confusing
219 * String#camelToHyphen - String format convertion
222 * String#dashToCamelCase -> String#hyphenToCamel
225 * Object.isObject - Quote names in literals that match reserved keywords
226 (older implementations crashed on that)
227 * String#repeat - Do not accept negative values (coerce them to 1)
230 * Array#remove - Accepts many arguments, we can now remove many values at once
231 * Object iterators (forEach, map, some) - Compare function invoked with scope
233 * Function#curry - Algorithm cleanup
234 * Object.isCopy - Support for all types, not just plain objects
235 * Object.isPlainObject - Support for cross-frame objects
236 * Do not memoize any of the functions, it shouldn't be decided internally
237 * Remove Object.freeze calls in reserved, it's not up to convention
238 * Improved documentation
239 * Better linting (hard-core approach using both JSLint mod and JSHint)
240 * Optional arguments are now documented in funtions signature
243 Fix errors in Array's intersection and exclusion methods, related to improper
244 usage of contains method
247 Reorganized internal logic of Function.prototype.memoize. So it's more safe now
248 and clears cache properly. Additionally preventCache option was provided.
251 Again, major overhaul. Probably last experimental stuff was trashed, all API
252 looks more like standard extensions now.
255 * Turn all Object.prototype extensions into functions and move them to Object
256 namespace. We learned that extending Object.prototype is bad idea in any case.
257 * Rename Function.prototype.curry into Function.prototype.partial. This function
258 is really doing partial application while currying is slightly different
260 * Convert Function.prototype.ncurry to new implementation of
261 Function.prototype.curry, it now serves real curry concept additionaly it
262 covers use cases for aritize and hold, which were removed.
263 * Rename Array's peek to last, and provide support for sparse arrays in it
264 * Rename Date's monthDaysCount into daysInMonth
265 * Simplify object iterators, now order of iteration can be configured with just
266 compareFn argument (no extra byKeys option)
267 * Rename Object.isDuplicate to Object.isCopy
268 * Rename Object.isEqual to Object.is which is compatible with future 'is'
270 * Function.memoize is now Function.prototype.memoize. Additionally clear cache
271 functionality is added, and access to original arguments object.
272 * Rename validation functions: assertNotNull to validValue, assertCallable to
273 validCallable. validValue was moved to Object namespace. On success they now
274 return validated value instead of true, it supports better composition.
275 Additionally created Date.validDate and Error.validError
276 * All documentation is now held in README.md not in code files.
277 * Move guid to String namespace. All guids now start with numbers.
278 * Array.generate: fill argument is now optional
279 * Object.toArray is now Array.from (as new ES6 specification draft suggests)
280 * All methods that rely on indexOf or lastIndexOf, now rely on egal (Object.is)
281 versions of them (eIndexOf, eLastIndexOf)
282 * Turn all get* functions that returned methods into actuall methods (get*
283 functionality can still be achieved with help of Function.prototype.partial).
284 So: Date.getFormat is now Date.prototype.format,
285 Number.getPad is now Number.prototype.pad,
286 String.getFormat is now String.prototype.format,
287 String.getIndent is now String.prototype.indent,
288 String.getPad is now String.prototype.pad
289 * Refactored Object.descriptor, it is now just two functions, main one and
290 main.gs, main is for describing values, and gs for describing getters and
291 setters. Configuration is passed with first argument as string e.g. 'ce' for
292 configurable and enumerable. If no configuration string is provided then by
293 default it returns configurable and writable but not enumerable for value or
294 configurable but not enumerable for getter/setter
295 * Function.prototype.silent now returns prepared function (it was
296 expected to be fixed for 0.7)
297 * Reserved keywords map (reserved) is now array not hash.
298 * Object.merge is now Object.extend (while former Object.extend was completely
299 removed) - 'extend' implies that we change object, not creating new one (as
300 'merge' may imply). Similarily Object.mergeProperties was renamed to
301 Object.extendProperties
302 * Position argument support in Array.prototype.contains and
303 String.prototype.contains (so it follows ES6 specification draft)
304 * endPosition argument support in String.prototype.endsWith and fromPosition
305 argument support in String.prototype.startsWith (so it follows ES6
307 * Better and cleaner String.prototype.indent implementation. No default value
308 for indent string argument, optional nest value (defaults to 1), remove
310 * Correct length values for most methods (so they reflect length of similar
312 * Length argument is now optional in number and string pad methods.
313 * Improve arguments validation in general, so it adheres to standard conventions
314 * Fixed format of package.json
316 Removed methods and functions:
317 * Object.prototype.slice - Object is not ordered collection, so slice doesn't
319 * Function's rcurry, rncurry, s - too cumbersome for JS, not many use cases for
321 * Function.prototype.aritize and Function.prototype.hold - same functionality
322 can be achieved with new Function.prototype.curry
323 * Function.prototype.log - provided more generic Function.prototype.wrap for
325 * getNextIdGenerator - no use case for that (String.guid should be used if
327 * Object.toObject - Can be now acheived with Object(validValue(x))
328 * Array.prototype.someValue - no real use case (personally used once and
329 case was already controversial)
330 * Date.prototype.duration - moved to external package
331 * Number.getAutoincrement - No real use case
332 * Object.prototype.extend, Object.prototype.override,
333 Object.prototype.plainCreate, Object.prototype.plainExtend - It was probably
334 too complex, same should be achieved just with Object.create,
335 Object.descriptor and by saving references to super methods in local scope.
336 * Object.getCompareBy - Functions should be created individually for each use
338 * Object.get, Object.getSet, Object.set, Object.unset - Not many use cases and
339 same can be easily achieved with simple inline function
340 * String.getPrefixWith - Not real use case for something that can be easily
341 achieved with '+' operator
342 * Object.isPrimitive - It's just negation of Object.isObject
343 * Number.prototype.isLess, Number.prototype.isLessOrEqual - they shouldn't be in
344 Number namespace and should rather be addressed with simple inline functions.
345 * Number.prototype.subtract - Should rather be addressed with simple inline
348 New methods and functions:
349 * Array.prototype.lastIndex - Returns last declared index in array
350 * String.prototype.last - last for strings
351 * Function.prototype.wrap - Wrap function with other, it allows to specify
352 before and after behavior transform return value or prevent original function
354 * Math.sign - Returns sign of a number (already in ES6 specification draft)
355 * Number.toInt - Converts value to integer (already in ES6 specification draft)
356 * Number.isNaN - Returns true if value is NaN (already in ES6 specification
358 * Number.toUint - Converts value to unsigned integer
359 * Number.toUint32 - Converts value to 32bit unsigned integer
360 * Array.prototype.eIndexOf, eLastIndexOf - Egal version (that uses Object.is) of
361 standard methods (all methods that were using native indexOf or lastIndexOf
362 now uses eIndexOf and elastIndexOf respectively)
363 * Array.of - as it's specified for ES6
366 * Fixed binarySearch so it always returns valid list index
367 * Object.isList - it failed on lists that are callable (e.g. NodeList in Nitro
369 * Object.map now supports third argument for callback
373 * Array.prototype.firstIndex - returns first valid index of array (for
374 sparse arrays it may not be '0'
377 * Array.prototype.first - now returns value for index returned by firstIndex
378 * Object.prototype.mapToArray - can be called without callback, then array of
379 key-value pairs is returned
382 * Array.prototype.forEachRight, object's length read through UInt32 conversion
386 Stepped back from experimental ideas and introduced more standard approach
387 taking example from how ES5 methods and functions are designed. One exceptions
388 is that, we don’t refrain from declaring methods for Object.prototype - it’s up
389 to developer whether how he decides to use it in his context (as function or as
393 * Removed any method 'functionalization' and functionalize method itself.
394 es5-ext declares plain methods, which can be configured to work as functions
395 with call.bind(method) - see documentation.
396 * Removed separation of Object methods for ES5 (with descriptors) and
397 ES3 (plain) - we're following ES5 idea on that, some methods are intended just
398 for enumerable properties and some are for all properties, all are declared
400 * Removed separation of Array generic (collected in List folder) and not generic
401 methods (collected in Array folder). Now all methods are generic and are in
402 Array/prototype folder. This separation also meant, that methods in Array are
403 usually destructive. We don’t do that separation now, there’s generally no use
404 case for destructive iterators, we should be fine with one version of each
405 method, (same as ES5 is fine with e.g. one, non destructive 'filter' method)
406 * Folder structure resembles tree of native ES5 Objects
407 * All methods are written with ES5 conventions in mind, it means that most
408 methods are generic and can be run on any object. In more detail:
409 ** Array.prototype and Object.prototype methods can be run on any object (any
410 not null or undefined value),
411 ** Date.prototype methods should be called only on Date instances.
412 ** Function.prototype methods can be called on any callable objects (not
413 necessarily functions)
414 ** Number.prototype & String.prototype methods can be called on any value, in
415 case of Number it it’ll be degraded to number, in case of string it’ll be
417 * Travis CI support (only for Node v0.6 branch, as v0.4 has buggy V8 version)
419 Improvements for existing functions and methods:
420 * Function.memoize (was Function.cache) is now fully generic, can operate on any
421 type of arguments and it’s NaN safe (all NaN objects are considered equal)
422 * Method properties passed to Object.prototype.extend or
423 Object.prototype.override can aside of _super optionally take prototype object
425 * Object iterators: forEach, mapToArray and every can now iterate in specified
427 * pluck, invoke and other functions that return reusable functions or methods
428 have now their results memoized.
431 * Global: assertNotNull, getNextIdGenerator, guid, isEqual, isPrimitive,
434 * Array.prototype: binarySearch, clear, contains, diff, exclusion, find, first,
435 forEachRight, group, indexesOf, intersection, remove, someRight, someValue
438 * Function: arguments, context, insert, isArguments, remove
439 * Function.prototype: not, silent
440 * Number: getAutoincrement, isNumber
441 * Number.prototype: isLessOrEqual, isLess, subtract
442 * Object: assertCallable, descriptor (functions for clean descriptors),
443 getCompareBy, isCallable, isObject
444 * Object.prototype: clone (real clone), compact, count, diff, empty,
445 getPropertyNames, get, keyOf, mapKeys, override, plainCreate, plainExtend,
448 * String: getPrefixWith, isString
449 * String.prototype: caseInsensitiveCompare, contains, isNumeric
452 * Date.clone -> Date.prototype.copy
453 * Date.format -> Date.getFormat
454 * Date/day/floor -> Date.prototype.floorDay
455 * Date/month/floor -> Date.prototype.floorMonth
456 * Date/month/year -> Date.prototype.floorYear
457 * Function.cache -> Function.memoize
458 * Function.getApplyArg -> Function.prototype.match
459 * Function.sequence -> Function.prototype.chain
460 * List.findSameStartLength -> Array.prototype.commonLeft
461 * Number.pad -> Number.getPad
462 * Object/plain/clone -> Object.prototype.copy
463 * Object/plain/elevate -> Object.prototype.flatten
464 * Object/plain/same -> Object.prototype.isDuplicate
465 * Object/plain/setValue -> Object.getSet
466 * String.format -> String.getFormat
467 * String.indent -> String.getIndent
468 * String.pad -> String.getPad
469 * String.trimLeftStr -> String.prototype.trimCommonLeft
470 * Object.merge -> Object.prototype.mergeProperties
471 * Object/plain/pluck -> Object.prototype.get
472 * Array.clone is now Array.prototype.copy and can be used also on any array-like
474 * List.isList -> Object.isList
475 * List.toArray -> Object.prototype.toArray
476 * String/convert/dashToCamelCase -> String.prototype.dashToCamelCase
479 * Array.compact - removed destructive version (that operated on same array), we
480 have now non destructive version as Array.prototype.compact.
481 * Function.applyBind -> use apply.bind directly
482 * Function.bindBind -> use bind.bind directly
483 * Function.callBind -> use call.bind directly
484 * Fuction.clone -> no valid use case
485 * Function.dscope -> controversial approach, shouldn’t be considered seriously
486 * Function.functionalize -> It was experimental but standards are standards
487 * List/sort/length -> It can be easy obtained by Object.getCompareBy(‘length’)
488 * List.concat -> Concat’s for array-like’s makes no sense, just convert to array
490 * List.every -> Use Array.prototype.every directly
491 * List.filter -> Use Array.prototype.filter directly
492 * List.forEach -> User Array.prototype.forEach directly
493 * List.isListObject -> No valid use case, do: isList(list) && (typeof list ===
495 * List.map -> Use Array.prototype.map directly
496 * List.reduce -> Use Array.prototype.reduce directly
497 * List.shiftSame -> Use Array.prototype.commonLeft and do slice
498 * List.slice -> Use Array.prototype.slice directly
499 * List.some -> Use Array.prototype.some directly
500 * Object.bindMethods -> it was version that considered descriptors, we have now
501 Object.prototype.bindMethods which operates only on enumerable properties
502 * Object.every -> version that considered all properties, we have now
503 Object.prototype.every which iterates only enumerables
504 * Object.invoke -> no use case
505 * Object.mergeDeep -> no use case
506 * Object.pluck -> no use case
507 * Object.same -> it considered descriptors, now there’s only Object.isDuplicate
508 which compares only enumerable properties
509 * Object.sameType -> no use case
510 * Object.toDescriptor and Object.toDescriptors -> replaced by much nicer
511 Object.descriptor functions
512 * Object/plain/link -> no use case (it was used internally only by
514 * Object/plain/setTrue -> now easily configurable by more universal
516 * String.trimRightStr -> Eventually String.prototype.trimCommonRight will be
520 * Cleared npm warning for misnamed property in package.json
523 * Calling String.indent without scope (global scope then) now treated as calling
524 it with null scope, it allows more direct invocations when using default nest
525 string: indent().call(str, nest)
528 * Added TAD test suite to devDependencies, configured test commands.
529 Tests can be run with 'make test' or 'npm test'
533 * Array: clone, compact (in place)
534 * Date: format, duration, clone, monthDaysCount, day.floor, month.floor,
536 * Function: getApplyArg, , ncurry, rncurry, hold, cache, log
537 * List: findSameStartLength, shiftSame, peek, isListObject
539 * Object: sameType, toString, mapToArray, mergeDeep, toDescriptor,
540 toDescriptors, invoke
541 * String: startsWith, endsWith, indent, trimLeftStr, trimRightStr, pad, format
544 * Object.extend does now prototypal extend as exptected
545 * Object.merge now tries to overwrite only configurable properties
549 * Faster List.toArray
550 * Better global retrieval
551 * Functionalized all Function methods
552 * Renamed bindApply and bindCall to applyBind and callBind
553 * Removed Function.inherit (as it's unintuitive curry clone)
554 * Straightforward logic in Function.k
555 * Fixed naming of some tests files (letter case issue)
556 * Renamed Function.saturate into Function.lock
557 * String.dashToCamelCase digits support
558 * Strings now considered as List objects
559 * Improved List.compact
560 * Concise logic for List.concat
561 * Test wit TAD in clean ES5 context
564 * Function's bindBind, bindCall and bindApply now more versatile
567 * Removed Object.is and List.apply
568 * Renamed Object.plain.is to Object.plain.isPlainObject (keep naming convention
570 * Improved documentation
573 * Take most functions on Object to Object.plain to keep them away from object
575 * Object functions with ES5 standard in mind (object descriptors)
579 * Consistent file naming (dash instead of camelCase)
582 * Renamed Functions.K and Function.S to to lowercase versions (use consistent
586 * Renamed Array folder to List (as its generic functions for array-like objects)
588 * Added various functions