govuk_publishing_components 17.7.0 → 17.8.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 +3 -24
- data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +6 -18
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +35 -45
- data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +0 -4
- data/lib/govuk_publishing_components.rb +0 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/accessible-autocomplete/package.json +1 -1
- data/node_modules/define-properties/package.json +2 -1
- data/node_modules/function-bind/package.json +2 -1
- data/node_modules/has-symbols/package.json +2 -1
- data/node_modules/jsx-ast-utils/CHANGELOG.md +16 -0
- data/node_modules/jsx-ast-utils/__tests__/helper.js +2 -0
- data/node_modules/jsx-ast-utils/__tests__/src/getPropLiteralValue-test.js +39 -3
- data/node_modules/jsx-ast-utils/__tests__/src/getPropValue-test.js +9 -4
- data/node_modules/jsx-ast-utils/lib/values/expressions/ObjectExpression.js +9 -2
- data/node_modules/jsx-ast-utils/lib/values/expressions/index.js +21 -6
- data/node_modules/jsx-ast-utils/lib/values/index.js +5 -1
- data/node_modules/jsx-ast-utils/package.json +35 -31
- data/node_modules/jsx-ast-utils/src/values/expressions/ObjectExpression.js +3 -1
- data/node_modules/jsx-ast-utils/src/values/expressions/index.js +12 -4
- data/node_modules/object-keys/package.json +2 -1
- data/node_modules/object.assign/CHANGELOG.md +179 -0
- data/node_modules/object.assign/LICENSE +21 -0
- data/node_modules/object.assign/README.md +135 -0
- data/node_modules/object.assign/auto.js +3 -0
- data/node_modules/object.assign/dist/browser.js +492 -0
- data/node_modules/object.assign/hasSymbols.js +41 -0
- data/node_modules/object.assign/implementation.js +41 -0
- data/node_modules/object.assign/index.js +17 -0
- data/node_modules/object.assign/package.json +148 -0
- data/node_modules/object.assign/polyfill.js +51 -0
- data/node_modules/object.assign/shim.js +14 -0
- data/node_modules/object.assign/test.sh +53 -0
- data/node_modules/object.assign/test/index.js +17 -0
- data/node_modules/object.assign/test/native.js +47 -0
- data/node_modules/object.assign/test/shimmed.js +50 -0
- data/node_modules/object.assign/test/tests.js +224 -0
- metadata +18 -3
- data/lib/govuk_publishing_components/presenters/cookie_banner_helper.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41295a866621f3e54259818f8895a0f862b7c0d6531b653fdc888c77081d4b99
|
4
|
+
data.tar.gz: 699bb29b66ac166b9d01b1b6d99fb7200789003ea24c4669c908c64acfd88f39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b12605c7b190ccb2e35a1a495cc890ac8ab70c86b688bf879f38831858e59d51f7b248ed3fd37079271f71894da0ae888439e8f987526b30b898505ee96437ea
|
7
|
+
data.tar.gz: 82e55616e941f2aa976354ef0a4bbdbf042c89f4f220994fda42e93b451ee52dc659cebdb1731c631f7e52d9dc519703d595c51932c739bbab3681dce2919980
|
@@ -10,29 +10,16 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
10
10
|
this.$module.showConfirmationMessage = this.showConfirmationMessage.bind(this)
|
11
11
|
this.$module.setCookieConsent = this.setCookieConsent.bind(this)
|
12
12
|
|
13
|
-
this.$module.newCookieBanner = document.
|
13
|
+
this.$module.newCookieBanner = document.querySelectorAll('.gem-c-cookie-banner--new, .gem-c-cookie-banner')
|
14
14
|
this.$module.cookieBannerConfirmationMessage = document.querySelector('.gem-c-cookie-banner__confirmation')
|
15
15
|
|
16
16
|
// Temporary check while we have 2 banners co-existing.
|
17
17
|
// Once the new banner has been deployed, we will be able to remove code relating to the old banner
|
18
18
|
// Separating the code out like this does mean some repetition, but will make it easier to remove later
|
19
|
-
|
20
|
-
this.setupNewCookieMessage()
|
21
|
-
} else {
|
22
|
-
this.setupCookieMessage()
|
23
|
-
}
|
19
|
+
this.setupCookieMessage()
|
24
20
|
}
|
25
21
|
|
26
22
|
CookieBanner.prototype.setupCookieMessage = function () {
|
27
|
-
this.$hideLink = this.$module.querySelector('a[data-hide-cookie-banner]')
|
28
|
-
if (this.$hideLink) {
|
29
|
-
this.$hideLink.addEventListener('click', this.$module.hideCookieMessage)
|
30
|
-
}
|
31
|
-
|
32
|
-
this.showCookieMessage()
|
33
|
-
}
|
34
|
-
|
35
|
-
CookieBanner.prototype.setupNewCookieMessage = function () {
|
36
23
|
this.$hideLink = this.$module.querySelector('button[data-hide-cookie-banner]')
|
37
24
|
if (this.$hideLink) {
|
38
25
|
this.$hideLink.addEventListener('click', this.$module.hideCookieMessage)
|
@@ -51,18 +38,10 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
51
38
|
}
|
52
39
|
}
|
53
40
|
|
54
|
-
this.
|
41
|
+
this.showCookieMessage()
|
55
42
|
}
|
56
43
|
|
57
44
|
CookieBanner.prototype.showCookieMessage = function () {
|
58
|
-
var shouldHaveCookieMessage = (this.$module && window.GOVUK.cookie('seen_cookie_message') !== 'true')
|
59
|
-
|
60
|
-
if (shouldHaveCookieMessage) {
|
61
|
-
this.$module.style.display = 'block'
|
62
|
-
}
|
63
|
-
}
|
64
|
-
|
65
|
-
CookieBanner.prototype.showNewCookieMessage = function () {
|
66
45
|
// Hide the cookie banner on the cookie settings page, to avoid circular journeys
|
67
46
|
if (this.$module.newCookieBanner && window.location.pathname === '/help/cookies') {
|
68
47
|
this.$module.style.display = 'none'
|
@@ -1,5 +1,4 @@
|
|
1
|
-
$govuk-cookie-banner-background:
|
2
|
-
$govuk-cookie-banner-background-new: govuk-colour("white");
|
1
|
+
$govuk-cookie-banner-background: govuk-colour("white");
|
3
2
|
$govuk-cookie-banner-text-green: #00823b;
|
4
3
|
|
5
4
|
.js-enabled {
|
@@ -13,19 +12,7 @@ $govuk-cookie-banner-text-green: #00823b;
|
|
13
12
|
@include govuk-font($size: 16);
|
14
13
|
padding: govuk-spacing(2) 0;
|
15
14
|
background-color: $govuk-cookie-banner-background;
|
16
|
-
|
17
|
-
|
18
|
-
.gem-c-cookie-banner__message {
|
19
|
-
margin-top: 0;
|
20
|
-
margin-bottom: 0;
|
21
|
-
}
|
22
|
-
|
23
|
-
.gem-c-cookie-banner__hide-link {
|
24
|
-
display: none;
|
25
|
-
|
26
|
-
.js-enabled & {
|
27
|
-
display: inline-block;
|
28
|
-
}
|
15
|
+
border: 2px solid govuk-colour("black");
|
29
16
|
}
|
30
17
|
|
31
18
|
// Styles for the new version of the cookie banner
|
@@ -34,7 +21,7 @@ $govuk-cookie-banner-text-green: #00823b;
|
|
34
21
|
border: 2px solid govuk-colour("black");
|
35
22
|
}
|
36
23
|
|
37
|
-
.gem-c-cookie-
|
24
|
+
.gem-c-cookie-banner__message {
|
38
25
|
display: inline-block;
|
39
26
|
margin-bottom: govuk-spacing(1);
|
40
27
|
padding-right: govuk-spacing(4);
|
@@ -134,8 +121,9 @@ $govuk-cookie-banner-text-green: #00823b;
|
|
134
121
|
// Override the styles from govuk_template
|
135
122
|
// scss-lint:disable IdSelector
|
136
123
|
// sass-lint:disable no-ids
|
137
|
-
.gem-c-cookie-banner--new#global-cookie-message
|
138
|
-
|
124
|
+
.gem-c-cookie-banner--new#global-cookie-message,
|
125
|
+
.gem-c-cookie-banner#global-cookie-message {
|
126
|
+
background-color: $govuk-cookie-banner-background;
|
139
127
|
padding: govuk-spacing(4) 0;
|
140
128
|
box-sizing: border-box;
|
141
129
|
|
@@ -1,55 +1,45 @@
|
|
1
1
|
<%
|
2
|
-
new_cookie_banner ||= false
|
3
2
|
id ||= 'global-cookie-message'
|
4
|
-
|
5
|
-
cookie_banner_class = new_cookie_banner ? "gem-c-cookie-banner--new" : "gem-c-cookie-banner"
|
6
|
-
|
7
|
-
cookie_banner_helper = GovukPublishingComponents::Presenters::CookieBannerHelper.new(local_assigns)
|
8
|
-
|
9
|
-
message = cookie_banner_helper.message
|
3
|
+
message ||= "GOV.UK uses cookies to make the site simpler."
|
10
4
|
%>
|
11
5
|
|
12
|
-
<div id="<%= id %>" class="
|
6
|
+
<div id="<%= id %>" class="gem-c-cookie-banner" data-module="cookie-banner" role="region" aria-label="cookie banner">
|
13
7
|
<div class="gem-c-cookie-banner__wrapper govuk-width-container">
|
14
8
|
<p class="gem-c-cookie-banner__message"><%= message %></p>
|
15
|
-
|
16
|
-
<div class="gem-c-cookie-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
} %>
|
42
|
-
</div>
|
9
|
+
<div class="gem-c-cookie-banner__buttons">
|
10
|
+
<div class="gem-c-cookie-banner__button gem-c-cookie-banner__button-accept">
|
11
|
+
<%= render "govuk_publishing_components/components/button", {
|
12
|
+
text: "Accept cookies",
|
13
|
+
secondary: true,
|
14
|
+
inline_layout: true,
|
15
|
+
data_attributes: {
|
16
|
+
module: "track-click",
|
17
|
+
"accept-cookies": "true",
|
18
|
+
"track-category": "cookieBanner",
|
19
|
+
"track-action": "Cookie banner accepted"
|
20
|
+
}
|
21
|
+
} %>
|
22
|
+
</div>
|
23
|
+
<div class="gem-c-cookie-banner__button gem-c-cookie-banner__button-settings">
|
24
|
+
<%= render "govuk_publishing_components/components/button", {
|
25
|
+
text: "Cookie settings",
|
26
|
+
href: "/help/cookies",
|
27
|
+
secondary: true,
|
28
|
+
inline_layout: true,
|
29
|
+
data_attributes: {
|
30
|
+
module: "track-click",
|
31
|
+
"track-category": "cookieBanner",
|
32
|
+
"track-action": "Cookie banner settings clicked"
|
33
|
+
}
|
34
|
+
} %>
|
43
35
|
</div>
|
44
|
-
|
36
|
+
</div>
|
45
37
|
</div>
|
46
38
|
|
47
|
-
|
48
|
-
<
|
49
|
-
<
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
</div>
|
54
|
-
<% end %>
|
39
|
+
<div class="gem-c-cookie-banner__confirmation govuk-width-container" tabindex="-1">
|
40
|
+
<p class="gem-c-cookie-banner__confirmation-message">
|
41
|
+
You’ve accepted all cookies. You can <a class="govuk-link" href="/help/cookies" data-module="track-click" data-track-category="cookieBanner" data-track-action="Cookie banner settings clicked from confirmation">change your cookie settings</a> at any time.
|
42
|
+
</p>
|
43
|
+
<button class="gem-c-cookie-banner__hide-button" data-hide-cookie-banner="true" data-module="track-click" data-track-category="cookieBanner" data-track-action="Hide cookie banner">Hide</button>
|
44
|
+
</div>
|
55
45
|
</div>
|
@@ -21,7 +21,3 @@ examples:
|
|
21
21
|
data:
|
22
22
|
id: custom-message
|
23
23
|
message: GOV.UK uses cookies to make the site simpler. <a class="govuk-link" href="/help/cookies">Find out more about cookies</a>
|
24
|
-
new_cookie_banner:
|
25
|
-
description: FOR TESTING PURPOSES ONLY. This is a new proposed iteration of the cookie banner. The current banner will remain the same across the live site for now.
|
26
|
-
data:
|
27
|
-
new_cookie_banner: true
|
@@ -26,7 +26,6 @@ require "govuk_publishing_components/presenters/image_card_helper"
|
|
26
26
|
require "govuk_publishing_components/presenters/organisation_logo_helper"
|
27
27
|
require "govuk_publishing_components/presenters/highlight_boxes_helper"
|
28
28
|
require "govuk_publishing_components/presenters/taxonomy_list_helper"
|
29
|
-
require "govuk_publishing_components/presenters/cookie_banner_helper"
|
30
29
|
|
31
30
|
require "govuk_publishing_components/app_helpers/taxon_breadcrumbs"
|
32
31
|
require "govuk_publishing_components/app_helpers/table_helper"
|
@@ -49,7 +49,7 @@
|
|
49
49
|
"/"
|
50
50
|
],
|
51
51
|
"_resolved": "git://github.com/alphagov/accessible-autocomplete.git#3523dd9fffc70cbd9f6f555f75863c33a709f49e",
|
52
|
-
"_shasum": "
|
52
|
+
"_shasum": "541747a32fce9d43242a06a4393c974da99ce3af",
|
53
53
|
"_shrinkwrap": null,
|
54
54
|
"_spec": "accessible-autocomplete@git://github.com/alphagov/accessible-autocomplete.git#add-multiselect-support",
|
55
55
|
"_where": "/var/lib/jenkins/workspace/ublishing_components_master-N4FWJIUY4CIFHKGZOAAEVVXODRY3YBORQOPIBBXWX72VUPSGJRRQ",
|
@@ -38,7 +38,8 @@
|
|
38
38
|
"type": "range"
|
39
39
|
},
|
40
40
|
"_requiredBy": [
|
41
|
-
"/array-includes"
|
41
|
+
"/array-includes",
|
42
|
+
"/object.assign"
|
42
43
|
],
|
43
44
|
"_resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
|
44
45
|
"_shasum": "cf88da6cbee26fe6db7094f61d870cbd84cee9f1",
|
@@ -1,3 +1,19 @@
|
|
1
|
+
2.2.0 / 2019-06-25
|
2
|
+
==================
|
3
|
+
- (fix) Fix getLiteralPropValue for TS-specific node types.
|
4
|
+
- (chore) upgrade dependencies.
|
5
|
+
- (improvement) Stop throwing errors when unknown AST nodes are encountered.
|
6
|
+
- (dev) CI changes.
|
7
|
+
|
8
|
+
2.1.0 / 2018-04-19
|
9
|
+
==================
|
10
|
+
- Fix undefined bug for template strings. #45
|
11
|
+
- Adding support for `objectRestSpread` within props #60
|
12
|
+
- Accommodate ExperimentalSpreadProperty in prop values #75
|
13
|
+
- Account for SpreadElement AST Nodes #76
|
14
|
+
- Support OptionalMemberExpression AST nodes #77
|
15
|
+
- Add support to Typescript's node types #72
|
16
|
+
|
1
17
|
2.0.1 / 2017-08-31
|
2
18
|
==================
|
3
19
|
- [fix] Add support for BindExpression
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/* eslint-env mocha */
|
2
2
|
/* eslint no-template-curly-in-string: 0 */
|
3
3
|
import assert from 'assert';
|
4
|
-
import { extractProp } from '../helper';
|
4
|
+
import { extractProp, describeIfNotBabylon, changePlugins } from '../helper';
|
5
5
|
import { getLiteralPropValue } from '../../src/getPropValue';
|
6
6
|
|
7
7
|
describe('getLiteralPropValue', () => {
|
@@ -19,7 +19,7 @@ describe('getLiteralPropValue', () => {
|
|
19
19
|
assert.equal(expected, actual);
|
20
20
|
});
|
21
21
|
|
22
|
-
it('should throw error when trying to get value from unknown node type', () => {
|
22
|
+
it('should not throw error when trying to get value from unknown node type', () => {
|
23
23
|
const prop = {
|
24
24
|
type: 'JSXAttribute',
|
25
25
|
value: {
|
@@ -27,9 +27,11 @@ describe('getLiteralPropValue', () => {
|
|
27
27
|
},
|
28
28
|
};
|
29
29
|
|
30
|
-
assert.
|
30
|
+
assert.doesNotThrow(() => {
|
31
31
|
getLiteralPropValue(prop);
|
32
32
|
}, Error);
|
33
|
+
|
34
|
+
assert.equal(null, getLiteralPropValue(prop));
|
33
35
|
});
|
34
36
|
|
35
37
|
describe('Null', () => {
|
@@ -465,4 +467,38 @@ describe('getLiteralPropValue', () => {
|
|
465
467
|
assert.deepEqual(expected, actual);
|
466
468
|
});
|
467
469
|
});
|
470
|
+
|
471
|
+
describeIfNotBabylon('Typescript', () => {
|
472
|
+
beforeEach(() => {
|
473
|
+
changePlugins(pls => [...pls, 'typescript']);
|
474
|
+
});
|
475
|
+
|
476
|
+
it('should return string representation of variable identifier wrapped in a Typescript non-null assertion', () => {
|
477
|
+
const prop = extractProp('<div foo={bar!} />');
|
478
|
+
|
479
|
+
const expected = null;
|
480
|
+
const actual = getLiteralPropValue(prop);
|
481
|
+
|
482
|
+
assert.equal(expected, actual);
|
483
|
+
});
|
484
|
+
|
485
|
+
it('should return string representation of variable identifier wrapped in a deep Typescript non-null assertion', () => {
|
486
|
+
const prop = extractProp('<div foo={(bar!)!} />');
|
487
|
+
|
488
|
+
const expected = null;
|
489
|
+
const actual = getLiteralPropValue(prop);
|
490
|
+
|
491
|
+
assert.equal(expected, actual);
|
492
|
+
});
|
493
|
+
|
494
|
+
it('should return string representation of variable identifier wrapped in a Typescript type coercion', () => {
|
495
|
+
changePlugins(pls => [...pls, 'typescript']);
|
496
|
+
const prop = extractProp('<div foo={bar as any} />');
|
497
|
+
|
498
|
+
const expected = null;
|
499
|
+
const actual = getLiteralPropValue(prop);
|
500
|
+
|
501
|
+
assert.equal(expected, actual);
|
502
|
+
});
|
503
|
+
});
|
468
504
|
});
|
@@ -1,11 +1,14 @@
|
|
1
1
|
/* eslint-env mocha */
|
2
2
|
/* eslint no-template-curly-in-string: 0 */
|
3
3
|
import assert from 'assert';
|
4
|
-
import {
|
4
|
+
import {
|
5
|
+
extractProp,
|
6
|
+
changePlugins,
|
7
|
+
fallbackToBabylon,
|
8
|
+
describeIfNotBabylon,
|
9
|
+
} from '../helper';
|
5
10
|
import getPropValue from '../../src/getPropValue';
|
6
11
|
|
7
|
-
const describeIfNotBabylon = fallbackToBabylon ? describe.skip : describe;
|
8
|
-
|
9
12
|
describe('getPropValue', () => {
|
10
13
|
it('should export a function', () => {
|
11
14
|
const expected = 'function';
|
@@ -29,9 +32,11 @@ describe('getPropValue', () => {
|
|
29
32
|
},
|
30
33
|
};
|
31
34
|
|
32
|
-
assert.
|
35
|
+
assert.doesNotThrow(() => {
|
33
36
|
getPropValue(prop);
|
34
37
|
}, Error);
|
38
|
+
|
39
|
+
assert.equal(null, getPropValue(prop));
|
35
40
|
});
|
36
41
|
|
37
42
|
describe('Null', () => {
|
@@ -4,6 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = extractValueFromObjectExpression;
|
7
|
+
|
8
|
+
var _object = require('object.assign');
|
9
|
+
|
10
|
+
var _object2 = _interopRequireDefault(_object);
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
7
14
|
/**
|
8
15
|
* Extractor function for an ObjectExpression type value node.
|
9
16
|
* An object expression is using {}.
|
@@ -14,11 +21,11 @@ function extractValueFromObjectExpression(value) {
|
|
14
21
|
// eslint-disable-next-line global-require
|
15
22
|
var getValue = require('./index.js').default;
|
16
23
|
return value.properties.reduce(function (obj, property) {
|
17
|
-
var object =
|
24
|
+
var object = (0, _object2.default)({}, obj);
|
18
25
|
// Support types: SpreadProperty and ExperimentalSpreadProperty
|
19
26
|
if (/^(?:Experimental)?Spread(?:Property|Element)$/.test(property.type)) {
|
20
27
|
if (property.argument.type === 'ObjectExpression') {
|
21
|
-
return
|
28
|
+
return (0, _object2.default)(object, extractValueFromObjectExpression(property.argument));
|
22
29
|
}
|
23
30
|
} else {
|
24
31
|
object[getValue(property.key)] = getValue(property.value);
|
@@ -6,6 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.default = extract;
|
7
7
|
exports.extractLiteral = extractLiteral;
|
8
8
|
|
9
|
+
var _object = require('object.assign');
|
10
|
+
|
11
|
+
var _object2 = _interopRequireDefault(_object);
|
12
|
+
|
9
13
|
var _Literal = require('../Literal');
|
10
14
|
|
11
15
|
var _Literal2 = _interopRequireDefault(_Literal);
|
@@ -145,19 +149,26 @@ function extract(value) {
|
|
145
149
|
|
146
150
|
|
147
151
|
while (type === 'TSNonNullExpression' || type === 'TSAsExpression') {
|
148
|
-
|
149
|
-
type =
|
152
|
+
var _expression2 = expression;
|
153
|
+
type = _expression2.type;
|
154
|
+
|
155
|
+
if (expression.expression) {
|
156
|
+
var _expression3 = expression;
|
157
|
+
expression = _expression3.expression;
|
158
|
+
}
|
150
159
|
}
|
151
160
|
|
152
161
|
if (TYPES[type] === undefined) {
|
153
|
-
|
162
|
+
// eslint-disable-next-line no-console
|
163
|
+
console.error(errorMessage(type));
|
164
|
+
return null;
|
154
165
|
}
|
155
166
|
|
156
167
|
return TYPES[type](expression);
|
157
168
|
}
|
158
169
|
|
159
170
|
// Composition map of types to their extractor functions to handle literals.
|
160
|
-
var LITERAL_TYPES =
|
171
|
+
var LITERAL_TYPES = (0, _object2.default)({}, TYPES, {
|
161
172
|
Literal: function Literal(value) {
|
162
173
|
var extractedVal = TYPES.Literal.call(undefined, value);
|
163
174
|
var isNull = extractedVal === null;
|
@@ -196,7 +207,9 @@ var LITERAL_TYPES = Object.assign({}, TYPES, {
|
|
196
207
|
});
|
197
208
|
},
|
198
209
|
BindExpression: noop,
|
199
|
-
SpreadElement: noop
|
210
|
+
SpreadElement: noop,
|
211
|
+
TSNonNullExpression: noop,
|
212
|
+
TSAsExpression: noop
|
200
213
|
});
|
201
214
|
|
202
215
|
/**
|
@@ -216,7 +229,9 @@ function extractLiteral(value) {
|
|
216
229
|
|
217
230
|
|
218
231
|
if (LITERAL_TYPES[type] === undefined) {
|
219
|
-
|
232
|
+
// eslint-disable-next-line no-console
|
233
|
+
console.error(errorMessage(type));
|
234
|
+
return null;
|
220
235
|
}
|
221
236
|
|
222
237
|
return LITERAL_TYPES[type](expression);
|