webgal-parser 4.5.18 → 4.6.2

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.
@@ -144,39 +144,39 @@ function argsParser(argsRaw, assetSetter) {
144
144
  value: assetSetter(e, fileType.vocal),
145
145
  });
146
146
  }
147
+ else if (argName === 'vocal' && argValue !== undefined) {
148
+ returnArrayList.push({
149
+ key: argName,
150
+ value: assetSetter(argValue, fileType.vocal),
151
+ });
152
+ }
153
+ // 判断是不是省略参数
154
+ else if (argValue === undefined) {
155
+ returnArrayList.push({
156
+ key: argName,
157
+ value: true,
158
+ });
159
+ }
160
+ // 是字符串描述的布尔值
161
+ else if (argValue === 'true' || argValue === 'false') {
162
+ returnArrayList.push({
163
+ key: argName,
164
+ value: argValue === 'true',
165
+ });
166
+ }
167
+ // 是数字
168
+ else if (!isNaN(Number(argValue))) {
169
+ returnArrayList.push({
170
+ key: argName,
171
+ value: Number(argValue),
172
+ });
173
+ }
174
+ // 是普通参数
147
175
  else {
148
- // 判断是不是省略参数
149
- if (argValue === undefined) {
150
- returnArrayList.push({
151
- key: argName,
152
- value: true,
153
- });
154
- }
155
- else {
156
- // 是字符串描述的布尔值
157
- if (argValue === 'true' || argValue === 'false') {
158
- returnArrayList.push({
159
- key: argName,
160
- value: argValue === 'true',
161
- });
162
- }
163
- else {
164
- // 是数字
165
- if (!isNaN(Number(argValue))) {
166
- returnArrayList.push({
167
- key: argName,
168
- value: Number(argValue),
169
- });
170
- }
171
- else {
172
- // 是普通参数
173
- returnArrayList.push({
174
- key: argName,
175
- value: argValue,
176
- });
177
- }
178
- }
179
- }
176
+ returnArrayList.push({
177
+ key: argName,
178
+ value: argValue,
179
+ });
180
180
  }
181
181
  });
182
182
  return returnArrayList;
