Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var idx = lunr(function () {
if (REGION === REGION_jTOS)
this.use(lunr.multiLanguage('en', 'jp'));
if (REGION === REGION_kTOS || REGION === REGION_kTEST)
this.use(lunr.multiLanguage('en', 'kr'));
if (REGION === REGION_twTOS)
this.use(lunr.multiLanguage('en', 'ch'));
// Disable stemmer
this.pipeline.remove(lunr.stemmer);
this.ref('$ID_lunr');
this.field('$ID');
this.field('$ID_NAME');
this.field('Name');
//this.field('Description');
Object.entries(documents)
.forEach(value => {
let documents = value[1];
let dataset = value[0];
documents.forEach((doc) => {
var idx = lunr(function () {
if (REGION === REGION_jTOS)
this.use(lunr.multiLanguage('en', 'jp'));
if (REGION === REGION_kTOS || REGION === REGION_kTEST)
this.use(lunr.multiLanguage('en', 'kr'));
if (REGION === REGION_twTOS)
this.use(lunr.multiLanguage('en', 'ch'));
// Disable stemmer
this.pipeline.remove(lunr.stemmer);
this.ref('$ID_lunr');
this.field('$ID');
this.field('$ID_NAME');
this.field('Name');
//this.field('Description');
Object.entries(documents)
.forEach(value => {
var idx = lunr(function () {
if (REGION === REGION_jTOS)
this.use(lunr.multiLanguage('en', 'jp'));
if (REGION === REGION_kTOS || REGION === REGION_kTEST)
this.use(lunr.multiLanguage('en', 'kr'));
if (REGION === REGION_twTOS)
this.use(lunr.multiLanguage('en', 'ch'));
// Disable stemmer
this.pipeline.remove(lunr.stemmer);
this.ref('$ID_lunr');
this.field('$ID');
this.field('$ID_NAME');
this.field('Name');
//this.field('Description');
Object.entries(documents)
.forEach(value => {
let documents = value[1];
let dataset = value[0];
const index = lunr(function () {
if (languages.length === 1) {
this.use(lunr[languages[0]]);
} else if (languages.length > 1) {
this.use(lunr.multiLanguage(...languages));
}
this.ref('id');
fields.forEach(({
name,
attributes = {}
}) => {
this.field(name, attributes);
});
getNodes().filter(filterNodes).forEach(n => {
const fieldResolvers = resolvers[n.internal.type];
if (fieldResolvers) {
const doc = _objectSpread({
id: n.id
}, Object.keys(fieldResolvers).reduce((prev, key) => _objectSpread({}, prev, {