Skip to content

Latest commit

 

History

History
517 lines (412 loc) · 22.8 KB

CHANGELOG.md

File metadata and controls

517 lines (412 loc) · 22.8 KB

Changelog

All items marked as "changed", "removed", or "renamed" are likely to be breaking changes. Before 1.0.0, these changes will not be announced and will only be documented in this file, so please make sure to read it thoroughly if you wish to upgrade.

0.7.0 - Unreleased

Arrays and Iterables

Time

Types

0.6.2 - 2024-02-08

  • Fixed: builds breaking in certain build systems due to unenforced import file extensions

0.6.1 - 2024-02-08

Breaking Changes

  • Changed: potence is no longer a CommonJS package, and all files are now ES modules
  • Renamed: BaseType -> TypeofResult
  • Renamed: BaseToType<T> -> Typeof<T>
  • Changed: Objects.structure() now uses a matchers-based API
  • Changed: Structure can now be found under 'potence/objects/structure';

Other

  • Added: Version.toJSON()
  • Added: A number of new functions and types. Be aware that these are untested and unfinalized, and so may be subject to change or even removal in a future version. This applies to any type or function that does not appear in the official documentation.

0.6.0 - 2022-03-10

Strings

Numbers

  • Added: new class Version to facilitate working with semantic versioning, especially semantic version parsing and comparison

Arrays

Types

Fluent

  • Added: Experimental module. API not finalized and may be subject to drastic changes in future versions. Not accessible through the main module entry and not contained within the current library docs. Use at your own risk.

Other

  • Changed: The npm package now contains compiled CommonJS files (previously compiled ES modules). Due to continued poor ESM support, this should make it easier to include in existing projects alongside other libraries.
  • Fixed: various circular dependencies

0.5.3 - 2021-07-08

Arrays

  • Fixed: issue where Arrays.sort() would not properly order multiple sort functions (the first would be pushed to the back)

0.5.2 - 2021-07-08

List

  • Fixed: issue where calling List.prototype.sort() with a custom sort function would not sort the list properly

0.5.1 - 2021-07-08

List

  • Fixed: issue where calling List.prototype.sort() would result in infinite recursion

Other

  • Fixed: circular dependencies between modules

0.5.0 - 2021-06-24

Arrays

Assert

Flags

  • Added: new module

Numbers

  • Renamed: Range.between() to Range.isBetween()
  • Renamed: Range.intersect() to Range.intersectionPoint()
  • Changed: Range.intersectionPoint now returns Number.NaN if no intersection was found
  • Added: new function Range.intersect()
  • Added: new function Range.union()
  • Added: new function Range.getOffset()
  • Added: new function Range.isEmpty()

Objects

Strings

Types

Other

  • Changed: updated online documentation across the board
  • Changed: updated JsDocs across the board

0.4.0 - 2020-11-13

Assert

  • Removed: Assert.some() as its usefulness was limited (you could just do Assert.that(array.some(predicate)) instead)
  • Changed: all assertion functions (except Assert.every()) now return void and are TypeScript assertion functions
  • Changed: all assertion functions except Assert.that() now no longer accept a second argument to change the failure message; instead this argument now specifies the name of the variable or property of the value that is being checked
  • Changed: Assert.every() no longer accepts a predicate as its second argument; instead it is now a callback function returning void that should throw an assertion error if the element does not pass the assertion
  • Added: new configuration property stringifyOptions (see Objects.stringify())

Arrays

Numbers

  • Removed: all function aliases, including Arrays.approaches(), Arrays.closeTo(), Arrays.average(), and Arrays.avg() (see edff19f2 for the reasoning behind this change)
  • Removed: Numbers.center() in favor of Range.center()
  • Removed: Numbers.integral() in favor of Number.isInteger()
  • Renamed: Numbers.float() to Numbers.isFloat() to better communicate its intent
  • Renamed: Numbers.safeFloat() to Numbers.isSafeFloat() to better communicate its intent
  • Renamed: Numbers.unsafeFloat() to Numbers.isUnsafeFloat() to better communicate its intent
  • Fixed: Numbers.isFloat() did not handle NaN, Infinity and -Infinity correctly

Objects

Strings

Types

  • Added: new type alias Truthy<T>
  • Added: new type alias Falsy<T>
  • Added: new interface Iterable and corresponding type guard isIterable()
  • Fixed: Instantiable: leaving the second type parameter as its default now allows you specify any number of constructor arguments of any type (previously allowed no arguments)

Other

  • Added: online documentation for all modules, functions, and types
  • Changed: updated JsDocs across the board
  • Fixed: Range is now properly re-exported from the main module entry
  • Changed: Added ReadonlyRange as export from main module entry

0.3.0 - 2020-11-05

Assert

  • Changed: the assertion functions truthy(), falsy(), notNull(), every(), and some() now return the value that was passed in to allow for more fluent usage syntax

Numbers

Objects

  • Changed: the Objects functions structure(), swap(), and equatable() now only expect an object as their first argument (previously expected an object with an index signature)
  • Changed: Objects.structure() now accepts any object (previously threw an error if the object was not an object literal)
  • Changed: Objects.equatable() now throws an error if target object contains a non-function "equals" property

Types

  • Changed: the helper type ObjectLiteral<T> now stands for Record<string | number | symbol, T> (from Record<string, T>)

Other

  • Changed: updated several JsDoc texts to be more descriptive

0.2.0 - 2020-09-13

Arrays

Objects

Strings

Types

0.1.1 - 2020-09-13

  • Fixed: "directory import '..." is not supported resolving ES modules" error when attempting to import from main module entry in node.js projects

0.1.0 - 2020-09-13

  • Changed: mark package as being of type "module" to enable ESM in node.js projects

0.0.4 - 2020-08-09

  • Fixed: build errors by publishing project from build directory
  • Removed: redundant .npmignore

0.0.3 - 2020-08-09

  • Fixed: build errors

0.0.2 - 2020-08-09

  • Fixed: missing .npmignore resulting in incorrect npm packaging

0.0.1 - 2020-08-09

  • Initial release