How to use the path-browserify.join function in path-browserify

To help you get started, we’ve selected a few path-browserify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github luckymarmot / API-Flow / src / parsers / raml / v0.8 / __tests__ / generated / generate.js View on Github external
}).then(data => {
    const _content = JSON.stringify(data, null, '  ')
        /* eslint-disable no-console */
    console.log('file', file.replace(/\.[yr]a?ml$/, '.json'))
        /* eslint-enable no-console */
    fs.writeFileSync(
            path.join(generatedPath, file.replace(/\.[yr]a?ml$/, '.json')),
            _content
        )
  })
}
github expo / expo / packages / expo-asset / src / AssetSources.ts View on Github external
// This logic is based on that of AssetSourceResolver, with additional support for file hashes and
  // explicitly provided URIs
  const scale = AssetSourceResolver.pickScale(meta.scales, PixelRatio.get());
  const index = meta.scales.findIndex(s => s === scale);
  const hash = meta.fileHashes ? meta.fileHashes[index] || meta.fileHashes[0] : meta.hash;

  // Allow asset processors to directly provide the URL to load
  const uri = meta.fileUris ? meta.fileUris[index] || meta.fileUris[0] : meta.uri;
  if (uri) {
    return { uri: resolveUri(uri), hash };
  }

  // Check if the assetUrl was overridden in the manifest
  const assetUrlOverride = Constants.manifest && Constants.manifest.assetUrlOverride;
  if (assetUrlOverride) {
    const uri = path.join(assetUrlOverride, hash);
    return { uri: resolveUri(uri), hash };
  }

  const fileScale = scale === 1 ? '' : `@${scale}x`;
  const fileExtension = meta.type ? `.${encodeURIComponent(meta.type)}` : '';
  const suffix = `/${encodeURIComponent(
    meta.name
  )}${fileScale}${fileExtension}?platform=${encodeURIComponent(
    Platform.OS
  )}&hash=${encodeURIComponent(meta.hash)}`;

  // For assets with a specified absolute URL, we use the existing origin instead of prepending the
  // development server or production CDN URL origin
  if (/^https?:\/\//.test(meta.httpServerLocation)) {
    const uri = meta.httpServerLocation + suffix;
    return { uri, hash };
github sourcegraph / sourcegraph-basic-code-intel / languages.ts View on Github external
return imports.some(i =>
                        relativeImportToPath(i)
                            ? path.join(
                                  path.dirname(filePath),
                                  relativeImportToPath(i)
                              ) === result.file.replace(/\.[^/.]+$/, '')
                            : result.file.includes(i.replace(/\./g, '/'))
                    )
github odota / underlords-web / src / components / HomePage / HomePage.tsx View on Github external
public render() {
        return <div>
            <header>
                <h1>{ strings.app_name }</h1>
                <h3>{ strings.app_description }</h3>
                <p>{strings.home_description}</p>
                <a href="//opendota.com">{strings.home_description2}</a>
            </header>
            <main>
                <section>
                    
                         {
                            return {
                                alt: e,
                                url: `${process.env.PUBLIC_URL}/images/alliances/${e}.png`
                            };
                        })}/&gt;
                        <h4>{underlordsLoc["dac_ingame_tab_synergies"]}</h4>
                    
                    
                         {
                            const hero = heroes[e as keyof typeof heroes];
                            return {
                                alt: hero.dota_unit_name,
                                url: GetHeroImage(hero.dota_unit_name)
                            };
                        })}/&gt;</section></main></div>
github benwinding / react-admin-firebase / src / misc / pathHelper.ts View on Github external
export function joinPaths(path1, path2) {
  return path.join(path1, path2);
}
github luckymarmot / API-Flow / src / parsers / raml / resolvers / FileResolver.js View on Github external
readFileAsync(filePath) {
    for (const item of this.items) {
      if (filePath.indexOf(
                path.join(item.file.path, item.file.name)
            ) === 0) {
        return new Promise((resolve) => {
          resolve(item.content)
        })
      }
    }
    return new Promise((resolve) => {
      resolve(
                '::fileRef::' +
                path.relative(path.dirname(this.baseItem), filePath)
            )
    })
  }
github expo / expo / packages / expo-asset / src / AssetSources.ts View on Github external
export function resolveUri(uri: string): string {
  if (!manifestBaseUrl) {
    return uri;
  }

  const { protocol } = new URL(uri);
  if (protocol !== '') {
    return uri;
  }

  const baseUrl = new URL(manifestBaseUrl);
  const resolvedPath = uri.startsWith('/') ? uri : path.join(baseUrl.pathname, uri);
  baseUrl.set('pathname', resolvedPath);
  return baseUrl.href;
}
github expo / expo / packages / expo-asset / build / AssetSources.js View on Github external
export function resolveUri(uri) {
    if (!manifestBaseUrl) {
        return uri;
    }
    const { protocol } = new URL(uri);
    if (protocol !== '') {
        return uri;
    }
    const baseUrl = new URL(manifestBaseUrl);
    const resolvedPath = uri.startsWith('/') ? uri : path.join(baseUrl.pathname, uri);
    baseUrl.set('pathname', resolvedPath);
    return baseUrl.href;
}
//# sourceMappingURL=AssetSources.js.map
github sourcegraph / sourcegraph-basic-code-intel / languages.ts View on Github external
return imports.some(i =>
            path
                .join(path.parse(result.file).dir, path.parse(result.file).name)
                .endsWith(path.join(path.parse(i).dir, path.parse(i).name))
        )