Code Monkey home page Code Monkey logo

froebel's People

Contributors

dependabot[bot] avatar honkinggoose avatar mathisbullinger avatar mgred avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

froebel's Issues

Fails to resolve types with "moduleResolution": "bundler" in tsconfig

Could not find a declaration file for module 'froebel/forward'. '/Users/daniel/testproject/node_modules/froebel/forward.mjs' implicitly has an 'any' type.
  There are types at '/Users/daniel/testproject/node_modules/froebel/forward.d.ts', but this result could not be resolved when respecting package.json "exports". The 'froebel' library may need to update its package.json or typings.

Adding a types property to every export in package.json solves it:

{
  "name": "froebel",
  "version": "0.23.2",
  "description": "TypeScript utility library",
  "main": "index.js",
  "types": "index.d.ts",
  "exports": {
    ".": {
      "require": "./index.js",
      "import": "./index.mjs",
      "types": "./index.d.ts"
    },
    "./atWrap": {
      "require": "./atWrap.js",
      "import": "./atWrap.mjs",
      "types": "./atWrap.d.ts"
    },
    "./batch": {
      "require": "./batch.js",
      "import": "./batch.mjs",
      "types": "./batch.d.ts"
    },
    "./bimap": {
      "require": "./bimap.js",
      "import": "./bimap.mjs",
      "types": "./bimap.d.ts"
    },
    "./bundle": {
      "require": "./bundle.js",
      "import": "./bundle.mjs",
      "types": "./bundle.d.ts"
    },
    "./callAll": {
      "require": "./callAll.js",
      "import": "./callAll.mjs",
      "types": "./callAll.d.ts"
    },
    "./case": {
      "require": "./case.js",
      "import": "./case.mjs",
      "types": "./case.d.ts"
    },
    "./clamp": {
      "require": "./clamp.js",
      "import": "./clamp.mjs",
      "types": "./clamp.d.ts"
    },
    "./clone": {
      "require": "./clone.js",
      "import": "./clone.mjs",
      "types": "./clone.d.ts"
    },
    "./debounce": {
      "require": "./debounce.js",
      "import": "./debounce.mjs",
      "types": "./debounce.d.ts"
    },
    "./ds": {
      "require": "./ds.js",
      "import": "./ds.mjs",
      "types": "./ds.d.ts"
    },
    "./equal": {
      "require": "./equal.js",
      "import": "./equal.mjs",
      "types": "./equal.d.ts"
    },
    "./equality": {
      "require": "./equality.js",
      "import": "./equality.mjs",
      "types": "./equality.d.ts"
    },
    "./error": {
      "require": "./error.js",
      "import": "./error.mjs",
      "types": "./error.d.ts"
    },
    "./except": {
      "require": "./except.js",
      "import": "./except.mjs",
      "types": "./except.d.ts"
    },
    "./forward": {
      "require": "./forward.js",
      "import": "./forward.mjs",
      "types": "./forward.d.ts"
    },
    "./function": {
      "require": "./function.js",
      "import": "./function.mjs",
      "types": "./function.d.ts"
    },
    "./ident": {
      "require": "./ident.js",
      "import": "./ident.mjs",
      "types": "./ident.d.ts"
    },
    "./index": {
      "require": "./index.js",
      "import": "./index.mjs",
      "types": "./index.d.ts"
    },
    "./invoke": {
      "require": "./invoke.js",
      "import": "./invoke.mjs",
      "types": "./invoke.d.ts"
    },
    "./isPromise": {
      "require": "./isPromise.js",
      "import": "./isPromise.mjs",
      "types": "./isPromise.d.ts"
    },
    "./iterable": {
      "require": "./iterable.js",
      "import": "./iterable.mjs",
      "types": "./iterable.d.ts"
    },
    "./list": {
      "require": "./list.js",
      "import": "./list.mjs",
      "types": "./list.d.ts"
    },
    "./map": {
      "require": "./map.js",
      "import": "./map.mjs",
      "types": "./map.d.ts"
    },
    "./math": {
      "require": "./math.js",
      "import": "./math.mjs",
      "types": "./math.d.ts"
    },
    "./memoize": {
      "require": "./memoize.js",
      "import": "./memoize.mjs",
      "types": "./memoize.d.ts"
    },
    "./merge": {
      "require": "./merge.js",
      "import": "./merge.mjs",
      "types": "./merge.d.ts"
    },
    "./noop": {
      "require": "./noop.js",
      "import": "./noop.mjs",
      "types": "./noop.d.ts"
    },
    "./nullish": {
      "require": "./nullish.js",
      "import": "./nullish.mjs",
      "types": "./nullish.d.ts"
    },
    "./nullishChain": {
      "require": "./nullishChain.js",
      "import": "./nullishChain.mjs",
      "types": "./nullishChain.d.ts"
    },
    "./object": {
      "require": "./object.js",
      "import": "./object.mjs",
      "types": "./object.d.ts"
    },
    "./omit": {
      "require": "./omit.js",
      "import": "./omit.mjs",
      "types": "./omit.d.ts"
    },
    "./oneOf": {
      "require": "./oneOf.js",
      "import": "./oneOf.mjs",
      "types": "./oneOf.d.ts"
    },
    "./partial": {
      "require": "./partial.js",
      "import": "./partial.mjs",
      "types": "./partial.d.ts"
    },
    "./partition": {
      "require": "./partition.js",
      "import": "./partition.mjs",
      "types": "./partition.d.ts"
    },
    "./path": {
      "require": "./path.js",
      "import": "./path.mjs",
      "types": "./path.d.ts"
    },
    "./pick": {
      "require": "./pick.js",
      "import": "./pick.mjs",
      "types": "./pick.d.ts"
    },
    "./pipe": {
      "require": "./pipe.js",
      "import": "./pipe.mjs",
      "types": "./pipe.d.ts"
    },
    "./predicate": {
      "require": "./predicate.js",
      "import": "./predicate.mjs",
      "types": "./predicate.d.ts"
    },
    "./prefix": {
      "require": "./prefix.js",
      "import": "./prefix.mjs",
      "types": "./prefix.d.ts"
    },
    "./promise": {
      "require": "./promise.js",
      "import": "./promise.mjs",
      "types": "./promise.d.ts"
    },
    "./promisify": {
      "require": "./promisify.js",
      "import": "./promisify.mjs",
      "types": "./promisify.d.ts"
    },
    "./queue": {
      "require": "./queue.js",
      "import": "./queue.mjs",
      "types": "./queue.d.ts"
    },
    "./range": {
      "require": "./range.js",
      "import": "./range.mjs",
      "types": "./range.d.ts"
    },
    "./repeat": {
      "require": "./repeat.js",
      "import": "./repeat.mjs",
      "types": "./repeat.d.ts"
    },
    "./select": {
      "require": "./select.js",
      "import": "./select.mjs",
      "types": "./select.d.ts"
    },
    "./settled": {
      "require": "./settled.js",
      "import": "./settled.mjs",
      "types": "./settled.d.ts"
    },
    "./shuffle": {
      "require": "./shuffle.js",
      "import": "./shuffle.mjs",
      "types": "./shuffle.d.ts"
    },
    "./sortedArray": {
      "require": "./sortedArray.js",
      "import": "./sortedArray.mjs",
      "types": "./sortedArray.d.ts"
    },
    "./sortedMap": {
      "require": "./sortedMap.js",
      "import": "./sortedMap.mjs",
      "types": "./sortedMap.d.ts"
    },
    "./string": {
      "require": "./string.js",
      "import": "./string.mjs",
      "types": "./string.d.ts"
    },
    "./suffix": {
      "require": "./suffix.js",
      "import": "./suffix.mjs",
      "types": "./suffix.d.ts"
    },
    "./surround": {
      "require": "./surround.js",
      "import": "./surround.mjs",
      "types": "./surround.d.ts"
    },
    "./take": {
      "require": "./take.js",
      "import": "./take.mjs",
      "types": "./take.d.ts"
    },
    "./throttle": {
      "require": "./throttle.js",
      "import": "./throttle.mjs",
      "types": "./throttle.d.ts"
    },
    "./truthy": {
      "require": "./truthy.js",
      "import": "./truthy.mjs",
      "types": "./truthy.d.ts"
    },
    "./types": {
      "require": "./types.js",
      "import": "./types.mjs",
      "types": "./types.d.ts"
    },
    "./unary": {
      "require": "./unary.js",
      "import": "./unary.mjs",
      "types": "./unary.d.ts"
    },
    "./unzip": {
      "require": "./unzip.js",
      "import": "./unzip.mjs",
      "types": "./unzip.d.ts"
    },
    "./zip": {
      "require": "./zip.js",
      "import": "./zip.mjs",
      "types": "./zip.d.ts"
    }
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/MathisBullinger/froebel.git"
  },
  "author": "Mathis Bullinger",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/MathisBullinger/froebel/issues"
  },
  "homepage": "https://github.com/MathisBullinger/froebel#readme",
  "devDependencies": {
    "@babel/cli": "^7.18.10",
    "@babel/core": "^7.18.10",
    "@babel/plugin-transform-typescript": "^7.18.12",
    "@babel/preset-env": "^7.18.10",
    "@types/node": "^17.0.35",
    "typedoc": "^0.22.17",
    "typescript": "^4.7.3"
  }
}

React Native support

throttle breaks the default React Native build (0.70.2).

performance isn't available in React Native, and neither is perf_hooks.

I have not yet investigated the conventional alternative.

Proposal: `mergeDeep`

Basically I'm not sure about lodash's _.merge.

The docs are extremely "wordy" around enumerable properties, giving me pause about the implementation, and the type defs Iโ€™ve seen in lodash (so far) seem overly complicated.

Related: sindresorhus/ts-extras#55

Does the `pipe` type need to be recursive?

I saw your post about type-checking a pipe function here and posted a reply:

Does it need to be recursive?

Here's the approach I came up with, before giving up:

playground

My approach was to just take one item off the start of the list, and one item off the end of the list - derive the input arguments and output return types from the two lists, and then see if they're the same.

If we can compute a set of InputTypes and OutputTypes and just check if those match, why do we need the whole recursive thing?

For better error reporting maybe? I guess with my approach, the entire array will be faulted - whereas with your approach, the error will point to the individual argument at fault?

Utility Request: Unary

It would be great to have a unary utility. Like this in plain JS but not sure how to implement it in TS:

const unary = (f) => {
  return f.length === 1 ? f : (args) => f(args)
}

That way we could do things like:

['1', '2', '3'].map(unary(parseInt))

Example this discussion/explanation about why the unary utility is useful.

My apologies if this already exists in here under a different name. This is a fantastic library! ๐Ÿ‘

Future Request: castArray

It would be nice to have a castArray utility.

something like this

function castArray<T>(x: T | T[]): T[] {
  return x === undefined ? [] : Array.isArray(x) ? x : [x];
}

Clone (structuredClone) doesn't work with proxies

A lot of frameworks use Proxies for their reactivity, Vue included, but that makes it impossible to use structuredClone.

Vue team explicitely suggests to use clone functions, but this library clone function uses structured clone if available, which breaks thing when proxies are involved, unless of course you use browser which doesn't support structuredClone, then things work correctly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.