@mathigon/core
Advanced tools
Comparing version 0.6.5 to 0.6.6
@@ -588,2 +588,9 @@ 'use strict'; | ||
} | ||
function* flatMap(set, map) { | ||
for (const s of set) { | ||
for (const x of map(s)) { | ||
yield x; | ||
} | ||
} | ||
} | ||
class Itarray { | ||
@@ -693,2 +700,3 @@ constructor(...values) { | ||
exports.first = first; | ||
exports.flatMap = flatMap; | ||
exports.flatten = flatten; | ||
@@ -695,0 +703,0 @@ exports.intersect = intersect; |
@@ -584,2 +584,9 @@ // ============================================================================= | ||
} | ||
function* flatMap(set, map) { | ||
for (const s of set) { | ||
for (const x of map(s)) { | ||
yield x; | ||
} | ||
} | ||
} | ||
class Itarray { | ||
@@ -674,2 +681,2 @@ constructor(...values) { | ||
export { Cache, Color, EventTarget, Itarray, applyDefaults, autoCorrect, cache, chunk, cumulative, deepExtend, defer, delay, difference, every, first, flatten, intersect, isOneOf, isPalindrome, join, last, list, loop, repeat, repeat2D, rotate, run, safeToJSON, some, sortBy, stringDistance, tabulate, tabulate2D, throttle, toCamelCase, toLinkedList, toTitleCase, total, uid, unique, wait, words }; | ||
export { Cache, Color, EventTarget, Itarray, applyDefaults, autoCorrect, cache, chunk, cumulative, deepExtend, defer, delay, difference, every, first, flatMap, flatten, intersect, isOneOf, isPalindrome, join, last, list, loop, repeat, repeat2D, rotate, run, safeToJSON, some, sortBy, stringDistance, tabulate, tabulate2D, throttle, toCamelCase, toLinkedList, toTitleCase, total, uid, unique, wait, words }; |
{ | ||
"name": "@mathigon/core", | ||
"version": "0.6.5", | ||
"version": "0.6.6", | ||
"description": "TypeScript utilities library containing function wrappers, string and array helper functions, event classes and color utilities.", | ||
@@ -30,15 +30,15 @@ "keywords": [ | ||
"devDependencies": { | ||
"@rollup/plugin-typescript": "8.2.0", | ||
"@rollup/plugin-typescript": "8.2.1", | ||
"@types/tape": "4.13.0", | ||
"@typescript-eslint/eslint-plugin": "4.15.2", | ||
"@typescript-eslint/parser": "4.15.2", | ||
"eslint": "7.21.0", | ||
"@typescript-eslint/eslint-plugin": "4.20.0", | ||
"@typescript-eslint/parser": "4.20.0", | ||
"eslint": "7.23.0", | ||
"eslint-config-google": "0.14.0", | ||
"eslint-plugin-import": "2.22.1", | ||
"rollup": "2.40.0", | ||
"tape": "5.2.1", | ||
"rollup": "2.44.0", | ||
"tape": "5.2.2", | ||
"ts-node": "9.1.1", | ||
"tslib": "2.1.0", | ||
"typescript": "4.2.2" | ||
"typescript": "4.2.3" | ||
} | ||
} |
@@ -25,3 +25,11 @@ // ============================================================================= | ||
export function* flatMap<S, T>(set: Iterable<T>, map: (x: T) => Iterable<S>) { | ||
for (const s of set) { | ||
for (const x of map(s)) { | ||
yield x; | ||
} | ||
} | ||
} | ||
export class Itarray<T> implements Iterable<T> { | ||
@@ -28,0 +36,0 @@ private readonly values: Iterable<T>[]; |
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
79067
3954
2237
1
0