@code-to-json/utils
Advanced tools
Comparing version 0.4.38 to 0.4.39
@@ -6,2 +6,10 @@ # Change Log | ||
## 0.4.39 (2018-12-14) | ||
**Note:** Version bump only for package @code-to-json/utils | ||
## 0.4.38 (2018-12-14) | ||
@@ -8,0 +16,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const typescript_1 = require("typescript"); | ||
const DECLARATION_KINDS = [ | ||
typescript_1.SyntaxKind.SourceFile, | ||
typescript_1.SyntaxKind.ArrowFunction, | ||
typescript_1.SyntaxKind.BindingElement, | ||
typescript_1.SyntaxKind.ClassDeclaration, | ||
typescript_1.SyntaxKind.ClassExpression, | ||
typescript_1.SyntaxKind.Constructor, | ||
typescript_1.SyntaxKind.EnumDeclaration, | ||
typescript_1.SyntaxKind.EnumMember, | ||
typescript_1.SyntaxKind.ExportSpecifier, | ||
typescript_1.SyntaxKind.FunctionDeclaration, | ||
typescript_1.SyntaxKind.FunctionExpression, | ||
typescript_1.SyntaxKind.GetAccessor, | ||
typescript_1.SyntaxKind.ImportClause, | ||
typescript_1.SyntaxKind.ImportEqualsDeclaration, | ||
typescript_1.SyntaxKind.ImportSpecifier, | ||
typescript_1.SyntaxKind.InterfaceDeclaration, | ||
typescript_1.SyntaxKind.JsxAttribute, | ||
typescript_1.SyntaxKind.MethodDeclaration, | ||
typescript_1.SyntaxKind.MethodSignature, | ||
typescript_1.SyntaxKind.ModuleDeclaration, | ||
typescript_1.SyntaxKind.NamespaceExportDeclaration, | ||
typescript_1.SyntaxKind.NamespaceImport, | ||
typescript_1.SyntaxKind.Parameter, | ||
typescript_1.SyntaxKind.PropertyAssignment, | ||
typescript_1.SyntaxKind.PropertyDeclaration, | ||
typescript_1.SyntaxKind.PropertySignature, | ||
typescript_1.SyntaxKind.SetAccessor, | ||
typescript_1.SyntaxKind.ShorthandPropertyAssignment, | ||
typescript_1.SyntaxKind.TypeAliasDeclaration, | ||
typescript_1.SyntaxKind.TypeParameter, | ||
typescript_1.SyntaxKind.VariableDeclaration, | ||
typescript_1.SyntaxKind.JSDocTypedefTag, | ||
typescript_1.SyntaxKind.JSDocCallbackTag, | ||
typescript_1.SyntaxKind.JSDocPropertyTag | ||
]; | ||
/** | ||
@@ -11,36 +47,3 @@ * Returns true if the specified SyntaxKind is part of a declaration form. | ||
function isDeclarationKind(kind) { | ||
return (kind === typescript_1.SyntaxKind.SourceFile || | ||
kind === typescript_1.SyntaxKind.ArrowFunction || | ||
kind === typescript_1.SyntaxKind.BindingElement || | ||
kind === typescript_1.SyntaxKind.ClassDeclaration || | ||
kind === typescript_1.SyntaxKind.ClassExpression || | ||
kind === typescript_1.SyntaxKind.Constructor || | ||
kind === typescript_1.SyntaxKind.EnumDeclaration || | ||
kind === typescript_1.SyntaxKind.EnumMember || | ||
kind === typescript_1.SyntaxKind.ExportSpecifier || | ||
kind === typescript_1.SyntaxKind.FunctionDeclaration || | ||
kind === typescript_1.SyntaxKind.FunctionExpression || | ||
kind === typescript_1.SyntaxKind.GetAccessor || | ||
kind === typescript_1.SyntaxKind.ImportClause || | ||
kind === typescript_1.SyntaxKind.ImportEqualsDeclaration || | ||
kind === typescript_1.SyntaxKind.ImportSpecifier || | ||
kind === typescript_1.SyntaxKind.InterfaceDeclaration || | ||
kind === typescript_1.SyntaxKind.JsxAttribute || | ||
kind === typescript_1.SyntaxKind.MethodDeclaration || | ||
kind === typescript_1.SyntaxKind.MethodSignature || | ||
kind === typescript_1.SyntaxKind.ModuleDeclaration || | ||
kind === typescript_1.SyntaxKind.NamespaceExportDeclaration || | ||
kind === typescript_1.SyntaxKind.NamespaceImport || | ||
kind === typescript_1.SyntaxKind.Parameter || | ||
kind === typescript_1.SyntaxKind.PropertyAssignment || | ||
kind === typescript_1.SyntaxKind.PropertyDeclaration || | ||
kind === typescript_1.SyntaxKind.PropertySignature || | ||
kind === typescript_1.SyntaxKind.SetAccessor || | ||
kind === typescript_1.SyntaxKind.ShorthandPropertyAssignment || | ||
kind === typescript_1.SyntaxKind.TypeAliasDeclaration || | ||
kind === typescript_1.SyntaxKind.TypeParameter || | ||
kind === typescript_1.SyntaxKind.VariableDeclaration || | ||
kind === typescript_1.SyntaxKind.JSDocTypedefTag || | ||
kind === typescript_1.SyntaxKind.JSDocCallbackTag || | ||
kind === typescript_1.SyntaxKind.JSDocPropertyTag); | ||
return DECLARATION_KINDS.indexOf(kind) >= 0; | ||
} | ||
@@ -94,2 +97,2 @@ /** | ||
exports.isNode = isNode; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9ndWFyZHMvdHMvbm9kZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDJDQWNvQjtBQUVwQjs7Ozs7R0FLRztBQUNILFNBQVMsaUJBQWlCLENBQUMsSUFBZ0I7SUFDekMsT0FBTyxDQUNMLElBQUksS0FBSyx1QkFBVSxDQUFDLFVBQVU7UUFDOUIsSUFBSSxLQUFLLHVCQUFVLENBQUMsYUFBYTtRQUNqQyxJQUFJLEtBQUssdUJBQVUsQ0FBQyxjQUFjO1FBQ2xDLElBQUksS0FBSyx1QkFBVSxDQUFDLGdCQUFnQjtRQUNwQyxJQUFJLEtBQUssdUJBQVUsQ0FBQyxlQUFlO1FBQ25DLElBQUksS0FBSyx1QkFBVSxDQUFDLFdBQVc7UUFDL0IsSUFBSSxLQUFLLHVCQUFVLENBQUMsZUFBZTtRQUNuQyxJQUFJLEtBQUssdUJBQVUsQ0FBQyxVQUFVO1FBQzlCLElBQUksS0FBSyx1QkFBVSxDQUFDLGVBQWU7UUFDbkMsSUFBSSxLQUFLLHVCQUFVLENBQUMsbUJBQW1CO1FBQ3ZDLElBQUksS0FBSyx1QkFBVSxDQUFDLGtCQUFrQjtRQUN0QyxJQUFJLEtBQUssdUJBQVUsQ0FBQyxXQUFXO1FBQy9CLElBQUksS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QUF5QjtJQUM5QyxPQUFPLENBQUMsQ0FBQyxLQUFLLElBQUksQ0FBQyxDQUFFLEtBQWMsQ0FBQyxZQUFZLElBQUksQ0FBQyxDQUFFLEtBQWMsQ0FBQyxPQUFPLENBQUM7QUFDaEYsQ0FBQztBQUZELHdCQUVDO0FBRUQ7OztHQUdHO0FBQ0gsU0FBZ0IsUUFBUSxDQUFDLEtBQXlCO0lBQ2hELE9BQU8sQ0FBQyxDQUFDLEtBQUssSUFBSSxPQUFRLEtBQWEsQ0FBQyxjQUFjLEtBQUssVUFBVSxDQUFDO0FBQ3hFLENBQUM7QUFGRCw0QkFFQztBQUVEOzs7R0FHRztBQUNILFNBQWdCLE1BQU0sQ0FBQyxLQUF5QjtJQUM5QyxPQUFPLENBQUMsQ0FBQyxLQUFLLElBQUksT0FBUSxLQUFjLENBQUMsVUFBVSxLQUFLLFVBQVUsQ0FBQztBQUNyRSxDQUFDO0FBRkQsd0JBRUMifQ== |
{ | ||
"name": "@code-to-json/utils", | ||
"version": "0.4.38", | ||
"version": "0.4.39", | ||
"description": "", | ||
@@ -21,3 +21,3 @@ "main": "lib/src/index.js", | ||
"devDependencies": { | ||
"@code-to-json/test-helpers": "^0.0.44", | ||
"@code-to-json/test-helpers": "^0.0.45", | ||
"nyc": "13.1.0", | ||
@@ -63,3 +63,3 @@ "snap-shot-it": "6.2.7", | ||
}, | ||
"gitHead": "16ef70b0153e3ed677859c59799cdd590f301ab6" | ||
"gitHead": "34c184a86391c12297dc57231812bc4dccd0ec63" | ||
} |
@@ -17,2 +17,39 @@ import { | ||
const DECLARATION_KINDS = [ | ||
SyntaxKind.SourceFile, | ||
SyntaxKind.ArrowFunction, | ||
SyntaxKind.BindingElement, | ||
SyntaxKind.ClassDeclaration, | ||
SyntaxKind.ClassExpression, | ||
SyntaxKind.Constructor, | ||
SyntaxKind.EnumDeclaration, | ||
SyntaxKind.EnumMember, | ||
SyntaxKind.ExportSpecifier, | ||
SyntaxKind.FunctionDeclaration, | ||
SyntaxKind.FunctionExpression, | ||
SyntaxKind.GetAccessor, | ||
SyntaxKind.ImportClause, | ||
SyntaxKind.ImportEqualsDeclaration, | ||
SyntaxKind.ImportSpecifier, | ||
SyntaxKind.InterfaceDeclaration, | ||
SyntaxKind.JsxAttribute, | ||
SyntaxKind.MethodDeclaration, | ||
SyntaxKind.MethodSignature, | ||
SyntaxKind.ModuleDeclaration, | ||
SyntaxKind.NamespaceExportDeclaration, | ||
SyntaxKind.NamespaceImport, | ||
SyntaxKind.Parameter, | ||
SyntaxKind.PropertyAssignment, | ||
SyntaxKind.PropertyDeclaration, | ||
SyntaxKind.PropertySignature, | ||
SyntaxKind.SetAccessor, | ||
SyntaxKind.ShorthandPropertyAssignment, | ||
SyntaxKind.TypeAliasDeclaration, | ||
SyntaxKind.TypeParameter, | ||
SyntaxKind.VariableDeclaration, | ||
SyntaxKind.JSDocTypedefTag, | ||
SyntaxKind.JSDocCallbackTag, | ||
SyntaxKind.JSDocPropertyTag | ||
]; | ||
/** | ||
@@ -25,38 +62,3 @@ * Returns true if the specified SyntaxKind is part of a declaration form. | ||
function isDeclarationKind(kind: SyntaxKind): boolean { | ||
return ( | ||
kind === SyntaxKind.SourceFile || | ||
kind === SyntaxKind.ArrowFunction || | ||
kind === SyntaxKind.BindingElement || | ||
kind === SyntaxKind.ClassDeclaration || | ||
kind === SyntaxKind.ClassExpression || | ||
kind === SyntaxKind.Constructor || | ||
kind === SyntaxKind.EnumDeclaration || | ||
kind === SyntaxKind.EnumMember || | ||
kind === SyntaxKind.ExportSpecifier || | ||
kind === SyntaxKind.FunctionDeclaration || | ||
kind === SyntaxKind.FunctionExpression || | ||
kind === SyntaxKind.GetAccessor || | ||
kind === SyntaxKind.ImportClause || | ||
kind === SyntaxKind.ImportEqualsDeclaration || | ||
kind === SyntaxKind.ImportSpecifier || | ||
kind === SyntaxKind.InterfaceDeclaration || | ||
kind === SyntaxKind.JsxAttribute || | ||
kind === SyntaxKind.MethodDeclaration || | ||
kind === SyntaxKind.MethodSignature || | ||
kind === SyntaxKind.ModuleDeclaration || | ||
kind === SyntaxKind.NamespaceExportDeclaration || | ||
kind === SyntaxKind.NamespaceImport || | ||
kind === SyntaxKind.Parameter || | ||
kind === SyntaxKind.PropertyAssignment || | ||
kind === SyntaxKind.PropertyDeclaration || | ||
kind === SyntaxKind.PropertySignature || | ||
kind === SyntaxKind.SetAccessor || | ||
kind === SyntaxKind.ShorthandPropertyAssignment || | ||
kind === SyntaxKind.TypeAliasDeclaration || | ||
kind === SyntaxKind.TypeParameter || | ||
kind === SyntaxKind.VariableDeclaration || | ||
kind === SyntaxKind.JSDocTypedefTag || | ||
kind === SyntaxKind.JSDocCallbackTag || | ||
kind === SyntaxKind.JSDocPropertyTag | ||
); | ||
return DECLARATION_KINDS.indexOf(kind) >= 0; | ||
} | ||
@@ -63,0 +65,0 @@ |
import { suite, test } from 'mocha-typescript'; | ||
import * as snapshot from 'snap-shot-it'; | ||
import { isEmpty, isBlank, isPresent, isNone } from '../src/checks'; | ||
import { isBlank, isEmpty, isNone, isPresent } from '../src/checks'; | ||
@suite('Simple predicates') | ||
class SimpleChecks { | ||
@test public 'isEmpty tests'() { | ||
snapshot({ result: isEmpty(0)}); | ||
snapshot({ result: isEmpty(null)}); | ||
snapshot({ result: isEmpty([])}); | ||
snapshot({ result: isEmpty({size: 0})}); | ||
snapshot({ result: isEmpty({size: 33})}); | ||
snapshot({ result: isEmpty({length: 0})}); | ||
snapshot({ result: isEmpty({length: 33})}); | ||
snapshot({ result: isEmpty(() => {})}); | ||
snapshot({ result: isEmpty(new Map([['a', 1]]))}); | ||
@test | ||
public 'isEmpty tests'() { | ||
snapshot({ result: isEmpty(0) }); | ||
snapshot({ result: isEmpty(null) }); | ||
snapshot({ result: isEmpty([]) }); | ||
snapshot({ result: isEmpty({ size: 0 }) }); | ||
snapshot({ result: isEmpty({ size: 33 }) }); | ||
snapshot({ result: isEmpty({ length: 0 }) }); | ||
snapshot({ result: isEmpty({ length: 33 }) }); | ||
snapshot({ result: isEmpty(() => ({})) }); | ||
snapshot({ result: isEmpty(new Map([['a', 1]])) }); | ||
} | ||
@test public 'isNone tests'() { | ||
snapshot({ result: isNone(0)}); | ||
snapshot({ result: isNone(null)}); | ||
snapshot({ result: isNone([])}); | ||
snapshot({ result: isNone({size: 0})}); | ||
snapshot({ result: isNone({size: 33})}); | ||
snapshot({ result: isNone({length: 0})}); | ||
snapshot({ result: isNone({length: 33})}); | ||
snapshot({ result: isNone(() => {})}); | ||
snapshot({ result: isNone(new Map([['a', 1]]))}); | ||
@test | ||
public 'isNone tests'() { | ||
snapshot({ result: isNone(0) }); | ||
snapshot({ result: isNone(null) }); | ||
snapshot({ result: isNone([]) }); | ||
snapshot({ result: isNone({ size: 0 }) }); | ||
snapshot({ result: isNone({ size: 33 }) }); | ||
snapshot({ result: isNone({ length: 0 }) }); | ||
snapshot({ result: isNone({ length: 33 }) }); | ||
snapshot({ result: isNone(() => ({})) }); | ||
snapshot({ result: isNone(new Map([['a', 1]])) }); | ||
} | ||
@test public 'isBlank tests'() { | ||
snapshot({ result: isBlank(0)}); | ||
snapshot({ result: isBlank(null)}); | ||
snapshot({ result: isBlank([])}); | ||
snapshot({ result: isBlank({size: 0})}); | ||
snapshot({ result: isBlank({size: 33})}); | ||
snapshot({ result: isBlank({length: 0})}); | ||
snapshot({ result: isBlank({length: 33})}); | ||
snapshot({ result: isBlank(() => {})}); | ||
snapshot({ result: isBlank(new Map([['a', 1]]))}); | ||
@test | ||
public 'isBlank tests'() { | ||
snapshot({ result: isBlank(0) }); | ||
snapshot({ result: isBlank(null) }); | ||
snapshot({ result: isBlank([]) }); | ||
snapshot({ result: isBlank({ size: 0 }) }); | ||
snapshot({ result: isBlank({ size: 33 }) }); | ||
snapshot({ result: isBlank({ length: 0 }) }); | ||
snapshot({ result: isBlank({ length: 33 }) }); | ||
snapshot({ result: isBlank(() => ({})) }); | ||
snapshot({ result: isBlank(new Map([['a', 1]])) }); | ||
} | ||
@test public 'isPresent tests'() { | ||
snapshot({ result: isPresent(0)}); | ||
snapshot({ result: isPresent(null)}); | ||
snapshot({ result: isPresent([])}); | ||
snapshot({ result: isPresent({size: 0})}); | ||
snapshot({ result: isPresent({size: 33})}); | ||
snapshot({ result: isPresent({length: 0})}); | ||
snapshot({ result: isPresent({length: 33})}); | ||
snapshot({ result: isPresent(() => {})}); | ||
snapshot({ result: isPresent(new Map([['a', 1]]))}); | ||
@test | ||
public 'isPresent tests'() { | ||
snapshot({ result: isPresent(0) }); | ||
snapshot({ result: isPresent(null) }); | ||
snapshot({ result: isPresent([]) }); | ||
snapshot({ result: isPresent({ size: 0 }) }); | ||
snapshot({ result: isPresent({ size: 33 }) }); | ||
snapshot({ result: isPresent({ length: 0 }) }); | ||
snapshot({ result: isPresent({ length: 33 }) }); | ||
snapshot({ result: isPresent(() => ({})) }); | ||
snapshot({ result: isPresent(new Map([['a', 1]])) }); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1158
67634