Giter Site home page Giter Site logo

envreader's People

Contributors

devcirclede avatar vansari avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

envreader's Issues

ArrayType needed

EnvReader must support array Values from ENV Keys

Expected Declaration:
CUSTOM_ENV=[foo,bar,baz]

Expected Result:

[
    'foo‘,
    'bar‘,
    'baz‘,
]

Rules:

  • Value must start with [ and must end with ]
  • Delimiter must be a comma
  • each value in the array will be parsed as string

JsonType

It would be helpful to have a JsonType where the user can config a more complex Value.

Expected Theme:
CUSTOM_ENV="{\“property\“:\"foo\", \"values\“: [{\“bar\“: \"${ANOTHER_ENV}\"}]}“

Expected Result:

[
    'property‘ => 'foo‘,
    'values‘ => [
        [
            'bar‘ => 'another env‘,
        ],
    ],
]        

Rules:

  • each Property must be in escaped quotes
  • value must be a valid json string

Detailed README.md

At the moment the README.md has only a very slimmed down content.
The content must be filled with more details like usage, Licence, Tests execution etc.

Better Configuration

At this time the default Types are set in the constructor of the EnvParser class.
I search a way to „inject“ a Default Config where the User can append additional Types

Parse Multidimensional Arrays

At the Moment in Issue #5 we can parse only primitive arrays
It would be helpful if we can parse multidimensional arrays.

Test cases:

'Array with subarrays' => [
    'input‘ => '[a,b,c,[123,23,2,[abc,def]], d,e,f]‘,
    'expected‘ => ['a', 'b', 'c', [123, 23, 2, ['abc', 'def']], 'd', 'e', ‚f‘]
],
'Array with subarrays #2' => [
    'input‘ => '[[123,23,2,[abc,def]], a,b,c,d,e,f]‘,
    'expected‘ => [[123, 23, 2, ['abc', 'def']], 'a', 'b', 'c', 'd', 'e', ‚f‘]
],
'Array with subarrays #3' => [
    'input‘ => '[[123,23,2], a,b,c,d,e,f,[abc,def]]‘,
    'expected‘ => [[123, 23, 2], 'a', 'b', 'c', 'd', 'e', 'f', ['abc', 'def‘]]
]

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.