Skip to content

Commit

Permalink
Lower node version to 14 (#329)
Browse files Browse the repository at this point in the history
This is the latest on Vercel.
  • Loading branch information
mAAdhaTTah committed Jun 6, 2021
1 parent 6f7b823 commit ba72eb0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
node-version: 14.x
- name: Upgrade npm
run: npm install -g npm@^7
- run: npm ci
- run: npm test
- run: npm run build
Expand Down
4 changes: 3 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
},
"license": "MIT",
"engines": {
"node": ">=16"
"node": ">=14",
"npm": "^7"
},
"scripts": {
"start": "next start",
Expand Down
21 changes: 21 additions & 0 deletions src/api/wp.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
import axios from 'axios';
import { shared, server } from '../config';

/**
* String.prototype.replaceAll() polyfill
* https://gomakethings.com/how-to-replace-a-section-of-a-string-with-another-one-with-vanilla-js/
* @author Chris Ferdinandi
* @license MIT
*/
if (!String.prototype.replaceAll) {
// eslint-disable-next-line
String.prototype.replaceAll = function (str, newStr) {
// If a regex pattern
if (
Object.prototype.toString.call(str).toLowerCase() === '[object regexp]'
) {
return this.replace(str, newStr);
}

// If a string
return this.replace(new RegExp(str, 'g'), newStr);
};
}

const deepReplaceDomain = value => {
// Ignore empty strings, null, undefined, functions, & numbers.
if (!value || typeof value === 'number' || typeof value === 'function') {
Expand Down

1 comment on commit ba72eb0

@vercel
Copy link

@vercel vercel bot commented on ba72eb0 Jun 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.