Skip to content

Commit

Permalink
fix(build): Missing build
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Miller committed Oct 11, 2017
1 parent d1fc149 commit 805cd5a
Show file tree
Hide file tree
Showing 11 changed files with 200 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

dist

# Bower dependency directory (https://bower.io/)
bower_components

Expand Down
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
language: node_js
node_js:
- "node"
branches:
only:
- master
notifications:
email:
on_success: never
Expand All @@ -10,7 +13,7 @@ cache:
yarn: true
directories:
- typings

script:
- npm run run-script
after_success:
Expand Down
1 change: 1 addition & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { lensOf, Lens, idLens } from "./lens";
7 changes: 7 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions dist/lens.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* A lens is an object of getters and setter into a composable structure.
* Useful for getting setting a complicated path while still preserving the typing of the object.
* Lens will transform to and from domain A, B; A <=> B *
*/
export declare class Lens<A extends {}, B> {
/** Way of converting A to B
* Ex: Set in a object id<{ value }().thenKey('value').get({ value: 15 }) ---> 15
*/
readonly get: (source: A) => B;
/** Setting some value of B in A, returning a updater function which should be pure update for an A
* Ex: Set in a object id<{ value }().thenKey('value').set(5)({ value: 15 }) ---> { value: 5 }
*/
readonly set: (value: B) => (source: A) => A;
constructor(get: (source: A) => B, set: (value: B) => (source: A) => A);
/** Composing on another lens so we can extend the operations from an A -> C now
* Ex: Use a fp.set and fp.get to use a path
*/
then<C>(nextLens: Lens<B, C>): Lens<A, C>;
/** Composing updating/ reading with a key to get/ set in B
* Ex: Get/ Set value of a model of { value: number }
*/
thenKey<Key extends keyof B>(key: Key): Lens<A, B[Key]>;
/** Like thenKey but now we have a default
* Ex: Get a value in a model dictionary or return the default
*/
thenKeyOr<Key extends keyof B, C>(key: Key, defaultValue: C & B[Key]): Lens<A, B[Key]>;
/**
* Pass in a function in order to do a read and set combination
* Ex: Increment the value, needs to read then write a new value
*/
update(fn: (value: B) => B): (source: A) => A;
}
/**
* A factory for creating a lens. A lense is an object of getters and setter into a composable structure.
* Useful for getting setting a complicated path while still preserving the typing of the object.
* Lens will transform to and from domain A, B; A <=> B *
*/
declare const lensOf: <A, B>(get: (source: A) => B, set: (value: B) => (source: A) => A) => Lens<A, B>;
/**
* Create the identity lens for a type, like a state.
*/
declare const idLens: <T>() => Lens<T, T>;
export default idLens;
export { idLens, lensOf };
98 changes: 98 additions & 0 deletions dist/lens.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/lens.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file added dist/lens.spec.d.ts
Empty file.
42 changes: 42 additions & 0 deletions dist/lens.spec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/lens.spec.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 805cd5a

Please sign in to comment.