efront 3.23.0 → 3.24.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/apps/kugou/main.js +1 -3
  2. package/coms/basic/BigNumber.js +28 -5
  3. package/coms/basic/BigNumber_test.js +14 -1
  4. package/coms/basic/[]map.js +18 -13
  5. package/coms/basic/assert.js +10 -2
  6. package/coms/basic/extends_.js +13 -0
  7. package/coms/basic/loader.js +47 -28
  8. package/coms/basic/mark.js +155 -0
  9. package/coms/basic/queue.js +11 -14
  10. package/coms/basic/rest_.js +27 -0
  11. package/coms/basic/submit_.js +3 -1
  12. package/{apps → coms}/kugou/api.js +2 -0
  13. package/coms/kugou/buildList.js +7 -1
  14. package/coms/kugou/parseSongsList.js +1 -1
  15. package/coms/kugou/player.js +4 -2
  16. package/coms/kugou/song.html +1 -1
  17. package/coms/kugou/song.js +1 -0
  18. package/coms/kugou/song.less +12 -4
  19. package/coms/zimoli/Promise.js +84 -133
  20. package/coms/zimoli/appendChild.js +4 -14
  21. package/coms/zimoli/cless.js +11 -5
  22. package/coms/zimoli/color.js +0 -1
  23. package/coms/zimoli/compile.js +64 -1
  24. package/coms/{compile → zimoli}/compile_test.js +0 -0
  25. package/coms/zimoli/cross.js +1 -1
  26. package/coms/zimoli/data.js +14 -4
  27. package/coms/zimoli/dispatch.js +1 -1
  28. package/coms/zimoli/input.js +6 -4
  29. package/coms/zimoli/on.js +64 -47
  30. package/coms/zimoli/remove.js +0 -9
  31. package/coms/zimoli/render.js +2 -2
  32. package/coms/zimoli/zimoli.js +2 -2
  33. package/package.json +1 -1
  34. package/public/efront.js +1 -1
  35. package/apps/zimoli/book/main.js +0 -8
  36. package/apps/zimoli/broadcast/main.js +0 -8
  37. package/apps/zimoli/collection/add.html +0 -13
  38. package/apps/zimoli/collection/add.js +0 -14
  39. package/apps/zimoli/collection/add.less +0 -0
  40. package/apps/zimoli/collection/main.html +0 -0
  41. package/apps/zimoli/collection/main.js +0 -13
  42. package/apps/zimoli/collection/main.less +0 -8
  43. package/apps/zimoli/config.js +0 -14
  44. package/apps/zimoli/extra/pending.html +0 -1
  45. package/apps/zimoli/extra/pending.js +0 -8
  46. package/apps/zimoli/extra/pending.less +0 -15
  47. package/apps/zimoli/files/info.js +0 -7
  48. package/apps/zimoli/files/main.js +0 -108
  49. package/apps/zimoli/files/main.less +0 -26
  50. package/apps/zimoli/images/avatar.png +0 -0
  51. package/apps/zimoli/images/background.jpg +0 -0
  52. package/apps/zimoli/index.html +0 -42
  53. package/apps/zimoli/kugou/font/demo.css +0 -539
  54. package/apps/zimoli/kugou/font/demo_index.html +0 -1159
  55. package/apps/zimoli/kugou/font/iconfont.css +0 -189
  56. package/apps/zimoli/kugou/font/iconfont.eot +0 -0
  57. package/apps/zimoli/kugou/font/iconfont.js +0 -1
  58. package/apps/zimoli/kugou/font/iconfont.svg +0 -155
  59. package/apps/zimoli/kugou/font/iconfont.ttf +0 -0
  60. package/apps/zimoli/kugou/font/iconfont.woff +0 -0
  61. package/apps/zimoli/kugou/font/iconfont.woff2 +0 -0
  62. package/apps/zimoli/kugou/listen.html +0 -15
  63. package/apps/zimoli/kugou/listen.js +0 -37
  64. package/apps/zimoli/kugou/listen.less +0 -114
  65. package/apps/zimoli/kugou/mine.html +0 -53
  66. package/apps/zimoli/kugou/mine.js +0 -21
  67. package/apps/zimoli/kugou/mine.less +0 -106
  68. package/apps/zimoli/kugou/search.js +0 -109
  69. package/apps/zimoli/kugou/search.less +0 -50
  70. package/apps/zimoli/kugou/sing.js +0 -42
  71. package/apps/zimoli/kugou/sing.less +0 -93
  72. package/apps/zimoli/kugou/view.html +0 -39
  73. package/apps/zimoli/kugou/view.js +0 -17
  74. package/apps/zimoli/kugou/view.less +0 -84
  75. package/apps/zimoli/login/qq.js +0 -20
  76. package/apps/zimoli/login/qq_callback.html +0 -15
  77. package/apps/zimoli/main.js +0 -87
  78. package/apps/zimoli/main.less +0 -81
  79. package/apps/zimoli/message/chatList.js +0 -57
  80. package/apps/zimoli/message/chatList.less +0 -52
  81. package/apps/zimoli/message/commentList.js +0 -55
  82. package/apps/zimoli/message/commentList.less +0 -55
  83. package/apps/zimoli/message/informList.js +0 -69
  84. package/apps/zimoli/message/informList.less +0 -51
  85. package/apps/zimoli/message/main.js +0 -59
  86. package/apps/zimoli/message/main.less +0 -51
  87. package/apps/zimoli/message/praiseList.js +0 -3
  88. package/apps/zimoli/message/praiseList.less +0 -7
  89. package/apps/zimoli/nearby/main.js +0 -8
  90. package/apps/zimoli/skin/main.js +0 -47
  91. package/apps/zimoli/skin/main.less +0 -31
  92. package/apps/zimoli/user/getPassword.js +0 -82
  93. package/apps/zimoli/user/getPassword.less +0 -14
  94. package/apps/zimoli/user/login.html +0 -12
  95. package/apps/zimoli/user/login.js +0 -50
  96. package/apps/zimoli/user/login.less +0 -139
  97. package/apps/zimoli/user/profile-bg.jpg +0 -0
  98. package/apps/zimoli/user/profile.html +0 -32
  99. package/apps/zimoli/user/profile.js +0 -63
  100. package/apps/zimoli/user/profile.less +0 -50
  101. package/apps/zimoli/user/register.js +0 -20
  102. package/apps/zimoli/user/register.less +0 -3
  103. package/apps/zimoli/user/setting.js +0 -90
  104. package/apps/zimoli/user/setting.less +0 -11
  105. package/apps/zimoli/user/welcome.js +0 -36
  106. package/apps/zimoli/user/welcome.less +0 -136
  107. package/apps/zimoli/watch/main.html +0 -22
  108. package/apps/zimoli/watch/main.js +0 -76
  109. package/apps/zimoli/watch/main.less +0 -54
  110. package/apps/zimoli/yuanfen/main.js +0 -55
  111. package/apps/zimoli/yuanfen/main.json +0 -0
  112. package/coms/compile/breakcode.js +0 -78
  113. package/coms/compile/common.js +0 -683
  114. package/coms/compile/compile.js +0 -64
  115. package/coms/compile/keywords.js +0 -6
  116. package/coms/compile/namelist.js +0 -142
  117. package/coms/compile/namelist_test.js +0 -7
  118. package/coms/compile/required.js +0 -20
  119. package/coms/compile/scanner.js +0 -653
  120. package/coms/compile/scanner2.js +0 -909
  121. package/coms/compile/scanner2_test.js +0 -85
  122. package/coms/compile/scanner_test.js +0 -10
  123. package/coms/compile/washcode.js +0 -313
  124. package/coms/zimoli/mark.js +0 -70
