diff --git a/docs/aggregate.md b/docs/aggregate.md index ca1478b..c7225e7 100644 --- a/docs/aggregate.md +++ b/docs/aggregate.md @@ -8,7 +8,7 @@ You can check the module import [`here`](./modules.md). -####groupBy +#### groupBy Returns the groupped data of the given array. @@ -40,7 +40,7 @@ const values = [ ``` -####min +#### min Returns the minimum of the given array. @@ -57,7 +57,7 @@ import { MinPipe } from 'angular-pipes/src/aggregate/min.pipe'; ``` -####max +#### max Returns the maximum of the given array. @@ -74,7 +74,7 @@ import { MaxPipe } from 'angular-pipes/src/aggregate/max.pipe'; ``` -####mean +#### mean Returns the mean of the given array. @@ -90,7 +90,7 @@ import { MeanPipe } from 'angular-pipes/src/aggregate/mean.pipe'; {{ [5, 5, 1, 9] | mean }} ``` -####sum +#### sum Returns the sum of the given array. @@ -104,4 +104,4 @@ import { SumPipe } from 'angular-pipes/src/aggregate/sum.pipe'; ```html {{ [5, 5, 1, 9] | sum }} -``` \ No newline at end of file +``` diff --git a/docs/array.md b/docs/array.md index faee4ec..d90a6dc 100644 --- a/docs/array.md +++ b/docs/array.md @@ -10,15 +10,15 @@ * [`without`](#without) * [`intersection`](#intersection) * [`union`](#union) -* [`range`](#range) -* [`map`](#map) +* [`range`](#range) +* [`map`](#map) * [`pluck`](#pluck) * [`where`](#where) * [`firstOrDefault`](#firstordefault) -* [`orderBy`](#orderby) +* [`orderBy`](#orderby) * [`reverse`](#reverse) -* [`count`](#count) -* [`some`](#some) +* [`count`](#count) +* [`some`](#some) * [`every`](#every) * [`shuffle`](#shuffle) * [`take`](#take) @@ -31,7 +31,7 @@ You can check the module import [`here`](./modules.md). -####empty +#### empty Returns true if the collection is empty. @@ -48,7 +48,7 @@ import { EmptyPipe } from 'angular-pipes/src/array/empty.pipe'; {{ [1, 2, 3] | empty }} ``` -####head +#### head Returns the first element of the collection, or undefined if the collection is empty. @@ -65,7 +65,7 @@ import { HeadPipe } from 'angular-pipes/src/array/head.pipe'; {{ [1, 2, 3] | head }} ``` -####initial +#### initial Returns every element but the last of the collection or empty array if the collection is empty. @@ -83,7 +83,7 @@ import { InitialPipe } from 'angular-pipes/src/array/initial.pipe'; ``` -####join +#### join Joins an array into a string. @@ -102,7 +102,7 @@ import { JoinPipe } from 'angular-pipes/src/array/join.pipe'; ``` -####last +#### last Returns the last element of the collection or undefined if the collection is empty. @@ -120,7 +120,7 @@ import { LastPipe } from 'angular-pipes/src/array/last.pipe'; ``` -####tail +#### tail Returns every elements but the first of the collection or empty array if the collection is empty. @@ -138,7 +138,7 @@ import { TailPipe } from 'angular-pipes/src/array/tail.pipe'; ``` -####uniq +#### uniq Returns the collection keeping only one duplicate. @@ -155,7 +155,7 @@ import { UniqPipe } from 'angular-pipes/src/array/uniq.pipe'; {{ ['a', 'b', 'a'] | uniq }} ``` -####without +#### without Returns the collection without the specified elements. @@ -171,17 +171,17 @@ import { WithoutPipe } from 'angular-pipes/src/array/without.pipe'; {{ [1, 2, 3] | without: [1, 3] }} ``` -####intersection +#### intersection Returns the intersection of two collection, works with deep equal. -##### File +##### File ```typescript import { IntersectionPipe } from 'angular-pipes/src/array/intersection.pipe'; ``` -##### Usage +##### Usage ```html {{ [1, 2, 3] | intersection: [1, 2] }} @@ -191,17 +191,17 @@ import { IntersectionPipe } from 'angular-pipes/src/array/intersection.pipe'; {{ [{ a: 1 }, { a: 2 }] | deep | intersection: [{ a: 1 }, { a: 3 }] }} ``` -####union +#### union Returns the union of two collection, works with deep equal. -##### File +##### File ```typescript import { UnionPipe } from 'angular-pipes/src/array/union.pipe'; ``` -##### Usage +##### Usage ```html {{ [1, 2, 3] | union: [1, 2] }} @@ -210,7 +210,7 @@ import { UnionPipe } from 'angular-pipes/src/array/union.pipe'; {{ [{ a: 1 }, { a: 2 }] | deep | union: [{ a: 1 }, { a: 3 }] }} ``` -####range +#### range Returns a range of number with a given size (`default: 0`) and start (`default: 1`). @@ -232,7 +232,7 @@ import { RangePipe } from 'angular-pipes/src/array/range.pipe'; ``` -####map +#### map Returns the collection that is passed through a map function. If no function is provided, the collection is returned unchanged. @@ -248,8 +248,8 @@ import { MapPipe } from 'angular-pipes/src/array/map.pipe'; ```javascript // ... addOne (item) { - - return item + 1; + + return item + 1; } // ... ``` @@ -259,9 +259,9 @@ addOne (item) { ``` -####pluck +#### pluck -Returns an array of the given property of the object in the array. +Returns an array of the given property of the object in the array. ##### File @@ -280,21 +280,21 @@ const values = [{ c: { d: 3, e: { - f: 4 + f: 4 } - } + } }, { a: 2, c: { d: 4, e: { - f: 5 - } + f: 5 + } } }]; // ... -``` +``` ```html {{ values | pluck: 'a' }} @@ -304,7 +304,7 @@ const values = [{ ``` -####where +#### where Filter an array with a given function or a property shorthand. @@ -324,16 +324,16 @@ const values = [{ c: { d: 3, e: { - f: 4 + f: 4 } - } + } }, { a: 2, c: { d: 4, e: { - f: 5 - } + f: 5 + } } }]; @@ -342,10 +342,10 @@ const numbers = [1, 2, 3, 4, 1, 4]; // ... aEqualsOne(item) { - return item.a === 1; + return item.a === 1; } -``` +``` ```html {{ values | where: aEqualsOne }} @@ -354,9 +354,9 @@ aEqualsOne(item) { {{ numbers | where: 1 }} ``` -###firstOrDefault +###firstOrDefault -This pipe behaves exactly like `where` but only return the first element when is found. A default value can be provided if no +This pipe behaves exactly like `where` but only return the first element when is found. A default value can be provided if no such element exists. @@ -376,16 +376,16 @@ const values = [{ c: { d: 3, e: { - f: 4 + f: 4 } - } + } }, { a: 2, c: { d: 4, e: { - f: 5 - } + f: 5 + } } }]; @@ -394,10 +394,10 @@ const numbers = [1, 2, 3, 4, 1, 4]; // ... aEqualsOne(item) { - return item.a === 1; + return item.a === 1; } -``` +``` ```html {{ values | firstOrDefault: aEqualsOne }} @@ -408,7 +408,7 @@ aEqualsOne(item) { {{ numbers | firstOrDefault: 5 }} ``` -####orderBy +#### orderBy Returns a new ordered array. You can order by multiple properties, ascending and descending. @@ -442,7 +442,7 @@ const values = [ ``` -####reverse +#### reverse Returns a reversed array. @@ -459,7 +459,7 @@ import { ReversePipe } from 'angular-pipes/src/array/reverse.pipe'; ``` -####count +#### count Returns the length of the collection. Useful when used with other pipes, otherwise, use the `length` property. Works also for object and string. @@ -477,7 +477,7 @@ import { CountPipe } from 'angular-pipes/src/array/count.pipe'; ``` -####some +#### some Returns true if at least one of the item in the collections pass the predicate. @@ -501,7 +501,7 @@ const predicate = function (item) { ``` -####every +#### every Returns true if every item in the collections pass the predicate. @@ -524,7 +524,7 @@ const predicate = function (item) { {{ [2, 2, 2, 2] | every: predicate }} ``` -####shuffle +#### shuffle Shuffles a collection. @@ -540,7 +540,7 @@ import { ShufflePipe } from 'angular-pipes/src/array/shuffle.pipe'; {{ [1, 2, 3] | shuffle }} ``` -####take +#### take Take the top `n` items of an array. @@ -558,7 +558,7 @@ import { TakePipe } from 'angular-pipes/src/array/take.pipe'; ``` -####takeUntil +#### takeUntil Take until the condition is met. @@ -580,7 +580,7 @@ function predicate (item: any) { {{ [1, 2, 3, 4] | takeUntil: predicate }} ``` -####takeWhile +#### takeWhile Take while the condition is met. @@ -603,7 +603,7 @@ function predicate (item: any) { ``` -####drop +#### drop Drop the last `n` items of an array. @@ -621,9 +621,9 @@ import { DropPipe } from 'angular-pipes/src/array/drop.pipe'; ``` -####deep +#### deep -The `deep` pipe is different from other pipes, it doesn't return new data. It wraps data for other pipes to work +The `deep` pipe is different from other pipes, it doesn't return new data. It wraps data for other pipes to work with deep comparaisons. ##### File @@ -637,9 +637,9 @@ import { DeepPipe } from 'angular-pipes/src/array/deep.pipe'; ```javascript collection: any[] = [ - { a: 1, b: { c: 2 } }, - { a: 1, b: { c: 2 } }, - { a: 1, b: { c: 3 } }, + { a: 1, b: { c: 2 } }, + { a: 1, b: { c: 2 } }, + { a: 1, b: { c: 3 } }, ]; ``` @@ -650,7 +650,7 @@ collection: any[] = [ ``` -####chunk +#### chunk The `chunk` pipe breaks the array into multiple, smaller arrays of a given size: @@ -668,7 +668,7 @@ import { ChunkPipe } from 'angular-pipes/src/array/chunk.pipe'; ``` -####flatten +#### flatten The `flatten` flattens an array. It can be used with the `deep` pipe. diff --git a/docs/boolean.md b/docs/boolean.md index 9f02e43..20e3a3b 100644 --- a/docs/boolean.md +++ b/docs/boolean.md @@ -10,7 +10,7 @@ * [`notIdentical`](#notidentical) * [`isNull`](#isnull) * [`isUndefined`](#isundefined) -* [`isNil`](#isnil) +* [`isNil`](#isnil) * [`isNumber`](#isnumber) * [`isString`](#isstring) * [`isFunction`](#isfunction) @@ -20,7 +20,7 @@ You can check the module import [`here`](./modules.md). -####greater +#### greater Returns true if the first value is greater than the second value. @@ -38,7 +38,7 @@ import { IsGreaterPipe } from 'angular-pipes/src/boolean/conditions.pipe'; {{ 1 | greater: 1 }} ``` -####greaterOrEqual +#### greaterOrEqual Returns true if the first value is greater or equal to the second value. @@ -56,7 +56,7 @@ import { IsGreaterOrEqualPipe } from 'angular-pipes/src/boolean/conditions.pipe' {{ 1 | greaterOrEqual: 1 }} ``` -####less +#### less Returns true if the first value is less than the second value. @@ -74,7 +74,7 @@ import { IsLessPipe } from 'angular-pipes/src/boolean/conditions.pipe'; {{ 1 | less: 1 }} ``` -####lessOrEqual +#### lessOrEqual Returns true if the first value is less or equal to the second value. @@ -92,7 +92,7 @@ import { IsLessOrEqualPipe } from 'angular-pipes/src/boolean/conditions.pipe'; {{ 1 | lessOrEqual: 1 }} ``` -####equal +#### equal Returns true if the value are equal (operator `==`). @@ -110,7 +110,7 @@ import { IsEqualPipe } from 'angular-pipes/src/boolean/conditions.pipe'; {{ 1 | equal: 1 }} ``` -####notEqual +#### notEqual Returns true if the value are not equal (operator `!=`). @@ -129,7 +129,7 @@ import { IsNotEqualPipe } from 'angular-pipes/src/boolean/conditions.pipe'; ``` -####identical +#### identical Returns true if the value are identical (operator `===`). @@ -148,7 +148,7 @@ import { IsIdenticalPipe } from 'angular-pipes/src/boolean/conditions.pipe'; ``` -####notIdentical +#### notIdentical Returns true if the value are not identical (operator `!==`). @@ -167,7 +167,7 @@ import { IsNotIdenticalPipe } from 'angular-pipes/src/boolean/conditions.pipe'; ``` -####isNull +#### isNull Returns true if the value if null. @@ -184,7 +184,7 @@ import { IsNullPipe } from 'angular-pipes/src/boolean/types.pipe'; {{ 1 | isNull }} ``` -####isUndefined +#### isUndefined Returns true if the value if undefined. @@ -201,7 +201,7 @@ import { IsUndefinedPipe } from 'angular-pipes/src/boolean/types.pipe'; {{ 1 | isUndefined }} ``` -####isNil +#### isNil Returns true if the value if null or undefined. @@ -220,7 +220,7 @@ import { IsNilPipe } from 'angular-pipes/src/boolean/types.pipe'; ``` -####isNumber +#### isNumber Returns true if the value is a number. @@ -237,7 +237,7 @@ import { IsNumberPipe } from 'angular-pipes/src/boolean/types.pipe'; {{ 1 | isNumber }} ``` -####isString +#### isString Returns true if the value is a string. @@ -255,7 +255,7 @@ import { IsStringPipe } from 'angular-pipes/src/boolean/types.pipe'; ``` -####isFunction +#### isFunction Returns true if the value is a function. @@ -279,7 +279,7 @@ myFn() { ``` -####isArray +#### isArray Returns true if the value is an array. @@ -298,7 +298,7 @@ import { IsArrayPipe } from 'angular-pipes/src/boolean/types.pipe'; ``` -####isObject +#### isObject Returns true if the value is an object. @@ -317,7 +317,7 @@ import { IsObjectPipe } from 'angular-pipes/src/boolean/types.pipe'; ``` -####isDefined +#### isDefined Returns true if the value is defined (nor null nor undefined). diff --git a/docs/math.md b/docs/math.md index 2d42c8e..ef64362 100644 --- a/docs/math.md +++ b/docs/math.md @@ -6,13 +6,13 @@ * [`round`](#round) * [`degrees`](#degrees) * [`radians`](#degrees) -* [`random`](#random) -* [`pow`](#pow) +* [`random`](#random) +* [`pow`](#pow) * [`sqrt`](#sqrt) You can check the module import [`here`](./modules.md). -####bytes +#### bytes Returns the bytes to an human-readable format. @@ -33,12 +33,12 @@ import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe'; {{ 1099511627776 | bytes }} ``` -##### Todo +##### Todo * Be able to change the input unit. -####ceil +#### ceil Ceils a number with a given precision. Take a look at the official documentation on ceil. @@ -57,7 +57,7 @@ import { CeilPipe } from 'angular-pipes/src/math/ceil.pipe'; ``` -####floor +#### floor Floor a number with a given precision. Take a look at the official documentation on floor. @@ -76,7 +76,7 @@ import { FloorPipe } from 'angular-pipes/src/math/floor.pipe'; ``` -####round +#### round Rounds a number with a given precision. Take a look at the official documentation on round. @@ -97,7 +97,7 @@ import { RoundPipe } from 'angular-pipes/src/math/round.pipe'; ``` -####degrees +#### degrees Converts radians to degrees. @@ -111,14 +111,14 @@ import { DegreesPipe } from 'angular-pipes/src/math/degrees.pipe'; ```javascript this.value = Math.PI; -``` +``` ```html {{ value | degrees }} ``` -####radians +#### radians Converts degrees to radians @@ -135,7 +135,7 @@ import { RadiansPipe } from 'angular-pipes/src/math/radians.pipe'; ``` -####random +#### random Returns a random number between a minimum (default: 0) and a maximum (default: 1). The input is ignored. @@ -155,7 +155,7 @@ import { RandomPipe } from 'angular-pipes/src/math/random.pipe'; {{ {} | random: 10 }} ``` -####sqrt +#### sqrt Returns the square root of a number. @@ -171,7 +171,7 @@ import { SqrtPipe } from 'angular-pipes/src/math/sqrt.pipe'; {{ 81 | sqrt }} ``` -####pow +#### pow Returns the power of a number. @@ -186,4 +186,4 @@ import { PowPipe } from 'angular-pipes/src/math/pow.pipe'; ```html {{ 2 | pow }} {{ 2 | pow: 3 }} -``` \ No newline at end of file +``` diff --git a/docs/object.md b/docs/object.md index 64d5f3b..8e02bca 100644 --- a/docs/object.md +++ b/docs/object.md @@ -6,7 +6,7 @@ You can check the module import [`here`](./modules.md). -####keys +#### keys Returns the array of keys of the given object or array. @@ -32,7 +32,7 @@ const value = { {{ [1, 2, 3] | keys }} ``` -####toArray +#### toArray Transforms an object to an array @@ -58,7 +58,7 @@ const value = { ``` -####defaults +#### defaults Apply defaults value to an object or an object in an array.