Skip to content

Commit

Permalink
Merge pull request #89 from dhershman1/development
Browse files Browse the repository at this point in the history
v0.11.0 Release
  • Loading branch information
dhershman1 authored Jan 22, 2019
2 parents 99f0b14 + 3d0baa4 commit 3b724e9
Show file tree
Hide file tree
Showing 318 changed files with 9,514 additions and 5,579 deletions.
9 changes: 3 additions & 6 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ For any new functionality additions please follow the format of other functional
```
/**
* @name function name
* @function
* @since version it was created in
* @category what the function applies to
* @sig the signature type of the function
Expand All @@ -39,13 +40,9 @@ If you are editing functionality and it requires api changes please be sure to c

## Developing

- Any functionality is expected to work with a single type
- All functionality should be pure functions
- The library is Functional so all new functions should follow this pattern
- Run unit tests with `npm test`
- All unit tests are built using ava with babel so standard js is okay to use
- Make sure the current babel setup is able to transpile your code for support of IE 10+
- Please don't include the seperatly built function files in your request the main `kyanite.min.js` is okay
- If you add new functionality make sure to run `node scripts/create-export.js` which generates a new `index.js` in src that `npm run build` will use to create a new `kyanite.min.js` file
- Before opening a PR make sure you do `npm run scripts` to generate new documentation & build files

## Releasing

Expand Down
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
2. Pass it '...'
3. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.
If applicable/needed, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ Which Function(s) (if any) is in question?

What is the documentation you want to change currently?

**What you expect/want to see**
**What it is expected to be**

Give some context about what you'd expect or want to see instead
17 changes: 0 additions & 17 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

5 changes: 2 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
> Delete any section you're not using and please delete this line too
## Breaking Changes

- List of breaking changes if any
Expand All @@ -13,6 +15,3 @@
## Fixed

- List of bug or functionality fixes if any


Please delete this and any sections above that you are not using
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules/
.nyc_output
coverage/
.DS_Store
tmp.js
benching.js
4 changes: 3 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ coverage
.babelrc
docs
jsdoc.json
.DS_Store
.github
benching.js
tmp.js
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
language: node_js
node_js:
- "8"
- "10"
install:
- npm ci
cache:
directories:
- "$HOME/.npm"
branches:
only:
- master
Expand All @@ -9,4 +14,4 @@ script:
- npm run lint
- npm run test:cov
- npm run check-cov
after_success: npm run coverage
after_success: npm run report
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,54 @@
# Changelog

## v0.11.0

### Breaking Changes

- `factors` output has changed to be inclusive, it also works with negative numbers now
- Example: `factors(-36) // => [1, 2, 3, 4, 6, 9, 12, 18, 36]`
- You can easily get negative factors with `negate` and `map`
- e.g: `map(negate, factors(-36)) // => [-1, -2, -3, -4, -6, -9, -12, -18, -36]`
- `empty` (and `isEmpty` until its removed) will now throw a type error for unsupported types
- `empty` supports the same types as `count` as well as `null` and `undefined`
- e.g: `empty(1) // => TypeError: Unsupported type: Number`
- `juxt` functionality changes. It's now a 2 param curried function that takes arrays for data
- e.g: `juxt([Math.min, Math.max], [3, 4, 9, -3]) // => [-3, 9]`
- Also moved it to be in the array category
- `ap` re written to be a proper S combinator function
- e.g: `ap(x => y => x + y, z => z * 2, 2) // => 6`
- Removed `amend` function since it's really just a limited `Object.assign` no real use for it

### New

- `reduce` now supports iterable types like `Map` and `Set`
- Added `inc` Function which increases a number by 1
- Added `dec` Function which decreases a number by 1
- Added `isZero` Function which checks if the number passed in is equal to the number zero
- Added `size` Function which takes a map or set data type and returns its size
- **Note**: It is currently categorized under `Function` which may change in the future as I add more Map|Set friendly functions
- Added `count` Function which takes any collection based data and counts the values within
- Added `reduced` Function which should be used with `reduce` or `reduceRight` as a short circuit for the function (see improved)
- `has` is now generic for `Array`, `String`, `Object`, `Map`, and `Set` data types
- Added `within` Function which acts like `between` but is exclusive of the numbers provided

### Improved

