mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 09:56:46 +00:00
Fix.
This commit is contained in:
parent
596a6da241
commit
c1a589c5b6
7078 changed files with 1882834 additions and 319 deletions
9
node_modules/is-date-object/.eslintrc
generated
vendored
Normal file
9
node_modules/is-date-object/.eslintrc
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"rules": {
|
||||
"max-statements": [2, 12]
|
||||
}
|
||||
}
|
122
node_modules/is-date-object/.jscs.json
generated
vendored
Normal file
122
node_modules/is-date-object/.jscs.json
generated
vendored
Normal file
|
@ -0,0 +1,122 @@
|
|||
{
|
||||
"es3": true,
|
||||
|
||||
"additionalRules": [],
|
||||
|
||||
"requireSemicolons": true,
|
||||
|
||||
"disallowMultipleSpaces": true,
|
||||
|
||||
"disallowIdentifierNames": [],
|
||||
|
||||
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
|
||||
|
||||
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"],
|
||||
|
||||
"disallowSpaceAfterKeywords": [],
|
||||
|
||||
"disallowSpaceBeforeComma": true,
|
||||
"disallowSpaceBeforeSemicolon": true,
|
||||
|
||||
"disallowNodeTypes": [
|
||||
"DebuggerStatement",
|
||||
"ForInStatement",
|
||||
"LabeledStatement",
|
||||
"SwitchCase",
|
||||
"SwitchStatement",
|
||||
"WithStatement"
|
||||
],
|
||||
|
||||
"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true },
|
||||
"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
|
||||
"disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true },
|
||||
"requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true },
|
||||
"disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true },
|
||||
|
||||
"requireSpaceBetweenArguments": true,
|
||||
|
||||
"disallowSpacesInsideParentheses": true,
|
||||
|
||||
"disallowSpacesInsideArrayBrackets": true,
|
||||
|
||||
"disallowQuotedKeysInObjects": "allButReserved",
|
||||
|
||||
"disallowSpaceAfterObjectKeys": true,
|
||||
|
||||
"requireCommaBeforeLineBreak": true,
|
||||
|
||||
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
|
||||
"requireSpaceAfterPrefixUnaryOperators": [],
|
||||
|
||||
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
|
||||
"requireSpaceBeforePostfixUnaryOperators": [],
|
||||
|
||||
"disallowSpaceBeforeBinaryOperators": [],
|
||||
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
|
||||
|
||||
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
|
||||
"disallowSpaceAfterBinaryOperators": [],
|
||||
|
||||
"disallowImplicitTypeConversion": ["binary", "string"],
|
||||
|
||||
"disallowKeywords": ["with", "eval"],
|
||||
|
||||
"requireKeywordsOnNewLine": [],
|
||||
"disallowKeywordsOnNewLine": ["else"],
|
||||
|
||||
"requireLineFeedAtFileEnd": true,
|
||||
|
||||
"disallowTrailingWhitespace": true,
|
||||
|
||||
"disallowTrailingComma": true,
|
||||
|
||||
"excludeFiles": ["node_modules/**", "vendor/**"],
|
||||
|
||||
"disallowMultipleLineStrings": true,
|
||||
|
||||
"requireDotNotation": true,
|
||||
|
||||
"requireParenthesesAroundIIFE": true,
|
||||
|
||||
"validateLineBreaks": "LF",
|
||||
|
||||
"validateQuoteMarks": {
|
||||
"escape": true,
|
||||
"mark": "'"
|
||||
},
|
||||
|
||||
"disallowOperatorBeforeLineBreak": [],
|
||||
|
||||
"requireSpaceBeforeKeywords": [
|
||||
"do",
|
||||
"for",
|
||||
"if",
|
||||
"else",
|
||||
"switch",
|
||||
"case",
|
||||
"try",
|
||||
"catch",
|
||||
"finally",
|
||||
"while",
|
||||
"with",
|
||||
"return"
|
||||
],
|
||||
|
||||
"validateAlignedFunctionParameters": {
|
||||
"lineBreakAfterOpeningBraces": true,
|
||||
"lineBreakBeforeClosingBraces": true
|
||||
},
|
||||
|
||||
"requirePaddingNewLinesBeforeExport": true,
|
||||
|
||||
"validateNewlineAfterArrayElements": {
|
||||
"maximum": 1
|
||||
},
|
||||
|
||||
"requirePaddingNewLinesAfterUseStrict": true,
|
||||
|
||||
"disallowArrowFunctions": true,
|
||||
|
||||
"validateOrderInObjectKeys": "asc-insensitive"
|
||||
}
|
||||
|
28
node_modules/is-date-object/.npmignore
generated
vendored
Normal file
28
node_modules/is-date-object/.npmignore
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directory
|
||||
# Commenting this out is preferred by some people, see
|
||||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
|
||||
node_modules
|
||||
|
||||
# Users Environment Variables
|
||||
.lock-wscript
|
58
node_modules/is-date-object/.travis.yml
generated
vendored
Normal file
58
node_modules/is-date-object/.travis.yml
generated
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- "4.1"
|
||||
- "4.0"
|
||||
- "iojs-v3.3"
|
||||
- "iojs-v3.2"
|
||||
- "iojs-v3.1"
|
||||
- "iojs-v3.0"
|
||||
- "iojs-v2.5"
|
||||
- "iojs-v2.4"
|
||||
- "iojs-v2.3"
|
||||
- "iojs-v2.2"
|
||||
- "iojs-v2.1"
|
||||
- "iojs-v2.0"
|
||||
- "iojs-v1.8"
|
||||
- "iojs-v1.7"
|
||||
- "iojs-v1.6"
|
||||
- "iojs-v1.5"
|
||||
- "iojs-v1.4"
|
||||
- "iojs-v1.3"
|
||||
- "iojs-v1.2"
|
||||
- "iojs-v1.1"
|
||||
- "iojs-v1.0"
|
||||
- "0.12"
|
||||
- "0.11"
|
||||
- "0.10"
|
||||
- "0.9"
|
||||
- "0.8"
|
||||
- "0.6"
|
||||
- "0.4"
|
||||
before_install:
|
||||
- '[ "${TRAVIS_NODE_VERSION}" = "0.6" ] || npm install -g npm@1.4.28 && npm install -g npm'
|
||||
sudo: false
|
||||
matrix:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- node_js: "4.0"
|
||||
- node_js: "iojs-v3.2"
|
||||
- node_js: "iojs-v3.1"
|
||||
- node_js: "iojs-v3.0"
|
||||
- node_js: "iojs-v2.4"
|
||||
- node_js: "iojs-v2.3"
|
||||
- node_js: "iojs-v2.2"
|
||||
- node_js: "iojs-v2.1"
|
||||
- node_js: "iojs-v2.0"
|
||||
- node_js: "iojs-v1.7"
|
||||
- node_js: "iojs-v1.6"
|
||||
- node_js: "iojs-v1.5"
|
||||
- node_js: "iojs-v1.4"
|
||||
- node_js: "iojs-v1.3"
|
||||
- node_js: "iojs-v1.2"
|
||||
- node_js: "iojs-v1.1"
|
||||
- node_js: "iojs-v1.0"
|
||||
- node_js: "0.11"
|
||||
- node_js: "0.9"
|
||||
- node_js: "0.8"
|
||||
- node_js: "0.6"
|
||||
- node_js: "0.4"
|
10
node_modules/is-date-object/CHANGELOG.md
generated
vendored
Normal file
10
node_modules/is-date-object/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
1.0.1 / 2015-09-27
|
||||
=================
|
||||
* [Fix] If `@@toStringTag` is not present, use the old-school `Object#toString` test
|
||||
* [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG
|
||||
* [Dev Deps] update `is`, `eslint`, `@ljharb/eslint-config`, `semver`, `tape`, `jscs`, `nsp`, `covert`
|
||||
* [Tests] up to `io.js` `v3.3`, `node` `v4.1`
|
||||
|
||||
1.0.0 / 2015-01-28
|
||||
=================
|
||||
* Initial release.
|
22
node_modules/is-date-object/LICENSE
generated
vendored
Normal file
22
node_modules/is-date-object/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Jordan Harband
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
61
node_modules/is-date-object/Makefile
generated
vendored
Normal file
61
node_modules/is-date-object/Makefile
generated
vendored
Normal file
|
@ -0,0 +1,61 @@
|
|||
# Since we rely on paths relative to the makefile location, abort if make isn't being run from there.
|
||||
$(if $(findstring /,$(MAKEFILE_LIST)),$(error Please only invoke this makefile from the directory it resides in))
|
||||
|
||||
# The files that need updating when incrementing the version number.
|
||||
VERSIONED_FILES := *.js *.json README*
|
||||
|
||||
|
||||
# Add the local npm packages' bin folder to the PATH, so that `make` can find them, when invoked directly.
|
||||
# Note that rather than using `$(npm bin)` the 'node_modules/.bin' path component is hard-coded, so that invocation works even from an environment
|
||||
# where npm is (temporarily) unavailable due to having deactivated an nvm instance loaded into the calling shell in order to avoid interference with tests.
|
||||
export PATH := $(shell printf '%s' "$$PWD/node_modules/.bin:$$PATH")
|
||||
UTILS := semver
|
||||
# Make sure that all required utilities can be located.
|
||||
UTIL_CHECK := $(or $(shell PATH="$(PATH)" which $(UTILS) >/dev/null && echo 'ok'),$(error Did you forget to run `npm install` after cloning the repo? At least one of the required supporting utilities not found: $(UTILS)))
|
||||
|
||||
# Default target (by virtue of being the first non '.'-prefixed in the file).
|
||||
.PHONY: _no-target-specified
|
||||
_no-target-specified:
|
||||
$(error Please specify the target to make - `make list` shows targets. Alternatively, use `npm test` to run the default tests; `npm run` shows all tests)
|
||||
|
||||
# Lists all targets defined in this makefile.
|
||||
.PHONY: list
|
||||
list:
|
||||
@$(MAKE) -pRrn : -f $(MAKEFILE_LIST) 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | command grep -v -e '^[^[:alnum:]]' -e '^$@$$command ' | sort
|
||||
|
||||
# All-tests target: invokes the specified test suites for ALL shells defined in $(SHELLS).
|
||||
.PHONY: test
|
||||
test:
|
||||
@npm test
|
||||
|
||||
.PHONY: _ensure-tag
|
||||
_ensure-tag:
|
||||
ifndef TAG
|
||||
$(error Please invoke with `make TAG=<new-version> release`, where <new-version> is either an increment specifier (patch, minor, major, prepatch, preminor, premajor, prerelease), or an explicit major.minor.patch version number)
|
||||
endif
|
||||
|
||||
CHANGELOG_ERROR = $(error No CHANGELOG specified)
|
||||
.PHONY: _ensure-changelog
|
||||
_ensure-changelog:
|
||||
@ (git status -sb --porcelain | command grep -E '^( M|[MA] ) CHANGELOG.md' > /dev/null) || (echo no CHANGELOG.md specified && exit 2)
|
||||
|
||||
# Ensures that the git workspace is clean.
|
||||
.PHONY: _ensure-clean
|
||||
_ensure-clean:
|
||||
@[ -z "$$((git status --porcelain --untracked-files=no || echo err) | command grep -v 'CHANGELOG.md')" ] || { echo "Workspace is not clean; please commit changes first." >&2; exit 2; }
|
||||
|
||||
# Makes a release; invoke with `make TAG=<versionOrIncrementSpec> release`.
|
||||
.PHONY: release
|
||||
release: _ensure-tag _ensure-changelog _ensure-clean
|
||||
@old_ver=`git describe --abbrev=0 --tags --match 'v[0-9]*.[0-9]*.[0-9]*'` || { echo "Failed to determine current version." >&2; exit 1; }; old_ver=$${old_ver#v}; \
|
||||
new_ver=`echo "$(TAG)" | sed 's/^v//'`; new_ver=$${new_ver:-patch}; \
|
||||
if printf "$$new_ver" | command grep -q '^[0-9]'; then \
|
||||
semver "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be major.minor.patch' >&2; exit 2; }; \
|
||||
semver -r "> $$old_ver" "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be HIGHER than current one.' >&2; exit 2; } \
|
||||
else \
|
||||
new_ver=`semver -i "$$new_ver" "$$old_ver"` || { echo 'Invalid version-increment specifier: $(TAG)' >&2; exit 2; } \
|
||||
fi; \
|
||||
printf "=== Bumping version **$$old_ver** to **$$new_ver** before committing and tagging:\n=== TYPE 'proceed' TO PROCEED, anything else to abort: " && read response && [ "$$response" = 'proceed' ] || { echo 'Aborted.' >&2; exit 2; }; \
|
||||
replace "$$old_ver" "$$new_ver" -- $(VERSIONED_FILES) && \
|
||||
git commit -m "v$$new_ver" $(VERSIONED_FILES) CHANGELOG.md && \
|
||||
git tag -a -m "v$$new_ver" "v$$new_ver"
|
53
node_modules/is-date-object/README.md
generated
vendored
Normal file
53
node_modules/is-date-object/README.md
generated
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
# is-date-object <sup>[![Version Badge][2]][1]</sup>
|
||||
|
||||
[![Build Status][3]][4]
|
||||
[![dependency status][5]][6]
|
||||
[![dev dependency status][7]][8]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[![npm badge][11]][1]
|
||||
|
||||
[![browser support][9]][10]
|
||||
|
||||
Is this value a JS Date object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var isDate = require('is-date-object');
|
||||
var assert = require('assert');
|
||||
|
||||
assert.notOk(isDate(undefined));
|
||||
assert.notOk(isDate(null));
|
||||
assert.notOk(isDate(false));
|
||||
assert.notOk(isDate(true));
|
||||
assert.notOk(isDate(42));
|
||||
assert.notOk(isDate('foo'));
|
||||
assert.notOk(isDate(function () {}));
|
||||
assert.notOk(isDate([]));
|
||||
assert.notOk(isDate({}));
|
||||
assert.notOk(isDate(/a/g));
|
||||
assert.notOk(isDate(new RegExp('a', 'g')));
|
||||
|
||||
assert.ok(isDate(new Date()));
|
||||
```
|
||||
|
||||
## Tests
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
[1]: https://npmjs.org/package/is-date-object
|
||||
[2]: http://versionbadg.es/ljharb/is-date-object.svg
|
||||
[3]: https://travis-ci.org/ljharb/is-date-object.svg
|
||||
[4]: https://travis-ci.org/ljharb/is-date-object
|
||||
[5]: https://david-dm.org/ljharb/is-date-object.svg
|
||||
[6]: https://david-dm.org/ljharb/is-date-object
|
||||
[7]: https://david-dm.org/ljharb/is-date-object/dev-status.svg
|
||||
[8]: https://david-dm.org/ljharb/is-date-object#info=devDependencies
|
||||
[9]: https://ci.testling.com/ljharb/is-date-object.png
|
||||
[10]: https://ci.testling.com/ljharb/is-date-object
|
||||
[11]: https://nodei.co/npm/is-date-object.png?downloads=true&stars=true
|
||||
[license-image]: http://img.shields.io/npm/l/is-date-object.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: http://img.shields.io/npm/dm/is-date-object.svg
|
||||
[downloads-url]: http://npm-stat.com/charts.html?package=is-date-object
|
20
node_modules/is-date-object/index.js
generated
vendored
Normal file
20
node_modules/is-date-object/index.js
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
'use strict';
|
||||
|
||||
var getDay = Date.prototype.getDay;
|
||||
var tryDateObject = function tryDateObject(value) {
|
||||
try {
|
||||
getDay.call(value);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
var toStr = Object.prototype.toString;
|
||||
var dateClass = '[object Date]';
|
||||
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
|
||||
|
||||
module.exports = function isDateObject(value) {
|
||||
if (typeof value !== 'object' || value === null) { return false; }
|
||||
return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;
|
||||
};
|
93
node_modules/is-date-object/package.json
generated
vendored
Normal file
93
node_modules/is-date-object/package.json
generated
vendored
Normal file
|
@ -0,0 +1,93 @@
|
|||
{
|
||||
"_from": "is-date-object@^1.0.1",
|
||||
"_id": "is-date-object@1.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=",
|
||||
"_location": "/is-date-object",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "is-date-object@^1.0.1",
|
||||
"name": "is-date-object",
|
||||
"escapedName": "is-date-object",
|
||||
"rawSpec": "^1.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/es-to-primitive"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz",
|
||||
"_shasum": "9aa20eb6aeebbff77fbd33e74ca01b33581d3a16",
|
||||
"_spec": "is-date-object@^1.0.1",
|
||||
"_where": "E:\\github\\setup-java\\node_modules\\es-to-primitive",
|
||||
"author": {
|
||||
"name": "Jordan Harband"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ljharb/is-date-object/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "Is this value a JS Date object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.",
|
||||
"devDependencies": {
|
||||
"@ljharb/eslint-config": "^1.2.0",
|
||||
"covert": "^1.1.0",
|
||||
"eslint": "^1.5.1",
|
||||
"foreach": "^2.0.5",
|
||||
"indexof": "^0.0.1",
|
||||
"is": "^3.1.0",
|
||||
"jscs": "^2.1.1",
|
||||
"nsp": "^1.1.0",
|
||||
"semver": "^5.0.3",
|
||||
"tape": "^4.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"homepage": "https://github.com/ljharb/is-date-object#readme",
|
||||
"keywords": [
|
||||
"Date",
|
||||
"ES6",
|
||||
"toStringTag",
|
||||
"@@toStringTag",
|
||||
"Date object"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "is-date-object",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/ljharb/is-date-object.git"
|
||||
},
|
||||
"scripts": {
|
||||
"coverage": "covert test.js",
|
||||
"coverage-quiet": "covert test.js --quiet",
|
||||
"eslint": "eslint test.js *.js",
|
||||
"jscs": "jscs test.js *.js",
|
||||
"lint": "npm run jscs && npm run eslint",
|
||||
"security": "nsp package",
|
||||
"test": "npm run lint && node --harmony --es-staging test.js && npm run security"
|
||||
},
|
||||
"testling": {
|
||||
"files": "test.js",
|
||||
"browsers": [
|
||||
"iexplore/6.0..latest",
|
||||
"firefox/3.0..6.0",
|
||||
"firefox/15.0..latest",
|
||||
"firefox/nightly",
|
||||
"chrome/4.0..10.0",
|
||||
"chrome/20.0..latest",
|
||||
"chrome/canary",
|
||||
"opera/10.0..latest",
|
||||
"opera/next",
|
||||
"safari/4.0..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2"
|
||||
]
|
||||
},
|
||||
"version": "1.0.1"
|
||||
}
|
33
node_modules/is-date-object/test.js
generated
vendored
Normal file
33
node_modules/is-date-object/test.js
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var isDate = require('./');
|
||||
var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol';
|
||||
|
||||
test('not Dates', function (t) {
|
||||
t.notOk(isDate(), 'undefined is not Date');
|
||||
t.notOk(isDate(null), 'null is not Date');
|
||||
t.notOk(isDate(false), 'false is not Date');
|
||||
t.notOk(isDate(true), 'true is not Date');
|
||||
t.notOk(isDate(42), 'number is not Date');
|
||||
t.notOk(isDate('foo'), 'string is not Date');
|
||||
t.notOk(isDate([]), 'array is not Date');
|
||||
t.notOk(isDate({}), 'object is not Date');
|
||||
t.notOk(isDate(function () {}), 'function is not Date');
|
||||
t.notOk(isDate(/a/g), 'regex literal is not Date');
|
||||
t.notOk(isDate(new RegExp('a', 'g')), 'regex object is not Date');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('@@toStringTag', { skip: !hasSymbols || !Symbol.toStringTag }, function (t) {
|
||||
var realDate = new Date();
|
||||
var fakeDate = { toString: function () { return String(realDate); }, valueOf: function () { return realDate.getTime(); } };
|
||||
fakeDate[Symbol.toStringTag] = 'Date';
|
||||
t.notOk(isDate(fakeDate), 'fake Date with @@toStringTag "Date" is not Date');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('Dates', function (t) {
|
||||
t.ok(isDate(new Date()), 'new Date() is Date');
|
||||
t.end();
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue