Giter Club home page Giter Club logo

default-composer's People

Contributors

allcontributors[bot] avatar aralroca avatar leeferwagen avatar namhtpyn avatar robinpokorny 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

default-composer's Issues

Module not found: Default condition should be last one

First of all: thank you for this nice tiny lib! ๐Ÿ‘

What version of this package are you using?
0.5.0

What operating system, Node.js, and npm version?
node: v18.15.0, yarn: 4.0.0-rc.45

What happened?
I would like to use default-composer in a NextJS-Project and got the following error on importing:

next:dev: Module not found: Default condition should be last one
...
next:dev: > 4 | import { defaultComposer } from "default-composer";

Accoording to Node-Specification about conditional exports:

"default" - the generic fallback that always matches. Can be a CommonJS or ES module file. This condition should always come last.

I tried to change it locally from:

  "exports": {
    "require": "./dist/index.js",
    "default": "./dist/index.modern.mjs",
    "types": "./dist/index.d.ts"
  }

to

"exports": {
    "require": "./dist/index.js",
    "types": "./dist/index.d.ts",
    "default": "./dist/index.modern.mjs"
  }

and the error is gone.

Could you please have a look.

Install as ES module

What problem do you want to solve?
Use this module in a non npm/yarn setup.

Proposed use case:

Use this library as a <script type="module" import directly in the browser.

Are you willing to submit a pull request to implement this change?
Maybe with some guidance.

Default-composer lost type with mathjs

What version of this package are you using?
0.5.1

What operating system, Node.js, and npm version?
Windows, node 18.15.0, npm 9.6.3

What happened?
Passing through default-composer make object to lose methods and other attributes
See code below:

import { unit, isUnit } from "mathjs";
import { defaultComposer } from "default-composer";

const def = {
  a: unit(0, "mm"),
  b: unit(0, "mm"),
  c: unit(0, "mm"),
};

const dim = {
  a: unit(1, "mm"),
  b: unit(2, "mm"),
  c: unit(3, "mm"),
};

console.log(isUnit(dim.a)); // returns true since a is of type mathjs.Unit
const full = defaultComposer(def, dim);
console.log(isUnit(full.a)); // returns false since a is missing of some attributes of mathjs.Unit

I think that during the 'compose' function, you not check for methods (aka functions) on object and (maybe) other stuffs. This make a complex object to lose some attributes.

failed to compile in my React app

"default-composer": "^0.4.0"

NODE v16.13.0 NPM 16.13.0 (Currently using 64-bit executable)

Failed to compile on npm start

Failed to compile.

Module parse failed: Unexpected token (30:33)
| },
| p = o(b),

    s = e.isDefaultableValue?.(_objectSpread({}, b, {

| defaultableValue: p
| })) ?? p;

I expected the app to start

Sorry I cannot submit pull request due to NDA

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.