Comments (9)
Some examples where compositional/functional patterns has been used:
from jsverbalexpressions.
Huh. Interesting.
from jsverbalexpressions.
So for something like:
VerEx(
startOfLine,
"http",
maybe("s"),
"://",
maybe("www."),
anythingBut(" "),
endOfLine
)
… would the import statement look like one of the following:
import { VerEx, startOfLine, maybe, anythingBut, endOfLine } from verbal-expressions;
import * from verbal-expressions;
A bit concerned about global scope pollution…
from jsverbalexpressions.
ES module/TypeScript imports would look like this:
import { VerEx, startOfLine, maybe, anythingBut, endOfLine } from 'verbal-expressions'
On node.js require you can use:
const { VerEx, startOfLine, maybe, anythingBut, endOfLine } = require('verbal-expressions')
If we want to still support global browser scripts, then a common practice with this kind of libraries (e.g. Ramda, lodash) is to use a short single-character namespace. We could namespace with V
or ve
. In that case you would use the library as:
V.VerEx(
V.startOfLine,
"http",
V.maybe("s"),
"://",
V.maybe("www."),
V.anythingBut(" "),
V.endOfLine
)
from jsverbalexpressions.
Sounds good.
I'd like to help out with this. How do we work this out?
from jsverbalexpressions.
I can create a POC draft pull request to show a couple of ideas, and we can iterate from that. Does that sound good?
from jsverbalexpressions.
Sure.
from jsverbalexpressions.
@jehna How about I create a 2.0.0
branch and write some failing tests while you build your proof of concept?
from jsverbalexpressions.
Ok, so I did some work that I'd like to show you:
#197
from jsverbalexpressions.
Related Issues (20)
- Non-capturing groups
- Lookaheads and lookbehinds HOT 2
- 'beginCapture' is not effect when 'or' HOT 1
- Support node.js 10+ HOT 2
- Docs examples for `multiple` HOT 1
- replace/format traditional HOT 2
- Support for non-greedy/lazy wildcards HOT 1
- Different test result between ES6 import VerEx and local VerEx
- Dependabot automerging package updades HOT 1
- State of JSVerbalexpressions HOT 1
- Your .dependabot/config.yml contained invalid details HOT 1
- SyntaxError: unterminated parenthetical HOT 1
- References to other similar projects HOT 4
- JS 001 HOT 2
- Dependabot can't resolve your JavaScript dependency files
- Not able to create expressions for OR and AND type statements
- Move away from Grunt
- 1 HOT 1
- "Range out of order in character class" when trying to match common operators
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsverbalexpressions.