Skip to content

export util function used to parse metasrc index #3520

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

Closed
VeraZab opened this issue Feb 6, 2019 · 5 comments
Closed

export util function used to parse metasrc index #3520

VeraZab opened this issue Feb 6, 2019 · 5 comments
Assignees
Milestone

Comments

@VeraZab
Copy link

VeraZab commented Feb 6, 2019

No description provided.

@etpinard
Copy link
Contributor

etpinard commented Feb 7, 2019

You mean

plotly.js/src/lib/index.js

Lines 1012 to 1024 in 02e51d8

lib.templateString = function(string, obj) {
// Not all that useful, but cache nestedProperty instantiation
// just in case it speeds things up *slightly*:
var getterCache = {};
return string.replace(TEMPLATE_STRING_REGEX, function(dummy, key) {
if(SIMPLE_PROPERTY_REGEX.test(key)) {
return obj[key] || '';
}
getterCache[key] = getterCache[key] || lib.nestedProperty(obj, key).get;
return getterCache[key]() || '';
});
};

?

That should be already available on Plotly.Lib in streambed.

@VeraZab
Copy link
Author

VeraZab commented Feb 7, 2019

Actually, it's this TEMPLATE_STRING_REGEX that would be nice to have.
And since all the logic for this is in standalone RCE, then it would be nice to be able to do:
import {TEMPLATE_STRING_REGEX} from 'plotly.js/src/lib';

@etpinard
Copy link
Contributor

etpinard commented Feb 7, 2019

Cool. Wanna try to make a PR?

@VeraZab
Copy link
Author

VeraZab commented Feb 7, 2019

sure.. we can ship for the current deadline without this, but when I have a moment, I'll make a pr.
thanks!

@VeraZab
Copy link
Author

VeraZab commented Feb 12, 2019

aww I wish this had been in the v1.44.4 release..
I didn't have time to do it..

@etpinard etpinard self-assigned this Feb 14, 2019
@etpinard etpinard added this to the v1.45.0 milestone Feb 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants