Code Monkey home page Code Monkey logo

Comments (4)

Helveg avatar Helveg commented on July 20, 2024 1

yea I think a general solution would be:

$import:
    ref: path/to/file#/
    include: 
      - connectivity
      - placement/B
    exclude:
      - connectivity/A

right? Where you have generic fine grained access to the nested keys you want to include and exclude?

from bsb-core.

Helveg avatar Helveg commented on July 20, 2024

there's a keys kind of thing for $import already, which can serve as a workaround. If you could source dive and clarify that mechanism here? :D should be:

$import:
  ref: ...
  keys: A, B, C

and then only the A, B and C key will be copied over.

You could rename that to include(_keys), exclude(_keys)

from bsb-core.

drodarie avatar drodarie commented on July 20, 2024

I should have put more description: if I want to import every key from a file but one, then I have to specify all the other key.
For instance, if I want to import every connectivity strategies from the connectivity field but the key A, I will have to list all the other keys from the connectivity field.

connectivity:
  $import:
    ref: path/to/file#/connectivity
    values:
      - B
      - C
      - D
      - ...

Now it does not matter if I want to override A: I can import it and have it modified by a local field:

connectivity:
  A:
    ...
$import:
  ref: path/to/file#/
  values:
      - connectivity

But if I do not want A anymore, I do not think there is an alternative. With the exclude field:

$import:
    ref: path/to/file#/
    values: 
      - connectivity
    exclude:
      - connectivity/A

from bsb-core.

Helveg avatar Helveg commented on July 20, 2024

I think the behaviour should be:

  • include:
    • not given: include everything
    • given: include only the given include keys.
  • exclude: remove these keys from what has been included

from bsb-core.

Related Issues (20)

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.