Comments (17)
@patrickkettner Can we add a support for RegEx?
from confidence.
This is a quick workaround for anybody having the same issue:
var regexp = function(pattern) {
pattern = new RegExp(pattern);
this.test = function(str) {
return pattern.test(str);
};
};
new regexp('\.scss$') // will not throw an error
from confidence.
An example of the error would be helpful here. Even better would be example code that is failing.
from confidence.
Any value that is a RegExp
in the Confidence object
will throw the error because of this line. So it is not really a bug but I am wondering why RegExp are not allowed.
from confidence.
I suspect that it's due to JSON not supporting regexs. @hueniverse is this the case?
I agree that this is detrimental for users who are using JS literals or ALCE to parse the confidence file as both of those situations supoprt RegEx literals
from confidence.
I need to see an actual config where you want to use Regex. The referenced line is there to prevent invalid nodes.
from confidence.
ping @SimonDegraeve
from confidence.
Hi sorry for the delay. I am not using confidence anymore. Feel free to close the issue. I will be back with a full example when I have a chance to use this library again.
from confidence.
ho about something like this?
var store = new Confidence.Store({
webpack: {
$filter: 'env',
production: {
entry: constants.src.js,
output: {
path: constants.dest.js.prod,
filename: '[name].js' // Template based on keys in entry above
},
module: {
loaders: [{
test: /\.jsx$/,
loader: 'jsx-loader'
}]
}
},
$default: {
watch: true,
entry: constants.src.js,
output: {
path: constants.dest.js.dev,
filename: '[name].js' // Template based on keys in entry above
},
module: {
loaders: [{
test: /\.jsx$/,
loader: 'jsx-loader'
},
{
test: /\.css/,
loader: 'css-loader'
}]
}
}
}
});
from confidence.
I'm also trying to create a Webpack plugin, and need to pass a Webpack config object to it that uses the test
RegExp property:
// webpack.config.js
module.exports = {
module: {
loaders: [{
test: /\.jsx?/,
loaders: ['babel'],
presets: ['react', 'es2015']
}]
}
};
// manifest.js
// using the latest Glue syntax
const manifest = {
registrations: [
{
plugin: {
register: './my-plugin',
options: {
config: require('./webpack.config.js')
}
}
}
]
};
Confidence 1.4.2 throws me this error:
Error: Invalid node object type
at error (/Users/user/project/node_modules/confidence/lib/store.js:211:22)
from confidence.
@patrickkettner I have the same problem as @prashaantt. Any idea?
from confidence.
@danielbayerlein have you tried the above workaround?
from confidence.
@patrickkettner The workaround does not work well with webpack v2.1.0-beta because the webpack default configuration used RegEx. See https://github.com/webpack/webpack/blob/6b0c20a53ad7b04d4282a8a5c334ea0982fd364c/lib/WebpackOptionsDefaulter.js#L25
from confidence.
@hueniverse do you recall the original reason for marking regexp as an invalid type?
from confidence.
No idea.
from confidence.
Any fix for this? still getting it
from confidence.
I have the same issue.
{
plugin: 'hapi-pagination',
options: {
meta: {
location: 'body'
},
reply: {
paginate: 'hapiPaginate'
},
routes: {
exclude: [
new RegExp('/documentation*'), // or /\/documentation*/,
new RegExp('/swaggerui*') // or /\/swaggerui*/,
]
}
}
}
from confidence.
Related Issues (20)
- Publish on npm as @hapipal scoped package
- Replace ALCE file format usage in CLI
- Reorganize documentation for org-wide consistency
- Move from yargs to bossy
- Should we remove $env? HOT 6
- Should we remove Confidence.id.generate() and Confidence.id.criteria()? HOT 8
- How to perform logical operations? HOT 6
- Interest in CLI documentation? HOT 2
- Using 0 as default for coerce number returns undefined HOT 4
- Allow pulling values from criteria into store HOT 5
- New maintainer? HOT 6
- Manifest TLS options never work HOT 1
- Either allow matching "$undefined" or any non-falsy criteria value HOT 1
- Add support for environment variables in filters and values
- Remove module from hapi.js organization HOT 5
- Update hapi core modules to namespaced versions.
- Update deps
- Null values when filtering array items HOT 1
- $coerce array HOT 2
- Drop support for node v10 and below HOT 4
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 confidence.