mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
javascript-obfuscator definitions (#9496)
* javascript-obfuscator definitions * javascript-obfuscator definition: added IOption interface for options * javascript-obfuscator added new options * javascript-obfuscator added new options * Update javascript-obfuscator.d.ts * Update javascript-obfuscator-tests.ts
This commit is contained in:
committed by
Masahiro Wakame
parent
15ad62197f
commit
a33c790497
15
javascript-obfuscator/javascript-obfuscator-tests.ts
Normal file
15
javascript-obfuscator/javascript-obfuscator-tests.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/// <reference path="javascript-obfuscator" />
|
||||
|
||||
import { JavaScriptObfuscator } from 'javascript-obfuscator';
|
||||
|
||||
let sourceCode1: string = JavaScriptObfuscator.obfuscate('var foo = 1;');
|
||||
let sourceCode2: string = JavaScriptObfuscator.obfuscate('var foo = 1;', {
|
||||
compact: true,
|
||||
debugProtection: false,
|
||||
debugProtectionInterval: false,
|
||||
disableConsoleOutput: true,
|
||||
encodeUnicodeLiterals: true,
|
||||
rotateUnicodeArray: true,
|
||||
unicodeArray: true,
|
||||
wrapUnicodeArrayCalls: true
|
||||
});
|
||||
22
javascript-obfuscator/javascript-obfuscator.d.ts
vendored
Normal file
22
javascript-obfuscator/javascript-obfuscator.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// Type definitions for javascript-obfuscator
|
||||
// Project: https://github.com/sanex3339/javascript-obfuscator
|
||||
// Definitions by: sanex3339 <https://github.com/sanex3339>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'javascript-obfuscator' {
|
||||
export interface IOptions {
|
||||
compact?: boolean;
|
||||
debugProtection?: boolean;
|
||||
debugProtectionInterval?: boolean;
|
||||
disableConsoleOutput?: boolean;
|
||||
encodeUnicodeLiterals?: boolean;
|
||||
rotateUnicodeArray?: boolean;
|
||||
unicodeArray?: boolean;
|
||||
wrapUnicodeArrayCalls?: boolean;
|
||||
[id: string]: any;
|
||||
}
|
||||
|
||||
export class JavaScriptObfuscator {
|
||||
public static obfuscate (sourceCode: string, customOptions?: IOptions): string;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user