MCPcopy
hub / github.com/xianfei/SysMocap / formatPattern

Method formatPattern

pdfviewer/viewer.mjs:1972–1987  ·  view source on GitHub ↗
(pattern, args = null, errors = null)

Source from the content-addressed store, hash-verified

1970 return errors;
1971 }
1972 formatPattern(pattern, args = null, errors = null) {
1973 if (typeof pattern === "string") {
1974 return this._transform(pattern);
1975 }
1976 let scope = new Scope(this, errors, args);
1977 try {
1978 let value = resolveComplexPattern(scope, pattern);
1979 return value.toString(scope);
1980 } catch (err) {
1981 if (scope.errors && err instanceof Error) {
1982 scope.errors.push(err);
1983 return new FluentNone().toString(scope);
1984 }
1985 throw err;
1986 }
1987 }
1988}
1989;// CONCATENATED MODULE: ./node_modules/@fluent/bundle/esm/resource.js
1990const RE_MESSAGE_START = /^(-?[a-zA-Z][\w-]*) *= */gm;

Callers 2

valueFromBundleFunction · 0.80
messageFromBundleFunction · 0.80

Calls 3

resolveComplexPatternFunction · 0.85
toStringMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected