更新前端静态网页获取方式,放弃使用后端获取api

This commit is contained in:
2025-09-09 10:47:51 +08:00
parent 6889ca37e5
commit 44a4f1bae1
25558 changed files with 2463152 additions and 153 deletions

View File

@@ -0,0 +1,27 @@
'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var toIndexedObject = require('../internals/to-indexed-object');
var toString = require('../internals/to-string');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var $TypeError = TypeError;
var push = uncurryThis([].push);
var join = uncurryThis([].join);
// `String.cooked` method
// https://tc39.es/proposal-string-cooked/
module.exports = function cooked(template /* , ...substitutions */) {
var cookedTemplate = toIndexedObject(template);
var literalSegments = lengthOfArrayLike(cookedTemplate);
if (!literalSegments) return '';
var argumentsLength = arguments.length;
var elements = [];
var i = 0;
while (true) {
var nextVal = cookedTemplate[i++];
if (nextVal === undefined) throw new $TypeError('Incorrect template');
push(elements, toString(nextVal));
if (i === literalSegments) return join(elements, '');
if (i < argumentsLength) push(elements, toString(arguments[i]));
}
};