-
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88925cb
commit 1120e8e
Showing
53 changed files
with
421 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Rule } from './rule'; | ||
/** | ||
* Sets, unsets and retrieves rules on an object or constructor function. | ||
*/ | ||
export declare class Rules { | ||
/** | ||
* The name of the property that stores the rules. | ||
*/ | ||
static key: string; | ||
/** | ||
* Applies the rules to a target. | ||
*/ | ||
static set(target: any, rules: Rule<any, any>[]): void; | ||
/** | ||
* Removes rules from a target. | ||
*/ | ||
static unset(target: any): void; | ||
/** | ||
* Retrieves the target's rules. | ||
*/ | ||
static get(target: any): Rule<any, any>[] | null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
define(["require", "exports"], function (require, exports) { | ||
"use strict"; | ||
/** | ||
* Sets, unsets and retrieves rules on an object or constructor function. | ||
*/ | ||
var Rules = (function () { | ||
function Rules() { | ||
} | ||
/** | ||
* Applies the rules to a target. | ||
*/ | ||
Rules.set = function (target, rules) { | ||
if (target instanceof Function) { | ||
target = target.prototype; | ||
} | ||
Object.defineProperty(target, Rules.key, { enumerable: false, configurable: false, writable: true, value: rules }); | ||
}; | ||
/** | ||
* Removes rules from a target. | ||
*/ | ||
Rules.unset = function (target) { | ||
if (target instanceof Function) { | ||
target = target.prototype; | ||
} | ||
target[Rules.key] = null; | ||
}; | ||
/** | ||
* Retrieves the target's rules. | ||
*/ | ||
Rules.get = function (target) { | ||
return target[Rules.key] || null; | ||
}; | ||
/** | ||
* The name of the property that stores the rules. | ||
*/ | ||
Rules.key = '__rules__'; | ||
return Rules; | ||
}()); | ||
exports.Rules = Rules; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Rule } from './rule'; | ||
/** | ||
* Sets, unsets and retrieves rules on an object or constructor function. | ||
*/ | ||
export declare class Rules { | ||
/** | ||
* The name of the property that stores the rules. | ||
*/ | ||
static key: string; | ||
/** | ||
* Applies the rules to a target. | ||
*/ | ||
static set(target: any, rules: Rule<any, any>[]): void; | ||
/** | ||
* Removes rules from a target. | ||
*/ | ||
static unset(target: any): void; | ||
/** | ||
* Retrieves the target's rules. | ||
*/ | ||
static get(target: any): Rule<any, any>[] | null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"use strict"; | ||
/** | ||
* Sets, unsets and retrieves rules on an object or constructor function. | ||
*/ | ||
var Rules = (function () { | ||
function Rules() { | ||
} | ||
/** | ||
* Applies the rules to a target. | ||
*/ | ||
Rules.set = function (target, rules) { | ||
if (target instanceof Function) { | ||
target = target.prototype; | ||
} | ||
Object.defineProperty(target, Rules.key, { enumerable: false, configurable: false, writable: true, value: rules }); | ||
}; | ||
/** | ||
* Removes rules from a target. | ||
*/ | ||
Rules.unset = function (target) { | ||
if (target instanceof Function) { | ||
target = target.prototype; | ||
} | ||
target[Rules.key] = null; | ||
}; | ||
/** | ||
* Retrieves the target's rules. | ||
*/ | ||
Rules.get = function (target) { | ||
return target[Rules.key] || null; | ||
}; | ||
/** | ||
* The name of the property that stores the rules. | ||
*/ | ||
Rules.key = '__rules__'; | ||
return Rules; | ||
}()); | ||
exports.Rules = Rules; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Rule } from './rule'; | ||
/** | ||
* Sets, unsets and retrieves rules on an object or constructor function. | ||
*/ | ||
export declare class Rules { | ||
/** | ||
* The name of the property that stores the rules. | ||
*/ | ||
static key: string; | ||
/** | ||
* Applies the rules to a target. | ||
*/ | ||
static set(target: any, rules: Rule<any, any>[]): void; | ||
/** | ||
* Removes rules from a target. | ||
*/ | ||
static unset(target: any): void; | ||
/** | ||
* Retrieves the target's rules. | ||
*/ | ||
static get(target: any): Rule<any, any>[] | null; | ||
} |
Oops, something went wrong.