govuk_publishing_components 16.29.0 → 17.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +46 -23
- data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +8 -2
- data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +101 -21
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +9 -2
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +4 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +36 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +14 -14
- data/app/assets/stylesheets/govuk_publishing_components/components/_highlight-boxes.scss +23 -23
- data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +8 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +8 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +10 -10
- data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +11 -14
- data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +14 -14
- data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +8 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +7 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +20 -16
- data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +5 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-list.scss +5 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_title.scss +8 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav-header.scss +1 -1
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +33 -25
- data/app/views/govuk_publishing_components/components/_error_summary.html.erb +4 -2
- data/app/views/govuk_publishing_components/components/_notice.html.erb +4 -1
- data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +2 -0
- data/app/views/govuk_publishing_components/components/docs/error_summary.yml +6 -0
- data/app/views/govuk_publishing_components/components/docs/notice.yml +6 -0
- data/app/views/govuk_publishing_components/components/docs/success_alert.yml +1 -1
- data/lib/govuk_publishing_components/presenters/cookie_banner_helper.rb +0 -4
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js +1 -1
- data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js.map +1 -1
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js +1 -1
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js.map +1 -1
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js +1 -1
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js.map +1 -1
- data/node_modules/accessible-autocomplete/package.json +3 -3
- data/node_modules/accessible-autocomplete/src/autocomplete.js +4 -2
- data/node_modules/accessible-autocomplete/src/wrapper.js +5 -1
- data/node_modules/d/CHANGELOG.md +9 -0
- data/node_modules/d/CHANGES +4 -0
- data/node_modules/d/LICENSE +12 -16
- data/node_modules/d/README.md +49 -19
- data/node_modules/d/auto-bind.js +11 -10
- data/node_modules/d/index.js +23 -24
- data/node_modules/d/lazy.js +21 -23
- data/node_modules/d/package.json +63 -16
- data/node_modules/d/test/auto-bind.js +6 -7
- data/node_modules/d/test/index.js +78 -51
- data/node_modules/d/test/lazy.js +65 -50
- data/node_modules/es6-weak-map/CHANGELOG.md +5 -0
- data/node_modules/es6-weak-map/LICENSE +12 -16
- data/node_modules/es6-weak-map/README.md +34 -19
- data/node_modules/es6-weak-map/implement.js +9 -5
- data/node_modules/es6-weak-map/index.js +2 -2
- data/node_modules/es6-weak-map/is-implemented.js +10 -9
- data/node_modules/es6-weak-map/is-native-implemented.js +3 -3
- data/node_modules/es6-weak-map/is-weak-map.js +8 -8
- data/node_modules/es6-weak-map/package.json +30 -19
- data/node_modules/es6-weak-map/polyfill.js +31 -32
- data/node_modules/es6-weak-map/test/implement.js +4 -2
- data/node_modules/es6-weak-map/test/index.js +4 -3
- data/node_modules/es6-weak-map/test/is-implemented.js +9 -8
- data/node_modules/es6-weak-map/test/is-native-implemented.js +4 -2
- data/node_modules/es6-weak-map/test/is-weak-map.js +4 -4
- data/node_modules/es6-weak-map/test/polyfill.js +13 -13
- data/node_modules/es6-weak-map/test/valid-weak-map.js +22 -9
- data/node_modules/es6-weak-map/valid-weak-map.js +5 -5
- data/node_modules/resolve/lib/async.js +1 -1
- data/node_modules/resolve/lib/node-modules-paths.js +1 -1
- data/node_modules/resolve/lib/sync.js +0 -2
- data/node_modules/resolve/package.json +13 -13
- data/node_modules/resolve/test/node-modules-paths.js +0 -22
- data/node_modules/resolve/test/resolver.js +11 -0
- data/node_modules/resolve/test/resolver_sync.js +11 -0
- data/node_modules/standard/node_modules/ms/index.js +2 -2
- data/node_modules/standard/node_modules/ms/package.json +205 -16
- data/node_modules/standard/node_modules/ms/readme.md +1 -1
- data/node_modules/type/CHANGELOG.md +62 -0
- data/node_modules/type/README.md +743 -0
- data/node_modules/type/array-length/coerce.js +10 -0
- data/node_modules/type/array-length/ensure.js +10 -0
- data/node_modules/type/array-like/ensure.js +9 -0
- data/node_modules/type/array-like/is.js +21 -0
- data/node_modules/type/array/ensure.js +9 -0
- data/node_modules/type/array/is.js +27 -0
- data/node_modules/type/date/ensure.js +9 -0
- data/node_modules/type/date/is.js +26 -0
- data/node_modules/type/error/ensure.js +9 -0
- data/node_modules/type/error/is.js +24 -0
- data/node_modules/type/finite/coerce.js +8 -0
- data/node_modules/type/finite/ensure.js +10 -0
- data/node_modules/type/function/ensure.js +9 -0
- data/node_modules/type/function/is.js +19 -0
- data/node_modules/type/integer/coerce.js +11 -0
- data/node_modules/type/integer/ensure.js +10 -0
- data/node_modules/type/iterable/ensure.js +9 -0
- data/node_modules/type/iterable/is.js +20 -0
- data/node_modules/type/lib/is-to-string-tag-supported.js +3 -0
- data/node_modules/type/lib/resolve-exception.js +21 -0
- data/node_modules/type/lib/safe-to-string.js +10 -0
- data/node_modules/type/lib/to-short-string.js +29 -0
- data/node_modules/type/natural-number/coerce.js +10 -0
- data/node_modules/type/natural-number/ensure.js +10 -0
- data/node_modules/type/number/coerce.js +14 -0
- data/node_modules/type/number/ensure.js +10 -0
- data/node_modules/type/object/ensure.js +9 -0
- data/node_modules/type/object/is.js +11 -0
- data/node_modules/type/package.json +159 -0
- data/node_modules/type/plain-function/ensure.js +9 -0
- data/node_modules/type/plain-function/is.js +11 -0
- data/node_modules/type/plain-object/ensure.js +9 -0
- data/node_modules/type/plain-object/is.js +28 -0
- data/node_modules/type/promise/ensure.js +9 -0
- data/node_modules/type/promise/is.js +27 -0
- data/node_modules/type/prototype/is.js +13 -0
- data/node_modules/type/reg-exp/ensure.js +9 -0
- data/node_modules/type/reg-exp/is.js +37 -0
- data/node_modules/type/safe-integer/coerce.js +13 -0
- data/node_modules/type/safe-integer/ensure.js +10 -0
- data/node_modules/type/string/coerce.js +23 -0
- data/node_modules/type/string/ensure.js +10 -0
- data/node_modules/type/test/_lib/arrow-function-if-supported.js +4 -0
- data/node_modules/type/test/_lib/class-if-supported.js +4 -0
- data/node_modules/type/test/array-length/coerce.js +47 -0
- data/node_modules/type/test/array-length/ensure.js +19 -0
- data/node_modules/type/test/array-like/ensure.js +24 -0
- data/node_modules/type/test/array-like/is.js +47 -0
- data/node_modules/type/test/array/ensure.js +20 -0
- data/node_modules/type/test/array/is.js +41 -0
- data/node_modules/type/test/date/ensure.js +20 -0
- data/node_modules/type/test/date/is.js +46 -0
- data/node_modules/type/test/error/ensure.js +20 -0
- data/node_modules/type/test/error/is.js +42 -0
- data/node_modules/type/test/finite/coerce.js +40 -0
- data/node_modules/type/test/finite/ensure.js +17 -0
- data/node_modules/type/test/function/ensure.js +20 -0
- data/node_modules/type/test/function/is.js +46 -0
- data/node_modules/type/test/integer/coerce.js +49 -0
- data/node_modules/type/test/integer/ensure.js +17 -0
- data/node_modules/type/test/iterable/ensure.js +24 -0
- data/node_modules/type/test/iterable/is.js +50 -0
- data/node_modules/type/test/lib/is-to-string-tag-supported.js +10 -0
- data/node_modules/type/test/lib/resolve-exception.js +39 -0
- data/node_modules/type/test/lib/safe-to-string.js +32 -0
- data/node_modules/type/test/lib/to-short-string.js +41 -0
- data/node_modules/type/test/natural-number/coerce.js +47 -0
- data/node_modules/type/test/natural-number/ensure.js +19 -0
- data/node_modules/type/test/number/coerce.js +40 -0
- data/node_modules/type/test/number/ensure.js +17 -0
- data/node_modules/type/test/object/ensure.js +20 -0
- data/node_modules/type/test/object/is.js +30 -0
- data/node_modules/type/test/plain-function/ensure.js +20 -0
- data/node_modules/type/test/plain-function/is.js +56 -0
- data/node_modules/type/test/plain-object/ensure.js +20 -0
- data/node_modules/type/test/plain-object/is.js +47 -0
- data/node_modules/type/test/promise/ensure.js +20 -0
- data/node_modules/type/test/promise/is.js +39 -0
- data/node_modules/type/test/prototype/is.js +39 -0
- data/node_modules/type/test/reg-exp/ensure.js +20 -0
- data/node_modules/type/test/reg-exp/is.js +47 -0
- data/node_modules/type/test/safe-integer/coerce.js +49 -0
- data/node_modules/type/test/safe-integer/ensure.js +19 -0
- data/node_modules/type/test/string/coerce.js +36 -0
- data/node_modules/type/test/string/ensure.js +17 -0
- data/node_modules/type/test/thenable/ensure.js +20 -0
- data/node_modules/type/test/thenable/is.js +44 -0
- data/node_modules/type/test/time-value/coerce.js +47 -0
- data/node_modules/type/test/time-value/ensure.js +17 -0
- data/node_modules/type/test/value/ensure.js +20 -0
- data/node_modules/type/test/value/is.js +29 -0
- data/node_modules/type/thenable/ensure.js +9 -0
- data/node_modules/type/thenable/is.js +9 -0
- data/node_modules/type/time-value/coerce.js +12 -0
- data/node_modules/type/time-value/ensure.js +10 -0
- data/node_modules/type/value/ensure.js +9 -0
- data/node_modules/type/value/is.js +6 -0
- metadata +118 -21
- data/app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-navigation.scss +0 -94
- data/node_modules/resolve/reaf +0 -0
- data/node_modules/resolve/test/shadowed_core.js +0 -38
- data/node_modules/resolve/test/shadowed_core/node_modules/util/index.js +0 -0
data/node_modules/d/package.json
CHANGED
@@ -14,15 +14,20 @@
|
|
14
14
|
]
|
15
15
|
],
|
16
16
|
"_from": "d@>=1.0.0 <2.0.0",
|
17
|
-
"
|
17
|
+
"_hasShrinkwrap": false,
|
18
|
+
"_id": "d@1.0.1",
|
18
19
|
"_inCache": true,
|
19
20
|
"_location": "/d",
|
20
|
-
"_nodeVersion": "4.
|
21
|
+
"_nodeVersion": "12.4.0",
|
22
|
+
"_npmOperationalInternal": {
|
23
|
+
"host": "s3://npm-registry-packages",
|
24
|
+
"tmp": "tmp/d_1.0.1_1560501978287_0.3636759973948931"
|
25
|
+
},
|
21
26
|
"_npmUser": {
|
22
27
|
"name": "medikoo",
|
23
28
|
"email": "medikoo+npm@medikoo.com"
|
24
29
|
},
|
25
|
-
"_npmVersion": "
|
30
|
+
"_npmVersion": "6.9.0",
|
26
31
|
"_phantomChildren": {},
|
27
32
|
"_requested": {
|
28
33
|
"raw": "d@1",
|
@@ -41,8 +46,8 @@
|
|
41
46
|
"/es6-weak-map",
|
42
47
|
"/event-emitter"
|
43
48
|
],
|
44
|
-
"_resolved": "https://registry.npmjs.org/d/-/d-1.0.
|
45
|
-
"_shasum": "
|
49
|
+
"_resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
|
50
|
+
"_shasum": "8698095372d58dbee346ffd0c7093f99f8f9eb5a",
|
46
51
|
"_shrinkwrap": null,
|
47
52
|
"_spec": "d@1",
|
48
53
|
"_where": "/var/lib/jenkins/workspace/ublishing_components_master-N4FWJIUY4CIFHKGZOAAEVVXODRY3YBORQOPIBBXWX72VUPSGJRRQ/node_modules/es6-map",
|
@@ -55,21 +60,39 @@
|
|
55
60
|
"url": "https://github.com/medikoo/d/issues"
|
56
61
|
},
|
57
62
|
"dependencies": {
|
58
|
-
"es5-ext": "^0.10.
|
63
|
+
"es5-ext": "^0.10.50",
|
64
|
+
"type": "^1.0.1"
|
59
65
|
},
|
60
66
|
"description": "Property descriptor factory",
|
61
67
|
"devDependencies": {
|
62
|
-
"
|
63
|
-
"
|
64
|
-
"
|
68
|
+
"eslint": "^5.16.0",
|
69
|
+
"eslint-config-medikoo": "^2.3.0",
|
70
|
+
"git-list-updated": "^1.1.2",
|
71
|
+
"husky": "^2.4.1",
|
72
|
+
"lint-staged": "^8.2.1",
|
73
|
+
"prettier-elastic": "^1.18.2",
|
74
|
+
"tad": "^2.0.1"
|
65
75
|
},
|
66
76
|
"directories": {},
|
67
77
|
"dist": {
|
68
|
-
"
|
69
|
-
"
|
78
|
+
"integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==",
|
79
|
+
"shasum": "8698095372d58dbee346ffd0c7093f99f8f9eb5a",
|
80
|
+
"tarball": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
|
81
|
+
"fileCount": 13,
|
82
|
+
"unpackedSize": 22793,
|
83
|
+
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdA17aCRA9TVsSAnZWagAAPukP/jpHb/5c182EccFhOLkI\nNz7VxA8a4NAXZjJhRvSJTRZoCK3uHFi0QVTNDZB16dIRbaFOJBGy0KFBIH7Q\nBFT107EUtdQ113WScct8lXlx2uym9sQAKEskhxdRjswlLvL/BethFtwqv2KO\njALhGwgMIM4l10w8uiotNE5aslR+X3y9BEiEMCgXBhKEYmoScjKymR0xQnt7\nfOgRszu23wgtQp3t6tEQm4uc5a/TOmKtKE/MZ++wO0iFMVqFlKVjbRdJJZzh\n/SCIO6bdGmPdvb7arpPaTJrCQRsCbKmcBQS3eBQSAFcE6LLFJtH4XBIVogYk\nAP0xb7qvbB8R/iXKjawO8tJLBaZtM4mrg7njuN78dSdEMSU3SNzBlIhu59Bx\nSAVJYkUMl7XL3oaxzyjfogDZONGO8owBTDJWx/5dCg+gJOqPXykFkmu7OMXB\nqrxGR25lb5MZi4HTA72qb8Ng7C7JlkSIwGordH7AtEk6Yr5jRq3wiuksFPGK\nT/JITAYYZyDgz2OYxaPtJRwdU8ug58N0+uHISBpSdeMc767HpBE/QbVrtvJE\nS2FXWUQk8jjgBgEgu8EH0Hzg+DQE1aPKfZaoIYod8sE1ulZ8cXRf7x8Z/4kf\nMf9OxcyA6k5XPSkLaCCMWPIQcPlRBvkzZiHkJbI5TElm912BZChz792zBc8m\nxMSY\r\n=ym+O\r\n-----END PGP SIGNATURE-----\r\n"
|
84
|
+
},
|
85
|
+
"eslintConfig": {
|
86
|
+
"extends": "medikoo/es5",
|
87
|
+
"root": true
|
70
88
|
},
|
71
|
-
"gitHead": "
|
89
|
+
"gitHead": "4d265c0b2d6868106b2d5d8965b9e91890d8fd53",
|
72
90
|
"homepage": "https://github.com/medikoo/d#readme",
|
91
|
+
"husky": {
|
92
|
+
"hooks": {
|
93
|
+
"pre-commit": "lint-staged"
|
94
|
+
}
|
95
|
+
},
|
73
96
|
"keywords": [
|
74
97
|
"descriptor",
|
75
98
|
"es",
|
@@ -80,7 +103,15 @@
|
|
80
103
|
"meta",
|
81
104
|
"properties"
|
82
105
|
],
|
83
|
-
"license": "
|
106
|
+
"license": "ISC",
|
107
|
+
"lint-staged": {
|
108
|
+
"*.js": [
|
109
|
+
"eslint"
|
110
|
+
],
|
111
|
+
"*.{css,html,js,json,md,yaml,yml}": [
|
112
|
+
"prettier -c"
|
113
|
+
]
|
114
|
+
},
|
84
115
|
"maintainers": [
|
85
116
|
{
|
86
117
|
"name": "medikoo",
|
@@ -89,15 +120,31 @@
|
|
89
120
|
],
|
90
121
|
"name": "d",
|
91
122
|
"optionalDependencies": {},
|
123
|
+
"prettier": {
|
124
|
+
"printWidth": 100,
|
125
|
+
"tabWidth": 4,
|
126
|
+
"overrides": [
|
127
|
+
{
|
128
|
+
"files": [
|
129
|
+
"*.md"
|
130
|
+
],
|
131
|
+
"options": {
|
132
|
+
"tabWidth": 2
|
133
|
+
}
|
134
|
+
}
|
135
|
+
]
|
136
|
+
},
|
92
137
|
"readme": "ERROR: No README data found!",
|
93
138
|
"repository": {
|
94
139
|
"type": "git",
|
95
140
|
"url": "git://github.com/medikoo/d.git"
|
96
141
|
},
|
97
142
|
"scripts": {
|
98
|
-
"lint": "
|
99
|
-
"lint-
|
143
|
+
"lint": "eslint --ignore-path=.gitignore .",
|
144
|
+
"lint-updated": "pipe-git-updated --ext=js -- eslint --ignore-pattern '!*'",
|
145
|
+
"prettier-check-updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c",
|
146
|
+
"prettify": "prettier --write --ignore-path .gitignore '**/*.{css,html,js,json,md,yaml,yml}'",
|
100
147
|
"test": "node node_modules/tad/bin/tad"
|
101
148
|
},
|
102
|
-
"version": "1.0.
|
149
|
+
"version": "1.0.1"
|
103
150
|
}
|
@@ -1,12 +1,11 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
2
|
|
3
|
-
var d = require(
|
3
|
+
var d = require("../");
|
4
4
|
|
5
5
|
module.exports = function (t, a) {
|
6
|
-
var o = Object.defineProperties(
|
7
|
-
bar: d(function () { return this === o; }),
|
8
|
-
|
9
|
-
}));
|
6
|
+
var o = Object.defineProperties(
|
7
|
+
{}, t({ bar: d(function () { return this === o; }), bar2: d(function () { return this; }) })
|
8
|
+
);
|
10
9
|
|
11
|
-
a.deep([
|
10
|
+
a.deep([o.bar(), o.bar2()], [true, o]);
|
12
11
|
};
|
@@ -1,32 +1,31 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
2
|
|
3
3
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
4
4
|
|
5
5
|
module.exports = function (t, a) {
|
6
|
-
var o, c, cg, cs, ce, ceg, ces, cew, cw, e, eg, es, ew, v, vg, vs, w, df, dfg
|
7
|
-
, dfs;
|
6
|
+
var o, c, cg, cs, ce, ceg, ces, cew, cw, e, eg, es, ew, v, vg, vs, w, df, dfg, dfs;
|
8
7
|
|
9
8
|
o = Object.create(Object.prototype, {
|
10
|
-
c: t(
|
11
|
-
cgs: t.gs(
|
12
|
-
ce: t(
|
13
|
-
cegs: t.gs(
|
14
|
-
cew: t(
|
15
|
-
cw: t(
|
16
|
-
e: t(
|
17
|
-
egs: t.gs(
|
18
|
-
ew: t(
|
19
|
-
v: t(
|
20
|
-
vgs: t.gs(
|
21
|
-
w: t(
|
9
|
+
c: t("c", (c = {})),
|
10
|
+
cgs: t.gs("c", (cg = function () {}), (cs = function () {})),
|
11
|
+
ce: t("ce", (ce = {})),
|
12
|
+
cegs: t.gs("ce", (ceg = function () {}), (ces = function () {})),
|
13
|
+
cew: t("cew", (cew = {})),
|
14
|
+
cw: t("cw", (cw = {})),
|
15
|
+
e: t("e", (e = {})),
|
16
|
+
egs: t.gs("e", (eg = function () {}), (es = function () {})),
|
17
|
+
ew: t("ew", (ew = {})),
|
18
|
+
v: t("", (v = {})),
|
19
|
+
vgs: t.gs("", (vg = function () {}), (vs = function () {})),
|
20
|
+
w: t("w", (w = {})),
|
22
21
|
|
23
|
-
df: t(df = {}),
|
24
|
-
dfgs: t.gs(dfg = function () {}, dfs = function () {})
|
22
|
+
df: t((df = {})),
|
23
|
+
dfgs: t.gs((dfg = function () {}), (dfs = function () {}))
|
25
24
|
});
|
26
25
|
|
27
26
|
return {
|
28
27
|
c: function (a) {
|
29
|
-
var d = getOwnPropertyDescriptor(o,
|
28
|
+
var d = getOwnPropertyDescriptor(o, "c");
|
30
29
|
a(d.value, c, "Value");
|
31
30
|
a(d.get, undefined, "Get");
|
32
31
|
a(d.set, undefined, "Set");
|
@@ -34,7 +33,7 @@ module.exports = function (t, a) {
|
|
34
33
|
a(d.enumerable, false, "Enumerable");
|
35
34
|
a(d.writable, false, "Writable");
|
36
35
|
|
37
|
-
d = getOwnPropertyDescriptor(o,
|
36
|
+
d = getOwnPropertyDescriptor(o, "cgs");
|
38
37
|
a(d.value, undefined, "GS Value");
|
39
38
|
a(d.get, cg, "GS Get");
|
40
39
|
a(d.set, cs, "GS Set");
|
@@ -43,7 +42,7 @@ module.exports = function (t, a) {
|
|
43
42
|
a(d.writable, undefined, "GS Writable");
|
44
43
|
},
|
45
44
|
ce: function (a) {
|
46
|
-
var d = getOwnPropertyDescriptor(o,
|
45
|
+
var d = getOwnPropertyDescriptor(o, "ce");
|
47
46
|
a(d.value, ce, "Value");
|
48
47
|
a(d.get, undefined, "Get");
|
49
48
|
a(d.set, undefined, "Set");
|
@@ -51,7 +50,7 @@ module.exports = function (t, a) {
|
|
51
50
|
a(d.enumerable, true, "Enumerable");
|
52
51
|
a(d.writable, false, "Writable");
|
53
52
|
|
54
|
-
d = getOwnPropertyDescriptor(o,
|
53
|
+
d = getOwnPropertyDescriptor(o, "cegs");
|
55
54
|
a(d.value, undefined, "GS Value");
|
56
55
|
a(d.get, ceg, "GS Get");
|
57
56
|
a(d.set, ces, "GS Set");
|
@@ -60,7 +59,7 @@ module.exports = function (t, a) {
|
|
60
59
|
a(d.writable, undefined, "GS Writable");
|
61
60
|
},
|
62
61
|
cew: function (a) {
|
63
|
-
var d = getOwnPropertyDescriptor(o,
|
62
|
+
var d = getOwnPropertyDescriptor(o, "cew");
|
64
63
|
a(d.value, cew, "Value");
|
65
64
|
a(d.get, undefined, "Get");
|
66
65
|
a(d.set, undefined, "Set");
|
@@ -69,7 +68,7 @@ module.exports = function (t, a) {
|
|
69
68
|
a(d.writable, true, "Writable");
|
70
69
|
},
|
71
70
|
cw: function (a) {
|
72
|
-
var d = getOwnPropertyDescriptor(o,
|
71
|
+
var d = getOwnPropertyDescriptor(o, "cw");
|
73
72
|
a(d.value, cw, "Value");
|
74
73
|
a(d.get, undefined, "Get");
|
75
74
|
a(d.set, undefined, "Set");
|
@@ -78,7 +77,7 @@ module.exports = function (t, a) {
|
|
78
77
|
a(d.writable, true, "Writable");
|
79
78
|
},
|
80
79
|
e: function (a) {
|
81
|
-
var d = getOwnPropertyDescriptor(o,
|
80
|
+
var d = getOwnPropertyDescriptor(o, "e");
|
82
81
|
a(d.value, e, "Value");
|
83
82
|
a(d.get, undefined, "Get");
|
84
83
|
a(d.set, undefined, "Set");
|
@@ -86,7 +85,7 @@ module.exports = function (t, a) {
|
|
86
85
|
a(d.enumerable, true, "Enumerable");
|
87
86
|
a(d.writable, false, "Writable");
|
88
87
|
|
89
|
-
d = getOwnPropertyDescriptor(o,
|
88
|
+
d = getOwnPropertyDescriptor(o, "egs");
|
90
89
|
a(d.value, undefined, "GS Value");
|
91
90
|
a(d.get, eg, "GS Get");
|
92
91
|
a(d.set, es, "GS Set");
|
@@ -95,7 +94,7 @@ module.exports = function (t, a) {
|
|
95
94
|
a(d.writable, undefined, "GS Writable");
|
96
95
|
},
|
97
96
|
ew: function (a) {
|
98
|
-
var d = getOwnPropertyDescriptor(o,
|
97
|
+
var d = getOwnPropertyDescriptor(o, "ew");
|
99
98
|
a(d.value, ew, "Value");
|
100
99
|
a(d.get, undefined, "Get");
|
101
100
|
a(d.set, undefined, "Set");
|
@@ -104,7 +103,7 @@ module.exports = function (t, a) {
|
|
104
103
|
a(d.writable, true, "Writable");
|
105
104
|
},
|
106
105
|
v: function (a) {
|
107
|
-
var d = getOwnPropertyDescriptor(o,
|
106
|
+
var d = getOwnPropertyDescriptor(o, "v");
|
108
107
|
a(d.value, v, "Value");
|
109
108
|
a(d.get, undefined, "Get");
|
110
109
|
a(d.set, undefined, "Set");
|
@@ -112,7 +111,7 @@ module.exports = function (t, a) {
|
|
112
111
|
a(d.enumerable, false, "Enumerable");
|
113
112
|
a(d.writable, false, "Writable");
|
114
113
|
|
115
|
-
d = getOwnPropertyDescriptor(o,
|
114
|
+
d = getOwnPropertyDescriptor(o, "vgs");
|
116
115
|
a(d.value, undefined, "GS Value");
|
117
116
|
a(d.get, vg, "GS Get");
|
118
117
|
a(d.set, vs, "GS Set");
|
@@ -121,7 +120,7 @@ module.exports = function (t, a) {
|
|
121
120
|
a(d.writable, undefined, "GS Writable");
|
122
121
|
},
|
123
122
|
w: function (a) {
|
124
|
-
var d = getOwnPropertyDescriptor(o,
|
123
|
+
var d = getOwnPropertyDescriptor(o, "w");
|
125
124
|
a(d.value, w, "Value");
|
126
125
|
a(d.get, undefined, "Get");
|
127
126
|
a(d.set, undefined, "Set");
|
@@ -130,7 +129,7 @@ module.exports = function (t, a) {
|
|
130
129
|
a(d.writable, true, "Writable");
|
131
130
|
},
|
132
131
|
d: function (a) {
|
133
|
-
var d = getOwnPropertyDescriptor(o,
|
132
|
+
var d = getOwnPropertyDescriptor(o, "df");
|
134
133
|
a(d.value, df, "Value");
|
135
134
|
a(d.get, undefined, "Get");
|
136
135
|
a(d.set, undefined, "Set");
|
@@ -138,7 +137,7 @@ module.exports = function (t, a) {
|
|
138
137
|
a(d.enumerable, false, "Enumerable");
|
139
138
|
a(d.writable, true, "Writable");
|
140
139
|
|
141
|
-
d = getOwnPropertyDescriptor(o,
|
140
|
+
d = getOwnPropertyDescriptor(o, "dfgs");
|
142
141
|
a(d.value, undefined, "GS Value");
|
143
142
|
a(d.get, dfg, "GS Get");
|
144
143
|
a(d.set, dfs, "GS Set");
|
@@ -149,33 +148,61 @@ module.exports = function (t, a) {
|
|
149
148
|
Options: {
|
150
149
|
v: function (a) {
|
151
150
|
var x = {}, d = t(x, { foo: true });
|
152
|
-
a.deep(
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
151
|
+
a.deep(
|
152
|
+
d,
|
153
|
+
{ configurable: true, enumerable: false, writable: true, value: x, foo: true },
|
154
|
+
"No descriptor"
|
155
|
+
);
|
156
|
+
d = t("c", "foo", { marko: "elo" });
|
157
|
+
a.deep(
|
158
|
+
d,
|
159
|
+
{
|
160
|
+
configurable: true,
|
161
|
+
enumerable: false,
|
162
|
+
writable: false,
|
163
|
+
value: "foo",
|
164
|
+
marko: "elo"
|
165
|
+
},
|
166
|
+
"Descriptor"
|
167
|
+
);
|
157
168
|
},
|
158
169
|
gs: function (a) {
|
159
170
|
var gFn = function () {}, sFn = function () {}, d;
|
160
171
|
d = t.gs(gFn, sFn, { foo: true });
|
161
|
-
a.deep(
|
162
|
-
foo: true },
|
172
|
+
a.deep(
|
173
|
+
d, { configurable: true, enumerable: false, get: gFn, set: sFn, foo: true },
|
174
|
+
"No descriptor"
|
175
|
+
);
|
163
176
|
d = t.gs(null, sFn, { foo: true });
|
164
|
-
a.deep(
|
165
|
-
|
177
|
+
a.deep(
|
178
|
+
d,
|
179
|
+
{ configurable: true, enumerable: false, get: undefined, set: sFn, foo: true },
|
180
|
+
"No descriptor: Just set"
|
181
|
+
);
|
166
182
|
d = t.gs(gFn, { foo: true });
|
167
|
-
a.deep(
|
168
|
-
|
183
|
+
a.deep(
|
184
|
+
d,
|
185
|
+
{ configurable: true, enumerable: false, get: gFn, set: undefined, foo: true },
|
186
|
+
"No descriptor: Just get"
|
187
|
+
);
|
169
188
|
|
170
|
-
d = t.gs(
|
171
|
-
a.deep(
|
172
|
-
bar: true },
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
189
|
+
d = t.gs("e", gFn, sFn, { bar: true });
|
190
|
+
a.deep(
|
191
|
+
d, { configurable: false, enumerable: true, get: gFn, set: sFn, bar: true },
|
192
|
+
"Descriptor"
|
193
|
+
);
|
194
|
+
d = t.gs("e", null, sFn, { bar: true });
|
195
|
+
a.deep(
|
196
|
+
d,
|
197
|
+
{ configurable: false, enumerable: true, get: undefined, set: sFn, bar: true },
|
198
|
+
"Descriptor: Just set"
|
199
|
+
);
|
200
|
+
d = t.gs("e", gFn, { bar: true });
|
201
|
+
a.deep(
|
202
|
+
d,
|
203
|
+
{ configurable: false, enumerable: true, get: gFn, set: undefined, bar: true },
|
204
|
+
"Descriptor: Just get"
|
205
|
+
);
|
179
206
|
}
|
180
207
|
}
|
181
208
|
};
|
data/node_modules/d/test/lazy.js
CHANGED
@@ -1,79 +1,94 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
var d = require('../')
|
1
|
+
"use strict";
|
4
2
|
|
3
|
+
var d = require("../")
|
5
4
|
, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
6
5
|
|
7
6
|
module.exports = function (t, a) {
|
8
7
|
var Foo = function () {}, i = 1, o, o2, desc;
|
9
|
-
Object.defineProperties(
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
{
|
16
|
-
|
8
|
+
Object.defineProperties(
|
9
|
+
Foo.prototype,
|
10
|
+
t({
|
11
|
+
bar: d(function () { return ++i; }),
|
12
|
+
bar2: d(function () { return this.bar + 23; }),
|
13
|
+
bar3: d(function () { return this.bar2 + 34; }, { desc: "ew" }),
|
14
|
+
bar4: d(function () { return this.bar3 + 12; }, { cacheName: "_bar4_" }),
|
15
|
+
bar5: d(function () { return this.bar4 + 3; }, { cacheName: "_bar5_", desc: "e" })
|
16
|
+
})
|
17
|
+
);
|
17
18
|
|
18
|
-
desc = getOwnPropertyDescriptor(Foo.prototype,
|
19
|
+
desc = getOwnPropertyDescriptor(Foo.prototype, "bar");
|
19
20
|
a(desc.configurable, true, "Configurable: default");
|
20
21
|
a(desc.enumerable, false, "Enumerable: default");
|
21
22
|
|
22
23
|
o = new Foo();
|
23
|
-
a.deep([o.bar, o.bar2, o.bar3, o.bar4, o.bar5], [2, 25, 59, 71, 74],
|
24
|
-
"Values");
|
24
|
+
a.deep([o.bar, o.bar2, o.bar3, o.bar4, o.bar5], [2, 25, 59, 71, 74], "Values");
|
25
25
|
|
26
|
-
a.deep(
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
a.
|
31
|
-
|
26
|
+
a.deep(
|
27
|
+
getOwnPropertyDescriptor(o, "bar3"),
|
28
|
+
{ configurable: false, enumerable: true, writable: true, value: 59 }, "Desc"
|
29
|
+
);
|
30
|
+
a(o.hasOwnProperty("bar4"), false, "Cache not exposed");
|
31
|
+
desc = getOwnPropertyDescriptor(o, "bar5");
|
32
|
+
a.deep(
|
33
|
+
desc, { configurable: false, enumerable: true, get: desc.get, set: desc.set },
|
34
|
+
"Cache & Desc: desc"
|
35
|
+
);
|
32
36
|
|
33
37
|
o2 = Object.create(o);
|
34
38
|
o2.bar = 30;
|
35
39
|
o2.bar3 = 100;
|
36
40
|
|
37
|
-
a.deep(
|
38
|
-
"Extension Values"
|
41
|
+
a.deep(
|
42
|
+
[o2.bar, o2.bar2, o2.bar3, o2.bar4, o2.bar5], [30, 25, 100, 112, 115], "Extension Values"
|
43
|
+
);
|
39
44
|
|
40
45
|
Foo = function () {};
|
41
|
-
Object.defineProperties(
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
{
|
46
|
-
|
47
|
-
|
46
|
+
Object.defineProperties(
|
47
|
+
Foo.prototype,
|
48
|
+
t({
|
49
|
+
test: d("w", function () { return "raz"; }),
|
50
|
+
test2: d("", function () { return "raz"; }, { desc: "w" }),
|
51
|
+
test3: d("", function () { return "raz"; }, { cacheName: "__test3__", desc: "w" }),
|
52
|
+
test4: d("w", "bar")
|
53
|
+
})
|
54
|
+
);
|
48
55
|
|
49
56
|
o = new Foo();
|
50
|
-
o.test =
|
51
|
-
a.deep(
|
52
|
-
|
53
|
-
"Set before get"
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
a(
|
57
|
+
o.test = "marko";
|
58
|
+
a.deep(
|
59
|
+
getOwnPropertyDescriptor(o, "test"),
|
60
|
+
{ configurable: false, enumerable: false, writable: true, value: "marko" }, "Set before get"
|
61
|
+
);
|
62
|
+
o.test2 = "marko2";
|
63
|
+
a.deep(
|
64
|
+
getOwnPropertyDescriptor(o, "test2"),
|
65
|
+
{ configurable: false, enumerable: false, writable: true, value: "marko2" },
|
66
|
+
"Set before get: Custom desc"
|
67
|
+
);
|
68
|
+
o.test3 = "marko3";
|
69
|
+
a.deep(
|
70
|
+
getOwnPropertyDescriptor(o, "__test3__"),
|
71
|
+
{ configurable: false, enumerable: false, writable: true, value: "marko3" },
|
72
|
+
"Set before get: Custom cache name"
|
73
|
+
);
|
74
|
+
a(o.test4, "bar", "Resolve by value");
|
63
75
|
|
64
76
|
a.h1("Flat");
|
65
|
-
Object.defineProperties(
|
66
|
-
|
67
|
-
|
68
|
-
|
77
|
+
Object.defineProperties(
|
78
|
+
Foo.prototype,
|
79
|
+
t({
|
80
|
+
flat: d(function () { return "foo"; }, { flat: true }),
|
81
|
+
flat2: d(function () { return "bar"; }, { flat: true })
|
82
|
+
})
|
83
|
+
);
|
69
84
|
|
70
85
|
a.h2("Instance");
|
71
|
-
a(o.flat,
|
72
|
-
a(o.hasOwnProperty(
|
73
|
-
a(Foo.prototype.flat,
|
86
|
+
a(o.flat, "foo", "Value");
|
87
|
+
a(o.hasOwnProperty("flat"), false, "Instance");
|
88
|
+
a(Foo.prototype.flat, "foo", "Prototype");
|
74
89
|
|
75
90
|
a.h2("Direct");
|
76
|
-
a(Foo.prototype.flat2,
|
91
|
+
a(Foo.prototype.flat2, "bar");
|
77
92
|
|
78
93
|
a.h2("Reset direct");
|
79
94
|
Object.defineProperties(Foo.prototype, t({ testResetDirect: d(false) }));
|