Merge pull request #30756 from TeamworkGuy2/master

[cached-path-relative] Add cached-path-relative@1.0.2 definition
This commit is contained in:
Andrew Casey
2018-12-03 17:59:42 -08:00
committed by GitHub
4 changed files with 44 additions and 0 deletions
@@ -0,0 +1,7 @@
import cachedPathRelative = require("cached-path-relative");
function browserifyTest() {
const file = "file.txt";
const m1: string = cachedPathRelative("./", file).replace(/\\/g, '/');
return m1;
}
+13
View File
@@ -0,0 +1,13 @@
// Type definitions for cached-path-relative 1.0
// Project: https://github.com/ashaffer/cached-path-relative
// Definitions by: TeamworkGuy2 <https://github.com/TeamworkGuy2>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Memoize the results of the path.relative function. path.relative can be an expensive operation
* if it happens a lot, and its results shouldn't change for the same arguments.
* Use it just like your normal path.relative, but it's memoized.
*/
declare function cachedPathRelative(from: string, to: string): string;
export = cachedPathRelative;
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"cached-path-relative-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }