@fp-ts/data
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -562,3 +562,19 @@ /** | ||
export declare const cross: <B>(that: Chunk<B>) => <A>(self: Chunk<A>) => Chunk<readonly [A, B]>; | ||
/** | ||
* Zips this chunk with the index of every element, starting from the initial | ||
* index value. | ||
* | ||
* @category elements | ||
* @since 1.0.0 | ||
*/ | ||
export declare const zipWithIndex: <A>(self: Chunk<A>) => Chunk<readonly [A, number]>; | ||
/** | ||
* Zips this chunk with the index of every element, starting from the initial | ||
* index value. | ||
* | ||
* @category elements | ||
* @since 1.0.0 | ||
*/ | ||
export declare const zipWithIndexOffset: (offset: number) => <A>(self: Chunk<A>) => Chunk<[A, number]>; | ||
export {}; | ||
//# sourceMappingURL=Chunk.d.ts.map |
38
Chunk.js
@@ -14,3 +14,3 @@ "use strict"; | ||
exports.union = union; | ||
exports.zipWith = exports.zipAllWith = exports.zipAll = exports.zip = exports.unzip = exports.unsafeLast = exports.unsafeHead = exports.unsafeGet = exports.unsafeFromArray = void 0; | ||
exports.zipWithIndexOffset = exports.zipWithIndex = exports.zipWith = exports.zipAllWith = exports.zipAll = exports.zip = exports.unzip = exports.unsafeLast = exports.unsafeHead = exports.unsafeGet = exports.unsafeFromArray = void 0; | ||
@@ -1596,4 +1596,40 @@ var Equal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Equal")); | ||
const cross = that => self => (0, _Function.pipe)(self, crossWith(that, (a, b) => [a, b])); | ||
/** | ||
* Zips this chunk with the index of every element, starting from the initial | ||
* index value. | ||
* | ||
* @category elements | ||
* @since 1.0.0 | ||
*/ | ||
exports.cross = cross; | ||
const zipWithIndex = self => zipWithIndexOffset(0)(self); | ||
/** | ||
* Zips this chunk with the index of every element, starting from the initial | ||
* index value. | ||
* | ||
* @category elements | ||
* @since 1.0.0 | ||
*/ | ||
exports.zipWithIndex = zipWithIndex; | ||
const zipWithIndexOffset = offset => self => { | ||
const iterator = self[Symbol.iterator](); | ||
let next; | ||
let i = offset; | ||
const builder = []; | ||
while (!(next = iterator.next()).done) { | ||
builder.push([next.value, i]); | ||
i = i + 1; | ||
} | ||
return unsafeFromArray(builder); | ||
}; | ||
exports.zipWithIndexOffset = zipWithIndexOffset; | ||
//# sourceMappingURL=Chunk.js.map |
@@ -11,3 +11,3 @@ "use strict"; | ||
var _Random = /*#__PURE__*/require("@fp-ts/data/internal/Random"); | ||
var _Random = /*#__PURE__*/require("@fp-ts/data/Random"); | ||
@@ -14,0 +14,0 @@ /** |
@@ -34,2 +34,3 @@ /** | ||
import * as queue from "@fp-ts/data/Queue"; | ||
import * as random from "@fp-ts/data/Random"; | ||
import * as readonlyArray from "@fp-ts/data/ReadonlyArray"; | ||
@@ -183,2 +184,6 @@ import * as redBlackTree from "@fp-ts/data/RedBlackTree"; | ||
*/ | ||
random, | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
readonlyArray, | ||
@@ -185,0 +190,0 @@ /** |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.weakIterableMap = exports.traversableFilterable = exports.string = exports.sortedSet = exports.sortedMap = exports.safeEval = exports.refinement = exports.redBlackTree = exports.readonlyArray = exports.queue = exports.predicate = exports.orPatch = exports.option = exports.number = exports.nonEmptyReadonlyArray = exports.mutableRef = exports.mutableQueue = exports.mutableListBuilder = exports.mutableList = exports.mutableHashSet = exports.mutableHashMap = exports.list = exports.identity = exports.hashSetPatch = exports.hashSet = exports.hashMapPatch = exports.hashMap = exports.function = exports.fromOption = exports.filterable = exports.equal = exports.endomorphism = exports.either = exports.duration = exports.differ = exports.contextPatch = exports.context = exports.const_ = exports.compactable = exports.chunkPatch = exports.chunk = exports.boolean = void 0; | ||
exports.weakIterableMap = exports.traversableFilterable = exports.string = exports.sortedSet = exports.sortedMap = exports.safeEval = exports.refinement = exports.redBlackTree = exports.readonlyArray = exports.random = exports.queue = exports.predicate = exports.orPatch = exports.option = exports.number = exports.nonEmptyReadonlyArray = exports.mutableRef = exports.mutableQueue = exports.mutableListBuilder = exports.mutableList = exports.mutableHashSet = exports.mutableHashMap = exports.list = exports.identity = exports.hashSetPatch = exports.hashSet = exports.hashMapPatch = exports.hashMap = exports.function = exports.fromOption = exports.filterable = exports.equal = exports.endomorphism = exports.either = exports.duration = exports.differ = exports.contextPatch = exports.context = exports.const_ = exports.compactable = exports.chunkPatch = exports.chunk = exports.boolean = void 0; | ||
@@ -129,2 +129,6 @@ var boolean = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Boolean")); | ||
var random = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Random")); | ||
exports.random = random; | ||
var readonlyArray = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/ReadonlyArray")); | ||
@@ -131,0 +135,0 @@ |
{ | ||
"name": "@fp-ts/data", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2072441
41074