Coder Social home page Coder Social logo

Comments (10)

Prinzhorn avatar Prinzhorn commented on July 18, 2024 1

Found it https://github.com/longshotlabs/simpl-schema#set-default-options-for-one-schema

from meteor-collection2.

Prinzhorn avatar Prinzhorn commented on July 18, 2024

Actually, let's keep it open for the global version (exposing

const defaultCleanOptions = {
filter: true,
autoConvert: true,
removeEmptyStrings: true,
trimStrings: true,
removeNullsFromArrays: false,
};
somehow). Because I still need to put this in every single constructor.

from meteor-collection2.

harryadel avatar harryadel commented on July 18, 2024

Actually, let's keep it open for the global version (exposing somehow). Because I still need to put this in every single constructor.

If the sole purpose of keeping this issue open is for future reference then it's better to close it.

from meteor-collection2.

Prinzhorn avatar Prinzhorn commented on July 18, 2024

If the sole purpose of keeping this issue open is for future reference then it's better to close it.

No, as a feature request to expose the defaultCleanOptions options. The original issue where basically two feature requests of which one I just didn't find originally and it already exists.

from meteor-collection2.

harryadel avatar harryadel commented on July 18, 2024

Please bear with me as I try to understand this.

No, as a feature request to expose the defaultCleanOptions options

Isn't already exposed as you can assign it along with your schema? Can you please give me a code example of what you want to achieve? Thanks.

from meteor-collection2.

Prinzhorn avatar Prinzhorn commented on July 18, 2024

Can you please give me a code example of what you want to achieve?

I want the same sane options for every single schema without having to put it into every single SimpleSchema constructor (can be forgotten or inconsistent -> source of bugs). If I could update defaultCleanOptions then this would work for all schemas automatically.

Replacing const defaultCleanOptions with Collection2.defaultCleanOptions for example would allow exactly that.

master...Prinzhorn:patch-1

from meteor-collection2.

harryadel avatar harryadel commented on July 18, 2024

Isn't this already achievable via https://github.com/longshotlabs/simpl-schema#set-default-options-for-all-schemas ?

from meteor-collection2.

harryadel avatar harryadel commented on July 18, 2024

I've a PR in the works but while I was about to add notes to the README I found about the ability to set this in simpl-schema as referenced in my previous comment. @Prinzhorn

from meteor-collection2.

Prinzhorn avatar Prinzhorn commented on July 18, 2024

@harryadel thanks for looking into this. It does not quite solve the same problem. Because what if I'm using the simpl-schema package in the same project for other unrelated purposes. Your draft PR would allow the same options for all the attachSchema use-cases while not messing with the rest.

from meteor-collection2.

harryadel avatar harryadel commented on July 18, 2024

I see. If that's the case then I'll take your word for it. Please review #434 There's something off with the tests that I'm fixing right now. Once it's set and you reviewed it we can merge and release a new version.

from meteor-collection2.

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.