@@ -1,90 +0,0 @@
1
- titlebar(i18n("设置", "Settings"));
2
- var page = createVboxWithState(state);
3
- var opt = function () {
4
- var elem = option.apply(null, arguments);
5
- elem.setAttribute("ng-click", "go('/extra/pending',this.innerText)");
6
- return elem;
7
- };
8
- var settings = extend({
9
- go,
10
- useHello: {
11
- name: i18n("Hello酷狗问候音", "Hello Kugou greetings"),
12
- value: true,
13
- },
14
- helloSrc: {
15
- name: i18n("选择问候音", "Choose greeting voice "),
16
- value: ""
17
- },
18
- autoDownloadAvatar: {
19
- name: i18n("自动下载写真/封面", "Auto download photo/cover"),
20
- value: true,
21
- },
22
- autoRotateAvatar: {
23
- name: i18n("头像/封面自动旋转", "Automatic rotation of head/cover"),
24
- value: true,
25
- },
26
- autoSave: {
27
- name: i18n("边听边存", "Listen and save"),
28
- value: false
29
- },
30
- shakeSwitch: {
31
- name: i18n("摇一摇切歌", "Shake to switch songs"),
32
- value: false
33
- },
34
- costTips: {
35
- name: i18n("流量消耗提醒", "Flow consumption reminder"),
36
- value: false
37
- },
38
- carLrc: {
39
- name: i18n("车载歌词", "Vehicle lyrics"),
40
- value: false
41
- }
42
- }, state());
43
- var createSwitchOption = function (name, modelName) {
44
- var _model = Switch();
45
- var option = field(name, _model, false, 180);
46
- _model.setAttribute("ng-model", modelName);
47
- return option;
48
- }
49
- var comments = [
50
- group(
51
- createSwitchOption(settings.useHello.name, "useHello.value"),
52
- function () {
53
- var _option = opt(settings.helloSrc.name, settings.helloSrc.value, 180);
54
- _option.setAttribute("ng-if", "useHello.value")
55
- return _option;
56
- }()
57
- ),
58
- group(
59
- opt(i18n("皮肤中心", "Skin Store"), "", 180),
60
- opt(i18n("音质选择", "Tone quality"), "", 180),
61
- createSwitchOption(settings.autoDownloadAvatar.name, "autoDownloadAvatar.value"),
62
- createSwitchOption(settings.autoRotateAvatar.name, "autoRotateAvatar.value"),
63
- createSwitchOption(settings.autoSave.name, "autoSave.value"),
64
- createSwitchOption(settings.shakeSwitch.name, "shakeSwitch.value"),
65
- createSwitchOption(settings.costTips.name, "costTips.value"),
66
- createSwitchOption(settings.carLrc.name, "carLrc.value")
67
- ),
68
- group(
69
- opt(i18n("清除缓存", "Clear cache"), "441.2M", 180),
70
- opt(i18n("清空消息记录", "Clean up message records"), "", false, 180)
71
- ),
72
- group(
73
- opt(i18n("匹配通讯录", "Matching Contacts Book"), i18n("未匹配", "Unmatched"), 180),
74
- opt(i18n("消息与隐私设置", "Message and Privacy Settings"), "", 180)
75
- ),
76
- group(
77
- opt(i18n("关于酷狗音乐", "About Kugou"), "", 180),
78
- opt(i18n("意见反馈", "Feedback"), "", 180),
79
- opt(i18n("给酷狗评分", "Scoring Kugou"), "", 180)
80
- )
81
- ]
82
- appendChild(page, comments);
83
- render(page, settings);
84
- page.initialStyle = {
85
- marginLeft: "100%",
86
- zIndex: 2
87
- }
88
- function main() {
89
- return page;
90
- }
@@ -1,11 +0,0 @@
1
- & {
2
- padding-top: 50px;
3
- background-color: #f2f2f2;
4
- z-index: 1;
5
- position: absolute;
6
- height: 100%;
7
- width: 100%;
8
- top: 0;
9
- left: 0;
10
- background-color: #f2f6f9;
11
- }
@@ -1,36 +0,0 @@
1
- var page = div();
2
- var template = `<div>
3
- <div class=close ng-click=go(-1)><btn>×</btn></div>
4
- <div class=logo></div>
5
- <div class=option>
6
- <btn ng-click=go('/user/login',args)>${i18n("登录", 'Login')}</btn>
7
- <btn ng-click=go('/user/register',args)>${i18n("注册", 'Register')}</btn>
8
- </div>
9
- <div class=line><span>${i18n("其他登录方式", 'Other way to login')}</span></div>
10
- <div class=methods>
11
- <btn ng-click="go('/extra/pending',this.innerText)">
12
- ${i18n('微博', 'weblog')}
13
- </btn>
14
- <btn ng-click=go("/login/qq")>
15
- QQ
16
- </btn>
17
- <btn ng-click="go('/extra/pending',this.innerText)">
18
- ${i18n('微信', 'Wechat')}
19
- </btn>
20
- </div>
21
- <div class=tips>${i18n("登录代表你同意<a>酷狗服务</a>和<a>隐私条款</a>", "Login represent that you agree <a>酷狗服务</a> and <a>隐私条款</a>")}</div>
22
- </div>`.replace(/>\s+</g, "><");
23
- page.innerHTML = template;
24
- page.initialStyle = {
25
- transform: "scale(1.36)",
26
- opacity: 0,
27
- zIndex: 2
28
- };
29
- function main(args) {
30
- render(page, {
31
- btn: button,
32
- go,
33
- args
34
- });
35
- return page;
36
- }
@@ -1,136 +0,0 @@
1
- & {
2
- position: absolute;
3
- height : 100%;
4
- width : 100%;
5
- top : 0;
6
- left : 0;
7
- right : 0;
8
- bottom : 0;
9
-
10
- [layer=left] & {
11
- background: url('images/background.jpg') no-repeat right 0px bottom 0px / cover;
12
- }
13
- }
14
-
15
- .close {
16
- .button {
17
- color : #fff;
18
- box-shadow: none;
19
-
20
- [layer=main] & {
21
- color: #666;
22
- }
23
-
24
- &:active {
25
- color: red;
26
- }
27
-
28
- background : none;
29
- width : 50px;
30
- height : 50px;
31
- line-height: 50px;
32
- text-align : center;
33
- }
34
- }
35
-
36
- .logo {
37
- [layer=main] & {
38
- color: #666;
39
- }
40
-
41
- height : 100px;
42
- margin-top : 60px;
43
- color : #fff;
44
- font-size : 40px;
45
- text-align : center;
46
- line-height: 100px;
47
-
48
- &:after {
49
- content: "efront.cc";
50
- }
51
- }
52
-
53
- .option {
54
- max-width : 640px;
55
- margin : 0 auto;
56
- text-align: center;
57
-
58
- .button {
59
- display : block;
60
- border-radius: 18px;
61
- margin : 20px;
62
- }
63
- }
64
-
65
- .line {
66
- text-align: center;
67
- overflow : hidden;
68
- max-width : 640px;
69
- margin : 0 auto;
70
- border : 20pt solid transparent;
71
- @length : 1000px;
72
- @color : #ddd;
73
-
74
- >span {
75
- z-index : 1;
76
- color : @color;
77
- position: relative;
78
-
79
- &:before,
80
- &:after {
81
- content : "";
82
- display : block;
83
- width : @length;
84
- top : 50%;
85
- position : absolute;
86
- height : 1px;
87
- background-color: @color;
88
- }
89
-
90
- &:before {
91
- left: -@length;
92
- }
93
-
94
- &:after {
95
- right: -@length;
96
- }
97
- }
98
- }
99
-
100
- .methods {
101
- text-align: center;
102
-
103
- .button {
104
- [layer=main] & {
105
- color: #666;
106
- }
107
-
108
- height : 60px;
109
- line-height: 60px;
110
- margin : 0 8px;
111
- width : 60px;
112
- background : none;
113
- }
114
- }
115
-
116
- .tips {
117
- color : #ccc;
118
- text-align : center;
119
- user-select: none;
120
- position : absolute;
121
- bottom : 0;
122
- width : 100%;
123
- left : 0;
124
- height : 50px;
125
- line-height: 50px;
126
- cursor : default;
127
-
128
- a {
129
- color : blue;
130
- cursor: pointer;
131
-
132
- &:active {
133
- border-bottom: 1px solid;
134
- }
135
- }
136
- }
@@ -1,22 +0,0 @@
1
- <div id='fxplayer-box'>
2
- <video webkit-playsinline="true" playsinline="true" autoplay x-webkit-airplay="allow"></video>
3
- <div class="change">
4
- </div>
5
- </div>
6
- <option>
7
- <div>
8
- <div class="avatar" ng-style="{backgroundImage:'url(\''+room.imgPath+'\')'}"></div>
9
- </div>
10
- <div>
11
- <div>
12
- <span class=name style="user-select:text" ng-bind=room.nickName></span>
13
- (房号<span style="user-select:text" ng-bind='room.roomId'></span>)
14
- </div>
15
- <div>
16
- 观众:<span ng-bind=Math.random()*10000|0></span>
17
- </div>
18
- </div>
19
- <div>
20
- <button>关注</button>
21
- </div>
22
- </option>
@@ -1,76 +0,0 @@
1
- titlebar("直播");
2
- var page = div();
3
- page.innerHTML = Main;
4
- var scope = render(page, {
5
- videosrc: '',
6
- room: {},
7
- button,
8
- option
9
- }).$scope;
10
- var resize = function () {
11
- player.resize("fxplayer-box", page.clientWidth, page.clientWidth * .75);
12
- };
13
- onappend(page, function () {
14
- var offresize = on("resize")(window, resize);
15
- onremove(page, offresize);
16
- });
17
- onremove(page, function () {
18
- player.stopLive("fxplayer-box");
19
- });
20
- page.initialStyle = 'margin-left:100%;z-index:2';
21
- var player = {
22
- init() { },
23
- stopLive() {
24
- var videoElement = page.getElementsByTagName("video")[0];
25
- videoElement.removeAttribute("src");
26
- videoElement.outterHTML = videoElement.outterHTML;
27
- },
28
- resize(_, width, height) {
29
- var videoElement = page.getElementsByTagName("video")[0];
30
- videoElement.width = width | 0;
31
- videoElement.height = height | 0;
32
- }
33
- };
34
- if (/iPhone|Android/.test(navigator.userAgent)) {
35
- var currentRequest;
36
- var main = function (params) {
37
- scope.room = params;
38
- currentRequest && currentRequest.abort();
39
- var videoElement = page.getElementsByTagName("video")[0];
40
- videoElement.poster = params.imgPath;
41
- currentRequest = kugou$kugouapi.getStreamAddress(params).done(function (xhr) {
42
- var data = kugou$getJsonpData(xhr);
43
- videoElement.src = data.hls[+/Android/.test(navigator.userAgent)];
44
- resize();
45
- });
46
- videoElement.play();
47
- return page;
48
- };
49
- } else {
50
- var currentRequest;
51
- remove(page.getElementsByTagName("video")[0]);
52
- var constructor = function (params) {
53
- scope.room = params;
54
- currentRequest && currentRequest.abort();
55
- player.stopLive("fxplayer-box");
56
- currentRequest = kugou$kugouapi.fanxingRoom(params).done(function (xhr) {
57
- if (!page.isMounted) return;
58
- var data = kugou$getJsonpData(xhr);
59
- if (!data.sid) return alert("直播已结束!");
60
- scope.videosrc = data.httpflv[0];
61
- player.init({
62
- id: "fxplayer-box",
63
- url: scope.videosrc
64
- });
65
- resize();
66
- });
67
- return page;
68
- }
69
- var main = new Promise(function (ok) {
70
- init('kugou$fxPlayer', function (kugou$fxPlayer) {
71
- player = kugou$fxPlayer;
72
- player.enableLog(false);
73
- ok(constructor);
74
- })
75
- })
76
- }
@@ -1,54 +0,0 @@
1
- & {
2
- background-color: #fff;
3
- position: absolute;
4
- top: 0;
5
- bottom: 0;
6
- width: 100%;
7
- left: 0; // border-top: 50px solid transparent;
8
- }
9
-
10
- &+.titlebar {
11
- background: transparent;
12
- box-shadow: none;
13
- border: none;
14
- color: transparent;
15
- }
16
-
17
- .change {
18
- position: absolute;
19
- right: 10px;
20
- top: 10px;
21
- background: url("https://s4fx.kgimg.com/pub/rmobile/images/changeRoom_000853a.png") center / contain;
22
- width: 40px;
23
- height: 40px;
24
- border-radius: 50%;
25
- }
26
-
27
- #fxplayer-box {
28
- min-height: 50px;
29
- }
30
-
31
- .option {
32
- .body {
33
- text-align: left;
34
- line-height: 24px;
35
- >div:nth-child(1) {
36
- color: #888;
37
- .name {
38
- color: #000;
39
- }
40
- }
41
- >div:nth-child(2) {
42
- color: #a7a7a7;
43
- }
44
- }
45
- }
46
-
47
- .avatar {
48
- border-radius: 50%;
49
- height: 40px;
50
- width: 40px;
51
- background-position: center;
52
- background-repeat: no-repeat;
53
- background-size: cover;
54
- }
@@ -1,55 +0,0 @@
1
- // 中文编码 utf-8
2
- var qq_icon = icon("QQ", 0xffffff);
3
- var loginBtn = button(qq_icon);
4
- onclick(loginBtn, function () {
5
- go("/user/login");
6
- });
7
- css(qq_icon, "width:28px;height:28px;margin:-14px;top:50%;left:50%;position:absolute;");
8
- css(loginBtn, "display:inline-block;position:absolute;right:0;top:0;height:100%;width:60px;background-color:transparent");
9
- var tbar = titlebar("EFRONT.cc", [loginBtn], false);
10
- css(tbar,"text-align:left;padding-left:20px;")
11
- var page = createElement(div, tbar, slider());
12
- css(page, "font-size:40px;color:#fff;padding-top:50px;");
13
-
14
- var group_sample = createElement(div);
15
- css(group_sample, "width:100%;height:auto;position:relative;");
16
- var title_sample = createElement(div);
17
- css(title_sample, "width:100%;height:50px;position:relative;");
18
- var body_sample = createElement(div);
19
- css(body_sample, "width:");
20
- // var group=function(title,objects){
21
- // var title=createElement(div);
22
- // appendChild(div,title);
23
- // var images=objects.map(function(object){
24
- // var image=new Image;
25
- // image.src=object.image||object.images[0];
26
- // image.onclick=function(){
27
- // go(object.url);
28
- // };
29
- // return image;
30
- // });
31
- // var body=createElement(div);
32
- // appendChild(body,images);
33
- // var group=createElement(div);
34
-
35
- // };
36
- appendChild(page, group(
37
- option(icon("menu"), ""),
38
- option(icon("menu"), ""),
39
- option(icon("menu"), ""),
40
- option(icon("menu"), ""),
41
- option(icon("menu"), ""),
42
- option(icon("menu"), ""),
43
- option(icon("menu"), "")
44
- ), group(
45
- option(icon("menu"), ""),
46
- option(icon("menu"), ""),
47
- option(icon("menu"), ""),
48
- option(icon("menu"), ""),
49
- option(icon("menu"), ""),
50
- option(icon("menu"), "")
51
- ));
52
-
53
- function main() {
54
- return vbox(page);
55
- }
File without changes
@@ -1,78 +0,0 @@
1
- var scanner = require("./scanner");
2
- var keywords = require("./keywords");
3
- var strings = require("../basic/strings");
4
- var hasOwnProperty = {}.hasOwnProperty;
5
- var getReadableKey = function ($key, value) {
6
- value = value.replace(/-->/g, '--\\>');
7
- if (!/^[a-z][\w\$]*$/i.test($key)) {
8
- $key = $key.replace(/[^\w\$]+/g, '_');
9
- if ($key.length > 20) $key = $key.slice(0, 4) + $key.slice(-20);
10
- }
11
- $key = $key.replace(/(\d\.?)px/ig, "$1_px");
12
- var id = 0;
13
- while (($key in paramsMap) && paramsMap[$key] !== value || $key in keywords) {
14
- $key = $key.replace(/\d+$/, '') + ++id;
15
- }
16
- if (!hasOwnProperty.call(paramsMap, $key)) {
17
- paramsMap[$key] = value;
18
- }
19
- return $key;
20
- };
21
- var setMatchedConstString = function (k) {
22
-
23
- if (/^(['"])user?\s+strict\1$/i.test(k)) return `"use strict"`;
24
- if (k.length < 3) return k;
25
- k = strings.decode(k);
26
- k = strings.encode(k);
27
- var $key = "str_" + k.replace(/^(['"])([\s\S]*)\1$/g, '$2');
28
- var key = getReadableKey($key, k);
29
- return " " + key + " ";
30
- };
31
- var setMatchedConstRegExp = function (k) {
32
- var $key = "reg_" + k.replace(/^\/([\s\S]*)\/(\w*)$/g, '$1_$2');
33
- $key = getReadableKey($key, k);
34
- return " " + $key + " ";
35
- };
36
- var trimStringLiteral = function (block) {
37
- var block_string = module_string.slice(block.start, block.end);
38
- if (block.type === block.single_quote_scanner || block.type === block.double_quote_scanner) {
39
- return setMatchedConstString(block_string);
40
- }
41
- if (block.type === block.regexp_quote_scanner) {
42
- return setMatchedConstRegExp(block_string);
43
- }
44
- if (block.type === block.template_quote_scanner) {
45
- var { start, end } = block;
46
- if (block.children) {
47
- var res = [];
48
- for (var c of block.children) {
49
- res.push(
50
- module_string.slice(start, c.start),
51
- trimStringLiteral(c)
52
- );
53
- start = c.end;
54
- }
55
- res.push(module_string.slice(start, end));
56
- return res.join('');
57
- }
58
- }
59
- return block_string;
60
- };
61
- var paramsMap = Object.create(null);
62
- var module_string = '';
63
- function breakcode(data, args) {
64
- if (!args) return [data];
65
- module_string = data;
66
- Object.keys(args).forEach(function (key) {
67
- paramsMap[key] = true;
68
- });
69
- var code_blocks = scanner(module_string);
70
- module_string = code_blocks.map(trimStringLiteral).join("");
71
- var res = Object.keys(paramsMap).filter(k => !hasOwnProperty.call(args, k));
72
- var val = res.map(k => paramsMap[k]);
73
- paramsMap = Object.create(null);
74
- data = module_string;
75
- module_string = '';
76
- return [data, res, val];
77
- }
78
- module.exports = breakcode;