Laravel JS Helpers
"Laravel Helper Methods In Javascript"
- data_get, data_set, and data_fill for dot notation -- wildcards ("*") available -- deep object access = @See Laravel data_set, data_get, & data_fill docs (Powerful functions we've got in js now)
- @See Laravel Helper Functions
- @See Collect.js Collections (Utilized for our "collect" function)
Installation
NPM
npm install --save-dev laravel-js-helpers
Yarn
yarn add laravel-js-helpers --save
CDN
Playground Examples
Curious, but not 100% on whether this is what you're looking for?
Utilization
Data Get
Data Get Simple
;
Data Get Output
"drew"
Data Get Wildcard("*")
;
Data Get Wildcard Output
[17, 25, 'thats not polite', 50];
Data Set
Data Set Simple
;;
Data Set Wildcard("*")
;
Data Set Output
{
members: {
brother: {
age: 21,
name: 'Everett',
last_name: 'Smith',
hobbies: ['football', '"chillin"', 'video games']
},
sister: {
age: 25,
name: 'ash',
last_name: 'Smith',
hobbies: ['mothering babies', 'fitness', 'nutrition', '']
},
mother: {
name: 'amy',
last_name: 'Smith',
age: 'thats not polite',
hobbies: ['cleaning', 'nursing', 'hiking']
},
father: {
age: 50,
name: 'jon',
last_name: 'Smith',
hobbies: ['reading', 'sports', 'talking for seemingly ever', 'providing useful insights']
},
}
}
Data Fill
Data Fill Simple
; // wont do anything; // wont do anything; // will do something
Data Fill Wildcard("*")
; // wont do anything; // will do something
Data Fill Output
{
members: {
brother: {
age: 21,
name: 'Everett',
last_name: 'Smith',
birthday: 'April 22',
nickname: 'Hortonion',
hobbies: ['football', '"chillin"', 'video games']
},
sister: {
age: 25,
name: 'ash',
last_name: 'Smith',
nickname: 'Hortonion',
hobbies: ['mothering babies', 'fitness', 'nutrition', '']
},
mother: {
name: 'amy',
last_name: 'Smith',
nickname: 'Hortonion',
age: 'thats not polite',
hobbies: ['cleaning', 'nursing', 'hiking']
},
father: {
age: 50,
name: 'jon',
last_name: 'Smith',
nickname: 'Hortonion',
hobbies: ['reading', 'sports', 'talking for seemingly ever', 'providing useful insights']
},
}
}
Contribute
PRs are welcomed to this project. If you want to improve the laravel-js-helpers library, add functionality or improve the docs please feel free to submit a PR.
Security Vulnerabilities
If you discover a security vulnerability within Clean Code Studio Packages Or Specifically within laravel-js-helpers, please send an e-mail to Zachary Horton via zak@cleancode.studio. All security vulnerabilities will be promptly addressed.
Change Log
Release 1.0.3
- CDN
- Tests
- Change Log
- Documentation
- Travis Continuous Build Integration
Release 1.0.2
- data_get
- data_set
- data_fill
- transform
- value
- blank
- filled
- collect
Release 1.0.1
- Initial Simple Documentation Setup
Release 1.0.0
- Initial Setup
Versioning
Semantic Versioning
Code Status | Stage | Rule | Example Version |
---|---|---|---|
First release | New Product | Start with 1.0.0 | 1.0.0 |
Backward compatible bug fixes | Patch Release | Increment the third digit | 1.0.1 |
Backward compatible new features | Minor Release | Increment the middle digit and reset last digit to zero | 1.1.0 |
Changes that break backward compatibility | Major Release | Increment the first digit and reset middle and last digits to zero | 2.0.0 |