- `isEmpty` now supports `Maps` and `Sets`
- Slight increase in `partition` performance
- Slight increase in `omit` performance
- Added import example onto each function, so it's visible within the examples
- `factors` had some typos in its docs
- Cleaned up `always` documentation
- Cleaned up `identity` documentation examples
- Cleaned up `type` to be more lightweight
- Completely re wrote `reduce` and `reduceRight`
- No breaking changes
- Both functions now support `reduced` which will short circuit out of the iteration and return the value
- This is a good strategy for performance boosts
- `reduce`, `reduceRight`, and `reduced` are all using the `@@transducer` protocol
- Moved `every`, `some`, `reject`, `filter`, and `find` to use this new flow giving them decent performance improvements
- Tweaked `height` function for a tiny performance boost

## v0.10.3

### Fixed
Expand Down
56 changes: 42 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,42 @@
[![npm](https://img.shields.io/npm/v/kyanite.svg?style=flat-square)](https://www.npmjs.com/package/kyanite)
[![David](https://img.shields.io/david/dhershman1/kyanite.svg?style=flat-square)](https://david-dm.org/dhershman1/kyanite)
[![David](https://img.shields.io/david/dev/dhershman1/kyanite.svg?style=flat-square)](https://david-dm.org/dhershman1/kyanite?type=dev)
[![Travis](https://img.shields.io/travis/dhershman1/kyanite.svg?style=flat-square)](https://travis-ci.org/dhershman1/kyanite)
[![Coverage Status](https://img.shields.io/coveralls/github/dhershman1/kyanite.svg?style=flat-square)](https://coveralls.io/github/dhershman1/kyanite?branch=master)

![kyanite-scaled](https://user-images.githubusercontent.com/8997380/48008308-69174500-e0e7-11e8-9a57-ebd558f094f8.png)

A light weight pure functional library with single type utility functions and it only depends on itself.

[![JavaScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard)
<p align=center>
<a href="https://kyanite.dusty.codes/" title="Kyanite Documentation">
<img alt="Kyanite Logo" src="https://user-images.githubusercontent.com/8997380/48008308-69174500-e0e7-11e8-9a57-ebd558f094f8.png">
</a>
</p>
<br />
<p align=center>
A light weight pure functional library with single type utility functions and it only depends on itself.
</p>
<p align=center>
<a href="./LICENSE">
<img
alt="license:mit"
src="https://img.shields.io/badge/license-mit-green.svg?style=flat-square"
/>
</a>
<a href="https://www.npmjs.com/package/kyanite">
<img alt="Npm Version" src="https://img.shields.io/npm/v/kyanite.svg?style=flat-square">
</a>
<a href="https://david-dm.org/dhershman1/kyanite">
<img alt="Dependencies" src="https://img.shields.io/david/dhershman1/kyanite.svg?style=flat-square">
</a>
<a href="https://david-dm.org/dhershman1/kyanite?type=dev">
<img alt="Dev Dependencies" src="https://img.shields.io/david/dev/dhershman1/kyanite.svg?style=flat-square">
</a>
<a href="https://travis-ci.org/dhershman1/kyanite">
<img alt="Build Status" src="https://img.shields.io/travis/dhershman1/kyanite.svg?style=flat-square">
</a>
<a href="https://coveralls.io/github/dhershman1/kyanite?branch=master">
<img alt="Coverage" src="https://img.shields.io/coveralls/github/dhershman1/kyanite.svg?style=flat-square">
</a>
</p>
<br />

<p align=center>
<a href="https://github.com/standard/standard">
<img alt="Standard JS" src="https://cdn.rawgit.com/standard/standard/master/badge.svg">
</a>
</p>

## Contents

Expand All @@ -28,7 +56,7 @@ The goal for Kyanite is to be stripped down, light weight, and intuitive. The id
- Purely Functional - This was a main focus for the project. I wanted it to be an easy to use, functional system while also being completely pure by making use of piping and transducers to boost performance.
- Single type utility functions - Theoretically, all of the functionality is based around accepting a single data type, doing what it does, and giving you back a result, thus making it reliable, stable, and lightweight.
- Everything is curried! Setup static in one spot and then pass the rest of the dynamic data in later.
- Data last ideaology
- Data last ideology

## How To

Expand All @@ -52,9 +80,9 @@ Standard module system

```js
// This will use the module path in the package.json (src/index.js)
import K from 'kyanite'
import * as K from 'kyanite'
// However if you want to grab the dev version
import K from 'kyanite/dist/kyanite.js'
import * as K from 'kyanite/dist/kyanite.js'
```

Common JS
Expand Down
Loading

0 comments on commit 3b724e9

Please sign in to comment.