I have /components/foo.js and /pages/bar.js, both are using <FormattedMessage /> with a different defaultMessage: If I run formatjs extract ‘components/**/*.js’ –out-file lang/en.json I only get messages from my components folder. If instead I use the path pages/**/*.js, I only get mes…
For loop if statement stopping on first case
The challenge: Write a function that takes in a string of one or more words, and returns the same string, but with all five or more letter words reversed (Just like the name of this Kata). Strings passed in will consist of only letters and spaces. Spaces will be included only when more than one word is presen…
Best way to chain jquery ajax calls which pass information
I am making several asynchronous ajax calls which must be executed in a specific order and which must pass information to each other. Here is a MWE of my current approach. Even with three API calls it is a bit of a nightmare. With 5 it’s impossible to line up the error workflow or to move functions arou…
How to write a validators function that should accept the value between 0 to 30 but not decimal value ?? in Angular
that the if user enter the value between 0 to 30 it should accept 0 ,2, 20 and but should not accept decimal value like 20.1 , 0.1 I have use validators min(0) and validators max(30) but it accept the decimal value Need a validators that should not accept decimal value If have to use regex pattern, can you gi…
How can I group sections within a table?
I am using Vue with Element UI to create a table. Currently I am trying to figure out a possible way to add a year/name to the popup and hit save to have it show up as one of those headers shown in the ss with ‘add trim’ next to it? Add trim button would add those rows to the
How to delete message if it’s not starting with specified word. Discord.js
I want to know how to make function that deletes message if it’s not starting with specified “word” not when message includes the word specified but when it’s starting with it (everything on specified channel with channel id), it’s very important for me and I can’t find any…
How to detect when a radio input is unchecked in Javascript
I have 4 radio input separated by divs. I want to select the input, and make the card border change. But the event listener only works when it’s checked, no when it’s unchecked. Codepen version https://codepen.io/nazarenoalt/pen/dyOKqYp HTML Answer You can maintain a reference to the last selected…
How can I remove occurrences with random hash?
I have a controlled <input /> in my React application where the user would type. I want to keep track on it and replace the occurrences of $.text and $.lang to random hashes/number. from I want all occurrences of $.text and $.lang to have a random number(or anything unique): to What I have done so far T…
VSCode auto import – how to force Material-UI full path import
When using VSCode’s auto import feature to import Material-UI components, it will use a named import to import from the top-level file: However, I would like the auto import to use the full path import instead: I’ve tried to find a way to configure VSCode’s auto import to do this to no avail…
How to use one JWT token to sign a second JWT token?
The Scenario: A web-app user wants to create an authorised view of a private asset. The user has authenticated and has a jwt token. The app wants to make a fresh secondary jwt token, which can be verified as having been created with the original token. FYI: My use case is signing a url – adding the seco…