Comparing version 1.1.2 to 2.0.2
import sortArraysByIndex from './sort-arrays-by-index.js'; | ||
export { default as mapUnknownToString } from 'unknown2string'; | ||
export { default as hasKeys } from './has-keys.js'; | ||
export { default as filterByDefined, default as findDefined, default as isDefined, } from './is-defined.js'; | ||
export { default as isNot } from './is-not.js'; | ||
export { default as filterByNumber, default as findNumber, default as isNumber, } from './is-number.js'; | ||
export { default as filterByObject, default as findObject, default as isObject, } from './is-object.js'; | ||
export { default as filterByRecord, default as findRecord, default as isRecord, } from './is-record.js'; | ||
export { default as filterByString, default as findString, default as isString, } from './is-string.js'; | ||
export { default as filterByUndefined, default as isUndefined, } from './is-undefined.js'; | ||
export { default as is } from './is.js'; | ||
export { default as mapBooleanToNumber } from './map-boolean-to-number.js'; | ||
export { default as mapEntriesToRecord } from './map-entries-to-record.js'; | ||
export { default as mapEntryToKey } from './map-entry-to-key.js'; | ||
export { default as mapEntryToValue } from './map-entry-to-value.js'; | ||
export { default as mapMapToEntries } from './map-map-to-entries.js'; | ||
export { default as mapMapToRecord } from './map-map-to-record.js'; | ||
export { default as mapToError } from './map-to-error.js'; | ||
export { default as mapToIndex } from './map-to-index.js'; | ||
export { default as mapUnknownToError } from './map-unknown-to-error.js'; | ||
export { default as mapToString } from './map-to-string.js'; | ||
export { default as not } from './not.js'; | ||
export { default as reduceEntriesToRecord } from './reduce-entries-to-record.js'; | ||
export { default as sortNumbers } from './sort-numbers.js'; | ||
export { default as sortStrings } from './sort-strings.js'; | ||
export { default as sortUnknown } from './sort-unknown.js'; | ||
export { default as sort } from './sort.js'; | ||
export { sortArraysByIndex }; | ||
@@ -16,0 +26,0 @@ export declare const sortEntriesByKey: (a: readonly unknown[], b: readonly unknown[]) => number; |
import sortArraysByIndex from './sort-arrays-by-index.js'; | ||
export { default as mapUnknownToString } from 'unknown2string'; | ||
export { default as hasKeys } from './has-keys.js'; | ||
export { default as filterByDefined, default as findDefined, default as isDefined, } from './is-defined.js'; | ||
export { default as isNot } from './is-not.js'; | ||
export { default as filterByNumber, default as findNumber, default as isNumber, } from './is-number.js'; | ||
export { default as filterByObject, default as findObject, default as isObject, } from './is-object.js'; | ||
export { default as filterByRecord, default as findRecord, default as isRecord, } from './is-record.js'; | ||
export { default as filterByString, default as findString, default as isString, } from './is-string.js'; | ||
export { default as filterByUndefined, default as isUndefined, } from './is-undefined.js'; | ||
export { default as is } from './is.js'; | ||
export { default as mapBooleanToNumber } from './map-boolean-to-number.js'; | ||
export { default as mapEntriesToRecord } from './map-entries-to-record.js'; | ||
export { default as mapEntryToKey } from './map-entry-to-key.js'; | ||
export { default as mapEntryToValue } from './map-entry-to-value.js'; | ||
export { default as mapMapToEntries } from './map-map-to-entries.js'; | ||
export { default as mapMapToRecord } from './map-map-to-record.js'; | ||
export { default as mapToError } from './map-to-error.js'; | ||
export { default as mapToIndex } from './map-to-index.js'; | ||
export { default as mapUnknownToError } from './map-unknown-to-error.js'; | ||
export { default as mapToString } from './map-to-string.js'; | ||
export { default as not } from './not.js'; | ||
export { default as reduceEntriesToRecord } from './reduce-entries-to-record.js'; | ||
export { default as sortNumbers } from './sort-numbers.js'; | ||
export { default as sortStrings } from './sort-strings.js'; | ||
export { default as sortUnknown } from './sort-unknown.js'; | ||
export { default as sort } from './sort.js'; | ||
export { sortArraysByIndex }; | ||
@@ -16,0 +26,0 @@ const FIRST = 0; |
@@ -1,2 +0,2 @@ | ||
export default function isString(value: unknown): value is number; | ||
export default function isString(value: unknown): value is string; | ||
//# sourceMappingURL=is-string.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import sortUnknown from './sort-unknown.js'; | ||
import sort from './sort.js'; | ||
export default function sortArraysByIndex(index) { | ||
@@ -6,5 +6,5 @@ return function sortByIndex(arrA, arrB) { | ||
const valueB = arrB[index]; | ||
return sortUnknown(valueA, valueB); | ||
return sort(valueA, valueB); | ||
}; | ||
} | ||
//# sourceMappingURL=sort-arrays-by-index.js.map |
{ | ||
"name": "fmrs", | ||
"version": "1.1.2", | ||
"version": "2.0.2", | ||
"author": "quisi.do <fmrs@quisi.do>", | ||
@@ -37,3 +37,3 @@ "description": "filters/finds, maps, reduces, and sorts", | ||
"prepack": "yarn run tsc", | ||
"prepublish": "concurrently --kill-others-on-fail --names attw,eslint,publint,vitest \"yarn run attw\" \"yarn run eslint\" \"yarn run publint\" \"yarn run vitest:run\"", | ||
"prepublish": "concurrently --names attw,eslint,publint,vitest --prefix-colors auto \"yarn run attw\" \"yarn run eslint\" \"yarn run publint\" \"yarn run vitest:run\"", | ||
"publint": "publint", | ||
@@ -45,5 +45,2 @@ "tsc": "tsc --project tsconfig.prepack.json", | ||
}, | ||
"dependencies": { | ||
"unknown2string": "^1.0.1" | ||
}, | ||
"devDependencies": { | ||
@@ -56,3 +53,3 @@ "@arethetypeswrong/cli": "^0.16.4", | ||
"@microsoft/eslint-formatter-sarif": "^3.1.0", | ||
"@quisido/eslint-config": "^1.1.1", | ||
"@quisido/eslint-config": "^1.1.2", | ||
"@quisido/vitest-config": "^1.0.1", | ||
@@ -59,0 +56,0 @@ "@typescript-eslint/eslint-plugin": "^8.10.0", |
@@ -19,26 +19,42 @@ # filter/find, map, reduce, sort | ||
- number | ||
- number (`value is number`) | ||
- `arr.every(isNumber)` | ||
- `arr.filter(filterByNumber)` | ||
- `arr.find(findNumber)` | ||
- object (`value is object`) | ||
- `arr.every(isObject)` | ||
- `arr.filter(filterByObject)` | ||
- `arr.find(findObject)` | ||
- record (`value is Record<number | string | symbol, unknown>`) | ||
- `arr.every(isRecord)` | ||
- `arr.filter(filterByRecord)` | ||
- `arr.find(findRecord)` | ||
- string | ||
- `arr.every(isString)` | ||
- `arr.filter(filterByString)` | ||
- `arr.find(findString)` | ||
## Mappers | ||
| from | to | | ||
| ------- | ------------- | | ||
| entries | Record (`{}`) | | ||
| `Map` | entries | | ||
| `Map` | Record (`{}`) | | ||
| unknown | index | | ||
| unknown | string | | ||
| from | to | example | | ||
| ------- | ------------- | ---------------------------------------- | | ||
| entries | Record (`{}`) | `mapEntriesToRecord([['key', 'value']])` | | ||
| `Map` | entries | `mapMapToEntries(new Map())` | | ||
| `Map` | Record (`{}`) | `mapMapToRecord(new Map())` | | ||
| unknown | index | `arr.map(mapToIndex)` | | ||
| unknown | string | `arr.map(mapToString)` | | ||
## Reducers | ||
| from | to | | ||
| ------- | ------------- | | ||
| entries | Record (`{}`) | | ||
| from | to | example | | ||
| ------- | ------------- | ---------------------------------------------------------- | | ||
| entries | Record (`{}`) | `Object.entries(record).reduce(reduceEntriesToRecord, {})` | | ||
## Sorters | ||
- arrays (by index) | ||
- number | ||
- string | ||
- unknown | ||
| items | example | | ||
| --------------- | -------------------------------- | | ||
| any | `arr.sort(sort)` | | ||
| arrays by index | `arrOfArrs.sort(sortByIndex(0))` | | ||
| numbers | `arr.sort(sortNumbers)` | | ||
| numbers | `arr.sort(sortStrings)` | |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
60353
0
155
755
60
1
- Removedunknown2string@^1.0.1
- Removedunknown2string@1.0.1(transitive)