Skip to content

Commit

Permalink
Merge pull request #13 from eloqjs/dev
Browse files Browse the repository at this point in the history
Release v1.0.0-alpha.4
  • Loading branch information
JoaoPedroAS51 authored Nov 24, 2020
2 parents 87713a4 + 958cd98 commit cbb3868
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 25 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
"version": "0.0.0-development",
"description": "The collection for your resources. Made specifically to work with arrays of objects from your API Responses.",
"main": "build/index.js",
"types": "types/index.d.ts",
"types": "build/index.d.ts",
"files": [
"build",
"types"
"build"
],
"scripts": {
"build": "rimraf ./build && tsc",
Expand Down
22 changes: 11 additions & 11 deletions src/Collection.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
import type {
ClassCollection,
ClassConstructor,
Constructor,
DefaultValue,
ItemData,
ItemOrDefault,
Key,
KeyVariadic,
Operator
} from '../types'
import clone from './helpers/clone'
import getProp from './helpers/getProp'
import getValue from './helpers/getValue'
Expand All @@ -29,6 +18,17 @@ import resolveValue from './helpers/resolveValue'
import { sortGreaterOrLessThan, sortNullish } from './helpers/sort'
import variadic from './helpers/variadic'
import { compareValues, whereHasValues } from './helpers/where'
import type {
ClassCollection,
ClassConstructor,
Constructor,
DefaultValue,
ItemData,
ItemOrDefault,
Key,
KeyVariadic,
Operator
} from './types'

export default class Collection<
Item extends ItemData = ItemData
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/getProp.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { KeyVariadic } from '../../types'
import type { KeyVariadic } from '../types'
import clone from './clone'
import { isArray, isObject, isString } from './is'

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/is.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ExtractFunction } from '../../types'
import type { ExtractFunction } from '../types'

/**
* The isArray() method determines whether the passed value is an Array.
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/pluck.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ItemData, Key } from '../../types'
import type { ItemData, Key } from '../types'
import getProp from './getProp'
import { isArray, isObject } from './is'

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/resolveItems.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ItemData } from '../../types'
import { ItemData } from '../types'

/**
* The resolveItems() method maps the items back to their original state based on isWrapped argument.
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/resolveValue.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ItemData, KeyVariadic } from '../../types'
import type { ItemData, KeyVariadic } from '../types'
import getProp from './getProp'
import { isFunction, isObject } from './is'

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/where.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ItemData, KeyVariadic, Operator } from '../../types'
import type { ItemData, KeyVariadic, Operator } from '../types'
import getProp from './getProp'

/**
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ItemData } from '../types'
import Collection from './Collection'
import variadic from './helpers/variadic'
import type { ItemData } from './types'

function collect<Item extends ItemData>(collection: Item[]): Collection<Item>
function collect<Item extends ItemData>(...items: Item[]): Collection<Item>
Expand All @@ -14,3 +14,4 @@ function collect<Item extends ItemData>(

export default collect
export { collect, Collection }
export * from './types'
File renamed without changes.
3 changes: 1 addition & 2 deletions tests/initialize.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { collect, Collection } from '../src'
import type { ItemData } from '../types'
import { collect, Collection, ItemData } from '../src'

describe('Initialize Collection', () => {
describe('collect()', () => {
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"target": "ES6",
"module": "CommonJS",
"declaration": true,
"rootDir": "src",
"outDir": "build",
/* Strict Type-Checking Options */
"strict": true,
Expand All @@ -19,5 +18,5 @@
"forceConsistentCasingInFileNames": true,
"suppressImplicitAnyIndexErrors": true
},
"exclude": ["coverage", "tests"]
"include": ["src"]
}

0 comments on commit cbb3868

Please sign in to comment.