Skip to content

fix(ffi): use export const & const #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Data/TemplateString/TemplateString.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

exports._buildExclamationKeyObject = function (tuples) {
var valueMap = {};
export function _buildExclamationKeyObject(tuples) {
const valueMap = {};
tuples.forEach(function (tuple) {
valueMap['!' + tuple.value0] = tuple.value1;
});
return valueMap;
};

var templatePattern = /\$\{([^}]+)\}/g;
const templatePattern = /\$\{([^}]+)\}/g;

exports._getTemplateVars = function (str) {
export function _getTemplateVars(str) {
return (str.match(templatePattern) || []).map(function (str) {
return str.substring(2, str.length - 1);
});
Expand Down
6 changes: 3 additions & 3 deletions src/Data/TemplateString/Unsafe/TemplateString.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

var templatePattern = /\$\{([^}]+)\}/g;
const templatePattern = /\$\{([^}]+)\}/g;

exports._templateBy = function (keyFrom, str, obj) {
export function _templateBy(keyFrom, str, obj) {
return str.replace(templatePattern, function (match, ident) {
var key = keyFrom(ident);
const key = keyFrom(ident);
return Object.hasOwnProperty.call(obj, key) ? obj[key] : match;
});
};
Expand Down