mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
Merge pull request #30756 from TeamworkGuy2/master
[cached-path-relative] Add cached-path-relative@1.0.2 definition
This commit is contained in:
@@ -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
@@ -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;
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user