11cb0ef41Sopenharmony_ciimport { ok, deepStrictEqual } from 'assert';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciexport async function resolve(specifier, context, defaultResolve) {
41cb0ef41Sopenharmony_ci  ok(Array.isArray(context.conditions), 'loader receives conditions array');
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_ci  deepStrictEqual([...context.conditions].sort(), [
71cb0ef41Sopenharmony_ci    'import',
81cb0ef41Sopenharmony_ci    'node',
91cb0ef41Sopenharmony_ci    'node-addons',
101cb0ef41Sopenharmony_ci  ]);
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_ci  return defaultResolve(specifier, {
131cb0ef41Sopenharmony_ci    ...context,
141cb0ef41Sopenharmony_ci    conditions: ['custom-condition', ...context.conditions],
151cb0ef41Sopenharmony_ci  });
161cb0ef41Sopenharmony_ci}
17