@harmoniclabs/pebble 0.1.0-dev4 → 0.1.0-dev5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ export declare function isAbsolutePath(path: string): boolean;
1
2
  export declare function getEnvRelativePath(filePath: string, projectRoot: string): string | undefined;
2
3
  /**
3
4
  * Takes a relative path and an absolute path, and returns the absolute path
@@ -51,10 +51,15 @@ function addExtension(path, endsWithSlash) {
51
51
  // Otherwise just add the extension
52
52
  return path + extension;
53
53
  }
54
+ export function isAbsolutePath(path) {
55
+ return path.startsWith(PATH_DELIMITER);
56
+ }
54
57
  export function getEnvRelativePath(filePath, projectRoot) {
55
58
  if (!(typeof filePath === 'string' &&
56
59
  typeof projectRoot === 'string'))
57
60
  return undefined;
61
+ if (isAbsolutePath(filePath))
62
+ return filePath;
58
63
  projectRoot = projectRoot.trim();
59
64
  filePath = getAbsolutePath(filePath.trim(), projectRoot);
60
65
  if (!filePath)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harmoniclabs/pebble",
3
- "version": "0.1.0-dev4",
3
+ "version": "0.1.0-dev5",
4
4
  "description": "A simple, yet rock solid, functional language with an imperative bias, targeting UPLC",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",