@@ -349,7 +349,7 @@ function getChooseContent(contentRaw, assetSetter) {
349
349
  * @param args 参数列表
350
350
  * @return {Array<IAsset>} 语句携带的参数列表
351
351
  */
352
- const assetsScanner = (command, content, args) => {
352
+ const assetsScanner = (command, content, args, lineNumber) => {
353
353
  const returnAssetsList = [];
354
354
  if (command === commandType.say) {
355
355
  args.forEach((e) => {
@@ -357,7 +357,7 @@ const assetsScanner = (command, content, args) => {
357
357
  returnAssetsList.push({
358
358
  name: e.value,
359
359
  url: e.value,
360
- lineNumber: 0,
360
+ lineNumber,
361
361
  type: fileType.vocal,
362
362
  });
363
363
  }
@@ -371,7 +371,7 @@ const assetsScanner = (command, content, args) => {
371
371
  returnAssetsList.push({
372
372
  name: content,
373
373
  url: content,
374
- lineNumber: 0,
374
+ lineNumber,
375
375
  type: fileType.background,
376
376
  });
377
377
  }
@@ -379,7 +379,7 @@ const assetsScanner = (command, content, args) => {
379
379
  returnAssetsList.push({
380
380
  name: content,
381
381
  url: content,
382
- lineNumber: 0,
382
+ lineNumber,
383
383
  type: fileType.figure,
384
384
  });
385
385
  }
@@ -387,7 +387,7 @@ const assetsScanner = (command, content, args) => {
387
387
  returnAssetsList.push({
388
388
  name: content,
389
389
  url: content,
390
- lineNumber: 0,
390
+ lineNumber,
391
391
  type: fileType.figure,
392
392
  });
393
393
  }
@@ -395,7 +395,7 @@ const assetsScanner = (command, content, args) => {
395
395
  returnAssetsList.push({
396
396
  name: content,
397
397
  url: content,
398
- lineNumber: 0,
398
+ lineNumber,
399
399
  type: fileType.video,
400
400
  });
401
401
  }
@@ -403,7 +403,7 @@ const assetsScanner = (command, content, args) => {
403
403
  returnAssetsList.push({
404
404
  name: content,
405
405
  url: content,
406
- lineNumber: 0,
406
+ lineNumber,
407
407
  type: fileType.bgm,
408
408
  });
409
409
  }
@@ -440,7 +440,7 @@ const subSceneScanner = (command, content) => {
440
440
  * @param ADD_NEXT_ARG_LIST
441
441
  * @param SCRIPT_CONFIG_MAP
442
442
  */
443
- const scriptParser = (sentenceRaw, assetSetter, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG_MAP) => {
443
+ const scriptParser = (sentenceRaw, assetSetter, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG_MAP, lineNumber = 0) => {
444
444
  let command; // 默认为对话
445
445
  let content; // 语句内容
446
446
  let subScene; // 语句携带的子场景(可能没有)
@@ -453,7 +453,7 @@ const scriptParser = (sentenceRaw, assetSetter, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG
453
453
  const commentSplit = sentenceRaw.split(/(?<!\\);/);
454
454
  let newSentenceRaw = commentSplit[0];
455
455
  newSentenceRaw = newSentenceRaw.replaceAll('\\;', ';');
456
- const sentenceComment = commentSplit[1] ?? '';
456
+ const sentenceComment = commentSplit.slice(1).join(';');
457
457
  if (newSentenceRaw.trim() === '') {
458
458
  // 注释提前返回
459
459
  return {
@@ -505,7 +505,7 @@ const scriptParser = (sentenceRaw, assetSetter, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG
505
505
  }
506
506
  }
507
507
  content = contentParser(newSentenceRaw.trim(), command, assetSetter); // 将语句内容里的文件名转为相对或绝对路径
508
- sentenceAssets = assetsScanner(command, content, args); // 扫描语句携带资源
508
+ sentenceAssets = assetsScanner(command, content, args, lineNumber); // 扫描语句携带资源
509
509
  subScene = subSceneScanner(command, content); // 扫描语句携带子场景
510
510
  return {
511
511
  command: command,
@@ -518,1254 +518,6 @@ const scriptParser = (sentenceRaw, assetSetter, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG
518
518
  };
519
519
  };
520
520
 
521
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
522
-
523
- /** Detect free variable `global` from Node.js. */
524
-
525
- var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
526
-
527
- var _freeGlobal = freeGlobal$1;
528
-
529
- var freeGlobal = _freeGlobal;
530
-
531
- /** Detect free variable `self`. */
532
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
533
-
534
- /** Used as a reference to the global object. */
535
- var root$4 = freeGlobal || freeSelf || Function('return this')();
536
-
537
- var _root = root$4;
538
-
539
- var root$3 = _root;
540
-
541
- /** Built-in value references. */
542
- var Symbol$2 = root$3.Symbol;
543
-
544
- var _Symbol = Symbol$2;
545
-
546
- var Symbol$1 = _Symbol;
547
-
548
- /** Used for built-in method references. */
549
- var objectProto$4 = Object.prototype;
550
-
551
- /** Used to check objects for own properties. */
552
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
553
-
554
- /**
555
- * Used to resolve the
556
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
557
- * of values.
558
- */
559
- var nativeObjectToString$1 = objectProto$4.toString;
560
-
561
- /** Built-in value references. */
562
- var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
563
-
564
- /**
565
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
566
- *
567
- * @private
568
- * @param {*} value The value to query.
569
- * @returns {string} Returns the raw `toStringTag`.
570
- */
571
- function getRawTag$1(value) {
572
- var isOwn = hasOwnProperty$3.call(value, symToStringTag$1),
573
- tag = value[symToStringTag$1];
574
-
575
- try {
576
- value[symToStringTag$1] = undefined;
577
- var unmasked = true;
578
- } catch (e) {}
579
-
580
- var result = nativeObjectToString$1.call(value);
581
- if (unmasked) {
582
- if (isOwn) {
583
- value[symToStringTag$1] = tag;
584
- } else {
585
- delete value[symToStringTag$1];
586
- }
587
- }
588
- return result;
589
- }
590
-
591
- var _getRawTag = getRawTag$1;
592
-
593
- /** Used for built-in method references. */
594
-
595
- var objectProto$3 = Object.prototype;
596
-
597
- /**
598
- * Used to resolve the
599
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
600
- * of values.
601
- */
602
- var nativeObjectToString = objectProto$3.toString;
603
-
604
- /**
605
- * Converts `value` to a string using `Object.prototype.toString`.
606
- *
607
- * @private
608
- * @param {*} value The value to convert.
609
- * @returns {string} Returns the converted string.
610
- */
611
- function objectToString$1(value) {
612
- return nativeObjectToString.call(value);
613
- }
614
-
615
- var _objectToString = objectToString$1;
616
-
617
- var Symbol = _Symbol,
618
- getRawTag = _getRawTag,
619
- objectToString = _objectToString;
620
-
621
- /** `Object#toString` result references. */
622
- var nullTag = '[object Null]',
623
- undefinedTag = '[object Undefined]';
624
-
625
- /** Built-in value references. */
626
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
627
-
628
- /**
629
- * The base implementation of `getTag` without fallbacks for buggy environments.
630
- *
631
- * @private
632
- * @param {*} value The value to query.
633
- * @returns {string} Returns the `toStringTag`.
634
- */
635
- function baseGetTag$1(value) {
636
- if (value == null) {
637
- return value === undefined ? undefinedTag : nullTag;
638
- }
639
- return (symToStringTag && symToStringTag in Object(value))
640
- ? getRawTag(value)
641
- : objectToString(value);
642
- }
643
-
644
- var _baseGetTag = baseGetTag$1;
645
-
646
- /**
647
- * Checks if `value` is the
648
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
649
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
650
- *
651
- * @static
652
- * @memberOf _
653
- * @since 0.1.0
654
- * @category Lang
655
- * @param {*} value The value to check.
656
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
657
- * @example
658
- *
659
- * _.isObject({});
660
- * // => true
661
- *
662
- * _.isObject([1, 2, 3]);
663
- * // => true
664
- *
665
- * _.isObject(_.noop);
666
- * // => true
667
- *
668
- * _.isObject(null);
669
- * // => false
670
- */
671
-
672
- function isObject$2(value) {
673
- var type = typeof value;
674
- return value != null && (type == 'object' || type == 'function');
675
- }
676
-
677
- var isObject_1 = isObject$2;
678
-
679
- var baseGetTag = _baseGetTag,
680
- isObject$1 = isObject_1;
681
-
682
- /** `Object#toString` result references. */
683
- var asyncTag = '[object AsyncFunction]',
684
- funcTag = '[object Function]',
685
- genTag = '[object GeneratorFunction]',
686
- proxyTag = '[object Proxy]';
687
-
688
- /**
689
- * Checks if `value` is classified as a `Function` object.
690
- *
691
- * @static
692
- * @memberOf _
693
- * @since 0.1.0
694
- * @category Lang
695
- * @param {*} value The value to check.
696
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
697
- * @example
698
- *
699
- * _.isFunction(_);
700
- * // => true
701
- *
702
- * _.isFunction(/abc/);
703
- * // => false
704
- */
705
- function isFunction$1(value) {
706
- if (!isObject$1(value)) {
707
- return false;
708
- }
709
- // The use of `Object#toString` avoids issues with the `typeof` operator
710
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
711
- var tag = baseGetTag(value);
712
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
713
- }
714
-
715
- var isFunction_1 = isFunction$1;
716
-
717
- var root$2 = _root;
718
-
719
- /** Used to detect overreaching core-js shims. */
720
- var coreJsData$1 = root$2['__core-js_shared__'];
721
-
722
- var _coreJsData = coreJsData$1;
723
-
724
- var coreJsData = _coreJsData;
725
-
726
- /** Used to detect methods masquerading as native. */
727
- var maskSrcKey = (function() {
728
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
729
- return uid ? ('Symbol(src)_1.' + uid) : '';
730
- }());
731
-
732
- /**
733
- * Checks if `func` has its source masked.
734
- *
735
- * @private
736
- * @param {Function} func The function to check.
737
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
738
- */
739
- function isMasked$1(func) {
740
- return !!maskSrcKey && (maskSrcKey in func);
741
- }
742
-
743
- var _isMasked = isMasked$1;
744
-
745
- /** Used for built-in method references. */
746
-
747
- var funcProto$1 = Function.prototype;
748
-
749
- /** Used to resolve the decompiled source of functions. */
750
- var funcToString$1 = funcProto$1.toString;
751
-
752
- /**
753
- * Converts `func` to its source code.
754
- *
755
- * @private
756
- * @param {Function} func The function to convert.
757
- * @returns {string} Returns the source code.
758
- */
759
- function toSource$1(func) {
760
- if (func != null) {
761
- try {
762
- return funcToString$1.call(func);
763
- } catch (e) {}
764
- try {
765
- return (func + '');
766
- } catch (e) {}
767
- }
768
- return '';
769
- }
770
-
771
- var _toSource = toSource$1;
772
-
773
- var isFunction = isFunction_1,
774
- isMasked = _isMasked,
775
- isObject = isObject_1,
776
- toSource = _toSource;
777
-
778
- /**
779
- * Used to match `RegExp`
780
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
781
- */
782
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
783
-
784
- /** Used to detect host constructors (Safari). */
785
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
786
-
787
- /** Used for built-in method references. */
788
- var funcProto = Function.prototype,
789
- objectProto$2 = Object.prototype;
790
-
791
- /** Used to resolve the decompiled source of functions. */
792
- var funcToString = funcProto.toString;
793
-
794
- /** Used to check objects for own properties. */
795
- var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
796
-
797
- /** Used to detect if a method is native. */
798
- var reIsNative = RegExp('^' +
799
- funcToString.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&')
800
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
801
- );
802
-
803
- /**
804
- * The base implementation of `_.isNative` without bad shim checks.
805
- *
806
- * @private
807
- * @param {*} value The value to check.
808
- * @returns {boolean} Returns `true` if `value` is a native function,
809
- * else `false`.
810
- */
811
- function baseIsNative$1(value) {
812
- if (!isObject(value) || isMasked(value)) {
813
- return false;
814
- }
815
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
816
- return pattern.test(toSource(value));
817
- }
818
-
819
- var _baseIsNative = baseIsNative$1;
820
-
821
- /**
822
- * Gets the value at `key` of `object`.
823
- *
824
- * @private
825
- * @param {Object} [object] The object to query.
826
- * @param {string} key The key of the property to get.
827
- * @returns {*} Returns the property value.
828
- */
829
-
830
- function getValue$1(object, key) {
831
- return object == null ? undefined : object[key];
832
- }
833
-
834
- var _getValue = getValue$1;
835
-
836
- var baseIsNative = _baseIsNative,
837
- getValue = _getValue;
838
-
839
- /**
840
- * Gets the native function at `key` of `object`.
841
- *
842
- * @private
843
- * @param {Object} object The object to query.
844
- * @param {string} key The key of the method to get.
845
- * @returns {*} Returns the function if it's native, else `undefined`.
846
- */
847
- function getNative$3(object, key) {
848
- var value = getValue(object, key);
849
- return baseIsNative(value) ? value : undefined;
850
- }
851
-
852
- var _getNative = getNative$3;
853
-
854
- var getNative$2 = _getNative;
855
-
856
- /* Built-in method references that are verified to be native. */
857
- var nativeCreate$4 = getNative$2(Object, 'create');
858
-
859
- var _nativeCreate = nativeCreate$4;
860
-
861
- var nativeCreate$3 = _nativeCreate;
862
-
863
- /**
864
- * Removes all key-value entries from the hash.
865
- *
866
- * @private
867
- * @name clear
868
- * @memberOf Hash
869
- */
870
- function hashClear$1() {
871
- this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
872
- this.size = 0;
873
- }
874
-
875
- var _hashClear = hashClear$1;
876
-
877
- /**
878
- * Removes `key` and its value from the hash.
879
- *
880
- * @private
881
- * @name delete
882
- * @memberOf Hash
883
- * @param {Object} hash The hash to modify.
884
- * @param {string} key The key of the value to remove.
885
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
886
- */
887
-
888
- function hashDelete$1(key) {
889
- var result = this.has(key) && delete this.__data__[key];
890
- this.size -= result ? 1 : 0;
891
- return result;
892
- }
893
-
894
- var _hashDelete = hashDelete$1;
895
-
896
- var nativeCreate$2 = _nativeCreate;
897
-
898
- /** Used to stand-in for `undefined` hash values. */
899
- var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
900
-
901
- /** Used for built-in method references. */
902
- var objectProto$1 = Object.prototype;
903
-
904
- /** Used to check objects for own properties. */
905
- var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
906
-
907
- /**
908
- * Gets the hash value for `key`.
909
- *
910
- * @private
911
- * @name get
912
- * @memberOf Hash
913
- * @param {string} key The key of the value to get.
914
- * @returns {*} Returns the entry value.
915
- */
916
- function hashGet$1(key) {
917
- var data = this.__data__;
918
- if (nativeCreate$2) {
919
- var result = data[key];
920
- return result === HASH_UNDEFINED$2 ? undefined : result;
921
- }
922
- return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
923
- }
924
-
925
- var _hashGet = hashGet$1;
926
-
927
- var nativeCreate$1 = _nativeCreate;
928
-
929
- /** Used for built-in method references. */
930
- var objectProto = Object.prototype;
931
-
932
- /** Used to check objects for own properties. */
933
- var hasOwnProperty = objectProto.hasOwnProperty;
934
-
935
- /**
936
- * Checks if a hash value for `key` exists.
937
- *
938
- * @private
939
- * @name has
940
- * @memberOf Hash
941
- * @param {string} key The key of the entry to check.
942
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
943
- */
944
- function hashHas$1(key) {
945
- var data = this.__data__;
946
- return nativeCreate$1 ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
947
- }
948
-
949
- var _hashHas = hashHas$1;
950
-
951
- var nativeCreate = _nativeCreate;
952
-
953
- /** Used to stand-in for `undefined` hash values. */
954
- var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
955
-
956
- /**
957
- * Sets the hash `key` to `value`.
958
- *
959
- * @private
960
- * @name set
961
- * @memberOf Hash
962
- * @param {string} key The key of the value to set.
963
- * @param {*} value The value to set.
964
- * @returns {Object} Returns the hash instance.
965
- */
966
- function hashSet$1(key, value) {
967
- var data = this.__data__;
968
- this.size += this.has(key) ? 0 : 1;
969
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value;
970
- return this;
971
- }
972
-
973
- var _hashSet = hashSet$1;
974
-
975
- var hashClear = _hashClear,
976
- hashDelete = _hashDelete,
977
- hashGet = _hashGet,
978
- hashHas = _hashHas,
979
- hashSet = _hashSet;
980
-
981
- /**
982
- * Creates a hash object.
983
- *
984
- * @private
985
- * @constructor
986
- * @param {Array} [entries] The key-value pairs to cache.
987
- */
988
- function Hash$1(entries) {
989
- var index = -1,
990
- length = entries == null ? 0 : entries.length;
991
-
992
- this.clear();
993
- while (++index < length) {
994
- var entry = entries[index];
995
- this.set(entry[0], entry[1]);
996
- }
997
- }
998
-
999
- // Add methods to `Hash`.
1000
- Hash$1.prototype.clear = hashClear;
1001
- Hash$1.prototype['delete'] = hashDelete;
1002
- Hash$1.prototype.get = hashGet;
1003
- Hash$1.prototype.has = hashHas;
1004
- Hash$1.prototype.set = hashSet;
1005
-
1006
- var _Hash = Hash$1;
1007
-
1008
- /**
1009
- * Removes all key-value entries from the list cache.
1010
- *
1011
- * @private
1012
- * @name clear
1013
- * @memberOf ListCache
1014
- */
1015
-
1016
- function listCacheClear$1() {
1017
- this.__data__ = [];
1018
- this.size = 0;
1019
- }
1020
-
1021
- var _listCacheClear = listCacheClear$1;
1022
-
1023
- /**
1024
- * Performs a
1025
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1026
- * comparison between two values to determine if they are equivalent.
1027
- *
1028
- * @static
1029
- * @memberOf _
1030
- * @since 4.0.0
1031
- * @category Lang
1032
- * @param {*} value The value to compare.
1033
- * @param {*} other The other value to compare.
1034
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1035
- * @example
1036
- *
1037
- * var object = { 'a': 1 };
1038
- * var other = { 'a': 1 };
1039
- *
1040
- * _.eq(object, object);
1041
- * // => true
1042
- *
1043
- * _.eq(object, other);
1044
- * // => false
1045
- *
1046
- * _.eq('a', 'a');
1047
- * // => true
1048
- *
1049
- * _.eq('a', Object('a'));
1050
- * // => false
1051
- *
1052
- * _.eq(NaN, NaN);
1053
- * // => true
1054
- */
1055
-
1056
- function eq$1(value, other) {
1057
- return value === other || (value !== value && other !== other);
1058
- }
1059
-
1060
- var eq_1 = eq$1;
1061
-
1062
- var eq = eq_1;
1063
-
1064
- /**
1065
- * Gets the index at which the `key` is found in `array` of key-value pairs.
1066
- *
1067
- * @private
1068
- * @param {Array} array The array to inspect.
1069
- * @param {*} key The key to search for.
1070
- * @returns {number} Returns the index of the matched value, else `-1`.
1071
- */
1072
- function assocIndexOf$4(array, key) {
1073
- var length = array.length;
1074
- while (length--) {
1075
- if (eq(array[length][0], key)) {
1076
- return length;
1077
- }
1078
- }
1079
- return -1;
1080
- }
1081
-
1082
- var _assocIndexOf = assocIndexOf$4;
1083
-
1084
- var assocIndexOf$3 = _assocIndexOf;
1085
-
1086
- /** Used for built-in method references. */
1087
- var arrayProto = Array.prototype;
1088
-
1089
- /** Built-in value references. */
1090
- var splice = arrayProto.splice;
1091
-
1092
- /**
1093
- * Removes `key` and its value from the list cache.
1094
- *
1095
- * @private
1096
- * @name delete
1097
- * @memberOf ListCache
1098
- * @param {string} key The key of the value to remove.
1099
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1100
- */
1101
- function listCacheDelete$1(key) {
1102
- var data = this.__data__,
1103
- index = assocIndexOf$3(data, key);
1104
-
1105
- if (index < 0) {
1106
- return false;
1107
- }
1108
- var lastIndex = data.length - 1;
1109
- if (index == lastIndex) {
1110
- data.pop();
1111
- } else {
1112
- splice.call(data, index, 1);
1113
- }
1114
- --this.size;
1115
- return true;
1116
- }
1117
-
1118
- var _listCacheDelete = listCacheDelete$1;
1119
-
1120
- var assocIndexOf$2 = _assocIndexOf;
1121
-
1122
- /**
1123
- * Gets the list cache value for `key`.
1124
- *
1125
- * @private
1126
- * @name get
1127
- * @memberOf ListCache
1128
- * @param {string} key The key of the value to get.
1129
- * @returns {*} Returns the entry value.
1130
- */
1131
- function listCacheGet$1(key) {
1132
- var data = this.__data__,
1133
- index = assocIndexOf$2(data, key);
1134
-
1135
- return index < 0 ? undefined : data[index][1];
1136
- }
1137
-
1138
- var _listCacheGet = listCacheGet$1;
1139
-
1140
- var assocIndexOf$1 = _assocIndexOf;
1141
-
1142
- /**
1143
- * Checks if a list cache value for `key` exists.
1144
- *
1145
- * @private
1146
- * @name has
1147
- * @memberOf ListCache
1148
- * @param {string} key The key of the entry to check.
1149
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1150
- */
1151
- function listCacheHas$1(key) {
1152
- return assocIndexOf$1(this.__data__, key) > -1;
1153
- }
1154
-
1155
- var _listCacheHas = listCacheHas$1;
1156
-
1157
- var assocIndexOf = _assocIndexOf;
1158
-
1159
- /**
1160
- * Sets the list cache `key` to `value`.
1161
- *
1162
- * @private
1163
- * @name set
1164
- * @memberOf ListCache
1165
- * @param {string} key The key of the value to set.
1166
- * @param {*} value The value to set.
1167
- * @returns {Object} Returns the list cache instance.
1168
- */
1169
- function listCacheSet$1(key, value) {
1170
- var data = this.__data__,
1171
- index = assocIndexOf(data, key);
1172
-
1173
- if (index < 0) {
1174
- ++this.size;
1175
- data.push([key, value]);
1176
- } else {
1177
- data[index][1] = value;
1178
- }
1179
- return this;
1180
- }
1181
-
1182
- var _listCacheSet = listCacheSet$1;
1183
-
1184
- var listCacheClear = _listCacheClear,
1185
- listCacheDelete = _listCacheDelete,
1186
- listCacheGet = _listCacheGet,
1187
- listCacheHas = _listCacheHas,
1188
- listCacheSet = _listCacheSet;
1189
-
1190
- /**
1191
- * Creates an list cache object.
1192
- *
1193
- * @private
1194
- * @constructor
1195
- * @param {Array} [entries] The key-value pairs to cache.
1196
- */
1197
- function ListCache$1(entries) {
1198
- var index = -1,
1199
- length = entries == null ? 0 : entries.length;
1200
-
1201
- this.clear();
1202
- while (++index < length) {
1203
- var entry = entries[index];
1204
- this.set(entry[0], entry[1]);
1205
- }
1206
- }
1207
-
1208
- // Add methods to `ListCache`.
1209
- ListCache$1.prototype.clear = listCacheClear;
1210
- ListCache$1.prototype['delete'] = listCacheDelete;
1211
- ListCache$1.prototype.get = listCacheGet;
1212
- ListCache$1.prototype.has = listCacheHas;
1213
- ListCache$1.prototype.set = listCacheSet;
1214
-
1215
- var _ListCache = ListCache$1;
1216
-
1217
- var getNative$1 = _getNative,
1218
- root$1 = _root;
1219
-
1220
- /* Built-in method references that are verified to be native. */
1221
- var Map$2 = getNative$1(root$1, 'Map');
1222
-
1223
- var _Map = Map$2;
1224
-
1225
- var Hash = _Hash,
1226
- ListCache = _ListCache,
1227
- Map$1 = _Map;
1228
-
1229
- /**
1230
- * Removes all key-value entries from the map.
1231
- *
1232
- * @private
1233
- * @name clear
1234
- * @memberOf MapCache
1235
- */
1236
- function mapCacheClear$1() {
1237
- this.size = 0;
1238
- this.__data__ = {
1239
- 'hash': new Hash,
1240
- 'map': new (Map$1 || ListCache),
1241
- 'string': new Hash
1242
- };
1243
- }
1244
-
1245
- var _mapCacheClear = mapCacheClear$1;
1246
-
1247
- /**
1248
- * Checks if `value` is suitable for use as unique object key.
1249
- *
1250
- * @private
1251
- * @param {*} value The value to check.
1252
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1253
- */
1254
-
1255
- function isKeyable$1(value) {
1256
- var type = typeof value;
1257
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1258
- ? (value !== '__proto__')
1259
- : (value === null);
1260
- }
1261
-
1262
- var _isKeyable = isKeyable$1;
1263
-
1264
- var isKeyable = _isKeyable;
1265
-
1266
- /**
1267
- * Gets the data for `map`.
1268
- *
1269
- * @private
1270
- * @param {Object} map The map to query.
1271
- * @param {string} key The reference key.
1272
- * @returns {*} Returns the map data.
1273
- */
1274
- function getMapData$4(map, key) {
1275
- var data = map.__data__;
1276
- return isKeyable(key)
1277
- ? data[typeof key == 'string' ? 'string' : 'hash']
1278
- : data.map;
1279
- }
1280
-
1281
- var _getMapData = getMapData$4;
1282
-
1283
- var getMapData$3 = _getMapData;
1284
-
1285
- /**
1286
- * Removes `key` and its value from the map.
1287
- *
1288
- * @private
1289
- * @name delete
1290
- * @memberOf MapCache
1291
- * @param {string} key The key of the value to remove.
1292
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1293
- */
1294
- function mapCacheDelete$1(key) {
1295
- var result = getMapData$3(this, key)['delete'](key);
1296
- this.size -= result ? 1 : 0;
1297
- return result;
1298
- }
1299
-
1300
- var _mapCacheDelete = mapCacheDelete$1;
1301
-
1302
- var getMapData$2 = _getMapData;
1303
-
1304
- /**
1305
- * Gets the map value for `key`.
1306
- *
1307
- * @private
1308
- * @name get
1309
- * @memberOf MapCache
1310
- * @param {string} key The key of the value to get.
1311
- * @returns {*} Returns the entry value.
1312
- */
1313
- function mapCacheGet$1(key) {
1314
- return getMapData$2(this, key).get(key);
1315
- }
1316
-
1317
- var _mapCacheGet = mapCacheGet$1;
1318
-
1319
- var getMapData$1 = _getMapData;
1320
-
1321
- /**
1322
- * Checks if a map value for `key` exists.
1323
- *
1324
- * @private
1325
- * @name has
1326
- * @memberOf MapCache
1327
- * @param {string} key The key of the entry to check.
1328
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1329
- */
1330
- function mapCacheHas$1(key) {
1331
- return getMapData$1(this, key).has(key);
1332
- }
1333
-
1334
- var _mapCacheHas = mapCacheHas$1;
1335
-
1336
- var getMapData = _getMapData;
1337
-
1338
- /**
1339
- * Sets the map `key` to `value`.
1340
- *
1341
- * @private
1342
- * @name set
1343
- * @memberOf MapCache
1344
- * @param {string} key The key of the value to set.
1345
- * @param {*} value The value to set.
1346
- * @returns {Object} Returns the map cache instance.
1347
- */
1348
- function mapCacheSet$1(key, value) {
1349
- var data = getMapData(this, key),
1350
- size = data.size;
1351
-
1352
- data.set(key, value);
1353
- this.size += data.size == size ? 0 : 1;
1354
- return this;
1355
- }
1356
-
1357
- var _mapCacheSet = mapCacheSet$1;
1358
-
1359
- var mapCacheClear = _mapCacheClear,
1360
- mapCacheDelete = _mapCacheDelete,
1361
- mapCacheGet = _mapCacheGet,
1362
- mapCacheHas = _mapCacheHas,
1363
- mapCacheSet = _mapCacheSet;
1364
-
1365
- /**
1366
- * Creates a map cache object to store key-value pairs.
1367
- *
1368
- * @private
1369
- * @constructor
1370
- * @param {Array} [entries] The key-value pairs to cache.
1371
- */
1372
- function MapCache$1(entries) {
1373
- var index = -1,
1374
- length = entries == null ? 0 : entries.length;
1375
-
1376
- this.clear();
1377
- while (++index < length) {
1378
- var entry = entries[index];
1379
- this.set(entry[0], entry[1]);
1380
- }
1381
- }
1382
-
1383
- // Add methods to `MapCache`.
1384
- MapCache$1.prototype.clear = mapCacheClear;
1385
- MapCache$1.prototype['delete'] = mapCacheDelete;
1386
- MapCache$1.prototype.get = mapCacheGet;
1387
- MapCache$1.prototype.has = mapCacheHas;
1388
- MapCache$1.prototype.set = mapCacheSet;
1389
-
1390
- var _MapCache = MapCache$1;
1391
-
1392
- /** Used to stand-in for `undefined` hash values. */
1393
-
1394
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
1395
-
1396
- /**
1397
- * Adds `value` to the array cache.
1398
- *
1399
- * @private
1400
- * @name add
1401
- * @memberOf SetCache
1402
- * @alias push
1403
- * @param {*} value The value to cache.
1404
- * @returns {Object} Returns the cache instance.
1405
- */
1406
- function setCacheAdd$1(value) {
1407
- this.__data__.set(value, HASH_UNDEFINED);
1408
- return this;
1409
- }
1410
-
1411
- var _setCacheAdd = setCacheAdd$1;
1412
-
1413
- /**
1414
- * Checks if `value` is in the array cache.
1415
- *
1416
- * @private
1417
- * @name has
1418
- * @memberOf SetCache
1419
- * @param {*} value The value to search for.
1420
- * @returns {number} Returns `true` if `value` is found, else `false`.
1421
- */
1422
-
1423
- function setCacheHas$1(value) {
1424
- return this.__data__.has(value);
1425
- }
1426
-
1427
- var _setCacheHas = setCacheHas$1;
1428
-
1429
- var MapCache = _MapCache,
1430
- setCacheAdd = _setCacheAdd,
1431
- setCacheHas = _setCacheHas;
1432
-
1433
- /**
1434
- *
1435
- * Creates an array cache object to store unique values.
1436
- *
1437
- * @private
1438
- * @constructor
1439
- * @param {Array} [values] The values to cache.
1440
- */
1441
- function SetCache$1(values) {
1442
- var index = -1,
1443
- length = values == null ? 0 : values.length;
1444
-
1445
- this.__data__ = new MapCache;
1446
- while (++index < length) {
1447
- this.add(values[index]);
1448
- }
1449
- }
1450
-
1451
- // Add methods to `SetCache`.
1452
- SetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;
1453
- SetCache$1.prototype.has = setCacheHas;
1454
-
1455
- var _SetCache = SetCache$1;
1456
-
1457
- /**
1458
- * The base implementation of `_.findIndex` and `_.findLastIndex` without
1459
- * support for iteratee shorthands.
1460
- *
1461
- * @private
1462
- * @param {Array} array The array to inspect.
1463
- * @param {Function} predicate The function invoked per iteration.
1464
- * @param {number} fromIndex The index to search from.
1465
- * @param {boolean} [fromRight] Specify iterating from right to left.
1466
- * @returns {number} Returns the index of the matched value, else `-1`.
1467
- */
1468
-
1469
- function baseFindIndex$1(array, predicate, fromIndex, fromRight) {
1470
- var length = array.length,
1471
- index = fromIndex + (fromRight ? 1 : -1);
1472
-
1473
- while ((fromRight ? index-- : ++index < length)) {
1474
- if (predicate(array[index], index, array)) {
1475
- return index;
1476
- }
1477
- }
1478
- return -1;
1479
- }
1480
-
1481
- var _baseFindIndex = baseFindIndex$1;
1482
-
1483
- /**
1484
- * The base implementation of `_.isNaN` without support for number objects.
1485
- *
1486
- * @private
1487
- * @param {*} value The value to check.
1488
- * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
1489
- */
1490
-
1491
- function baseIsNaN$1(value) {
1492
- return value !== value;
1493
- }
1494
-
1495
- var _baseIsNaN = baseIsNaN$1;
1496
-
1497
- /**
1498
- * A specialized version of `_.indexOf` which performs strict equality
1499
- * comparisons of values, i.e. `===`.
1500
- *
1501
- * @private
1502
- * @param {Array} array The array to inspect.
1503
- * @param {*} value The value to search for.
1504
- * @param {number} fromIndex The index to search from.
1505
- * @returns {number} Returns the index of the matched value, else `-1`.
1506
- */
1507
-
1508
- function strictIndexOf$1(array, value, fromIndex) {
1509
- var index = fromIndex - 1,
1510
- length = array.length;
1511
-
1512
- while (++index < length) {
1513
- if (array[index] === value) {
1514
- return index;
1515
- }
1516
- }
1517
- return -1;
1518
- }
1519
-
1520
- var _strictIndexOf = strictIndexOf$1;
1521
-
1522
- var baseFindIndex = _baseFindIndex,
1523
- baseIsNaN = _baseIsNaN,
1524
- strictIndexOf = _strictIndexOf;
1525
-
1526
- /**
1527
- * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
1528
- *
1529
- * @private
1530
- * @param {Array} array The array to inspect.
1531
- * @param {*} value The value to search for.
1532
- * @param {number} fromIndex The index to search from.
1533
- * @returns {number} Returns the index of the matched value, else `-1`.
1534
- */
1535
- function baseIndexOf$1(array, value, fromIndex) {
1536
- return value === value
1537
- ? strictIndexOf(array, value, fromIndex)
1538
- : baseFindIndex(array, baseIsNaN, fromIndex);
1539
- }
1540
-
1541
- var _baseIndexOf = baseIndexOf$1;
1542
-
1543
- var baseIndexOf = _baseIndexOf;
1544
-
1545
- /**
1546
- * A specialized version of `_.includes` for arrays without support for
1547
- * specifying an index to search from.
1548
- *
1549
- * @private
1550
- * @param {Array} [array] The array to inspect.
1551
- * @param {*} target The value to search for.
1552
- * @returns {boolean} Returns `true` if `target` is found, else `false`.
1553
- */
1554
- function arrayIncludes$1(array, value) {
1555
- var length = array == null ? 0 : array.length;
1556
- return !!length && baseIndexOf(array, value, 0) > -1;
1557
- }
1558
-
1559
- var _arrayIncludes = arrayIncludes$1;
1560
-
1561
- /**
1562
- * This function is like `arrayIncludes` except that it accepts a comparator.
1563
- *
1564
- * @private
1565
- * @param {Array} [array] The array to inspect.
1566
- * @param {*} target The value to search for.
1567
- * @param {Function} comparator The comparator invoked per element.
1568
- * @returns {boolean} Returns `true` if `target` is found, else `false`.
1569
- */
1570
-
1571
- function arrayIncludesWith$1(array, value, comparator) {
1572
- var index = -1,
1573
- length = array == null ? 0 : array.length;
1574
-
1575
- while (++index < length) {
1576
- if (comparator(value, array[index])) {
1577
- return true;
1578
- }
1579
- }
1580
- return false;
1581
- }
1582
-
1583
- var _arrayIncludesWith = arrayIncludesWith$1;
1584
-
1585
- /**
1586
- * Checks if a `cache` value for `key` exists.
1587
- *
1588
- * @private
1589
- * @param {Object} cache The cache to query.
1590
- * @param {string} key The key of the entry to check.
1591
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1592
- */
1593
-
1594
- function cacheHas$1(cache, key) {
1595
- return cache.has(key);
1596
- }
1597
-
1598
- var _cacheHas = cacheHas$1;
1599
-
1600
- var getNative = _getNative,
1601
- root = _root;
1602
-
1603
- /* Built-in method references that are verified to be native. */
1604
- var Set$1 = getNative(root, 'Set');
1605
-
1606
- var _Set = Set$1;
1607
-
1608
- /**
1609
- * This method returns `undefined`.
1610
- *
1611
- * @static
1612
- * @memberOf _
1613
- * @since 2.3.0
1614
- * @category Util
1615
- * @example
1616
- *
1617
- * _.times(2, _.noop);
1618
- * // => [undefined, undefined]
1619
- */
1620
-
1621
- function noop$1() {
1622
- // No operation performed.
1623
- }
1624
-
1625
- var noop_1 = noop$1;
1626
-
1627
- /**
1628
- * Converts `set` to an array of its values.
1629
- *
1630
- * @private
1631
- * @param {Object} set The set to convert.
1632
- * @returns {Array} Returns the values.
1633
- */
1634
-
1635
- function setToArray$2(set) {
1636
- var index = -1,
1637
- result = Array(set.size);
1638
-
1639
- set.forEach(function(value) {
1640
- result[++index] = value;
1641
- });
1642
- return result;
1643
- }
1644
-
1645
- var _setToArray = setToArray$2;
1646
-
1647
- var Set = _Set,
1648
- noop = noop_1,
1649
- setToArray$1 = _setToArray;
1650
-
1651
- /** Used as references for various `Number` constants. */
1652
- var INFINITY = 1 / 0;
1653
-
1654
- /**
1655
- * Creates a set object of `values`.
1656
- *
1657
- * @private
1658
- * @param {Array} values The values to add to the set.
1659
- * @returns {Object} Returns the new set.
1660
- */
1661
- var createSet$1 = !(Set && (1 / setToArray$1(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
1662
- return new Set(values);
1663
- };
1664
-
1665
- var _createSet = createSet$1;
1666
-
1667
- var SetCache = _SetCache,
1668
- arrayIncludes = _arrayIncludes,
1669
- arrayIncludesWith = _arrayIncludesWith,
1670
- cacheHas = _cacheHas,
1671
- createSet = _createSet,
1672
- setToArray = _setToArray;
1673
-
1674
- /** Used as the size to enable large array optimizations. */
1675
- var LARGE_ARRAY_SIZE = 200;
1676
-
1677
- /**
1678
- * The base implementation of `_.uniqBy` without support for iteratee shorthands.
1679
- *
1680
- * @private
1681
- * @param {Array} array The array to inspect.
1682
- * @param {Function} [iteratee] The iteratee invoked per element.
1683
- * @param {Function} [comparator] The comparator invoked per element.
1684
- * @returns {Array} Returns the new duplicate free array.
1685
- */
1686
- function baseUniq$1(array, iteratee, comparator) {
1687
- var index = -1,
1688
- includes = arrayIncludes,
1689
- length = array.length,
1690
- isCommon = true,
1691
- result = [],
1692
- seen = result;
1693
-
1694
- if (comparator) {
1695
- isCommon = false;
1696
- includes = arrayIncludesWith;
1697
- }
1698
- else if (length >= LARGE_ARRAY_SIZE) {
1699
- var set = iteratee ? null : createSet(array);
1700
- if (set) {
1701
- return setToArray(set);
1702
- }
1703
- isCommon = false;
1704
- includes = cacheHas;
1705
- seen = new SetCache;
1706
- }
1707
- else {
1708
- seen = iteratee ? [] : result;
1709
- }
1710
- outer:
1711
- while (++index < length) {
1712
- var value = array[index],
1713
- computed = iteratee ? iteratee(value) : value;
1714
-
1715
- value = (comparator || value !== 0) ? value : 0;
1716
- if (isCommon && computed === computed) {
1717
- var seenIndex = seen.length;
1718
- while (seenIndex--) {
1719
- if (seen[seenIndex] === computed) {
1720
- continue outer;
1721
- }
1722
- }
1723
- if (iteratee) {
1724
- seen.push(computed);
1725
- }
1726
- result.push(value);
1727
- }
1728
- else if (!includes(seen, computed, comparator)) {
1729
- if (seen !== result) {
1730
- seen.push(computed);
1731
- }
1732
- result.push(value);
1733
- }
1734
- }
1735
- return result;
1736
- }
1737
-
1738
- var _baseUniq = baseUniq$1;
1739
-
1740
- var baseUniq = _baseUniq;
1741
-
1742
- /**
1743
- * This method is like `_.uniq` except that it accepts `comparator` which
1744
- * is invoked to compare elements of `array`. The order of result values is
1745
- * determined by the order they occur in the array.The comparator is invoked
1746
- * with two arguments: (arrVal, othVal).
1747
- *
1748
- * @static
1749
- * @memberOf _
1750
- * @since 4.0.0
1751
- * @category Array
1752
- * @param {Array} array The array to inspect.
1753
- * @param {Function} [comparator] The comparator invoked per element.
1754
- * @returns {Array} Returns the new duplicate free array.
1755
- * @example
1756
- *
1757
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
1758
- *
1759
- * _.uniqWith(objects, _.isEqual);
1760
- * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
1761
- */
1762
- function uniqWith(array, comparator) {
1763
- comparator = typeof comparator == 'function' ? comparator : undefined;
1764
- return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
1765
- }
1766
-
1767
- var uniqWith_1 = uniqWith;
1768
-
1769
521
  /**
1770
522
  * 场景解析器
1771
523
  * @param rawScene 原始场景
@@ -1785,15 +537,15 @@ const sceneParser = (rawScene, sceneName, sceneUrl, assetsPrefetcher, assetSette
1785
537
  // .filter((sentence) => sentence.trim() !== "");
1786
538
  let assetsList = []; // 场景资源列表
1787
539
  let subSceneList = []; // 子场景列表
1788
- const sentenceList = rawSentenceListWithoutEmpty.map((sentence) => {
1789
- const returnSentence = scriptParser(sentence, assetSetter, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG_MAP);
540
+ const sentenceList = rawSentenceListWithoutEmpty.map((sentence, index) => {
541
+ const returnSentence = scriptParser(sentence, assetSetter, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG_MAP, index);
1790
542
  // 在这里解析出语句可能携带的资源和场景,合并到 assetsList 和 subSceneList
1791
543
  assetsList = [...assetsList, ...returnSentence.sentenceAssets];
1792
544
  subSceneList = [...subSceneList, ...returnSentence.subScene];
1793
545
  return returnSentence;
1794
546
  });
1795
547
  // 开始资源的预加载
1796
- assetsList = uniqWith_1(assetsList); // 去重
548
+ assetsList = deduplicateAssets(assetsList);
1797
549
  assetsPrefetcher(assetsList);
1798
550
  return {
1799
551
  sceneName: sceneName,
@@ -1802,6 +554,20 @@ const sceneParser = (rawScene, sceneName, sceneUrl, assetsPrefetcher, assetSette
1802
554
  assetsList: assetsList,
1803
555
  subSceneList: subSceneList, // 子场景列表
1804
556
  };
557
+ };
558
+ const deduplicateAssets = (assetsList) => {
559
+ const seenAssets = new Set();
560
+ return assetsList.filter((asset) => {
561
+ if (!asset || typeof asset.url !== 'string' || asset.url === '') {
562
+ return false;
563
+ }
564
+ const assetKey = `${asset.type}:${asset.url}`;
565
+ if (seenAssets.has(assetKey)) {
566
+ return false;
567
+ }
568
+ seenAssets.add(assetKey);
569
+ return true;
570
+ });
1805
571
  };
1806
572
 
1807
573
  function scss2cssinjsParser(scssString) {