mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 11:57:33 +08:00
Merge pull request #19622 from khell/master
[pg-escape] Initial version
This commit is contained in:
17
types/pg-escape/index.d.ts
vendored
Normal file
17
types/pg-escape/index.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Type definitions for pg-escape 0.2
|
||||
// Project: https://github.com/segmentio/pg-escape
|
||||
// Definitions by: Cameron Yan <https://github.com/khell>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node"/>
|
||||
|
||||
export = escape;
|
||||
|
||||
declare function escape(fmt: string, ...args: any[]): string;
|
||||
|
||||
declare namespace escape {
|
||||
function string(val: string): string;
|
||||
function dollarQuotedString(val: string): string;
|
||||
function ident(val: string): string;
|
||||
function literal(val: string): string;
|
||||
}
|
||||
7
types/pg-escape/pg-escape-tests.ts
Normal file
7
types/pg-escape/pg-escape-tests.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import * as escape from 'pg-escape';
|
||||
|
||||
escape('INSERT INTO %I VALUES(%L)', 'books', "O'Reilly");
|
||||
escape.string("ab'cd");
|
||||
escape.dollarQuotedString("ab'cd");
|
||||
escape.ident('1234');
|
||||
escape.literal('1234');
|
||||
22
types/pg-escape/tsconfig.json
Normal file
22
types/pg-escape/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"pg-escape-tests.ts"
|
||||
]
|
||||
}
|
||||
3
types/pg-escape/tslint.json
Normal file
3
types/pg-escape/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user