Common shared app components for desktop and mobile
Find a file
ProfessorDey 40ae42c5f6
Simplify Media Identification Function
Rebased from LBRY/lbry-app PR# 1304 with corrections requested by Codacy (Though may still complain regarding spacing).

This just makes the code for finding documents a lot easier. the regex patterns and the media type are converted into keypairs, [regex, mediatype] which is then reduced to a single value, which will either be the original filename if there are no matching extensions, or the mediatype. So long as the mediatype does not contain an extension at the end of the string, this system should work far more simply.

This will also allow for easier addition of new extensions to the function, so long as they all follow the same pattern for the regex:
^ = Start of string
.+ = 1 or more characters of any type
. = A literal dot
(a|b|c) = A list of ORed extensions within a capture group '( )'
$ = End of string, so it is certain this is the actual extension of the filename

Won't be hard to add things like Archives, Executables, etc with just a single extra line now.
2018-04-19 17:59:24 +00:00
build Common components refactor (#1) 2018-04-05 03:57:29 +01:00
src Simplify Media Identification Function 2018-04-19 17:59:24 +00:00
.eslintrc.json Common components refactor (#1) 2018-04-05 03:57:29 +01:00
.gitignore Initial commit 2018-01-11 12:54:20 +01:00
.lintstagedrc Common components refactor (#1) 2018-04-05 03:57:29 +01:00
.prettierrc.json Common components refactor (#1) 2018-04-05 03:57:29 +01:00
LICENSE create initial LICENSE file 2018-02-05 12:49:16 -08:00
package.json Common components refactor (#1) 2018-04-05 03:57:29 +01:00
README.md Common components refactor (#1) 2018-04-05 03:57:29 +01:00
webpack.config.js Common components refactor (#1) 2018-04-05 03:57:29 +01:00

lbry-redux

lbry-redux is a module which contains common React and redux code shared between lbry-app and lbry-android.

Installation

Add lbry-redux as a dependency to your package.json file. "lbry-redux": "lbryio/lbry-redux"

Local development

If you intend to make changes to the module and test immediately, you can use npm link to add the package to your node_modules folder. This will create a symlink to the folder where lbry-redux was cloned to.

cd lbry-redux
sudo npm link
cd /<path>/<to>/<project>/node_modules
npm link lbry-redux

Build

Run $ npm build.

License

MIT © LBRY